As an accordion’s output comes from a shortcode and the shortcode gets executed in the frontend, WPML can’t translate the content of an accordion.
However, there is an easy way to translate your accordion. To do so, please follow the below instruction.
Instructions:
STEP 1: MAKING AN ACCORDION SHORTCODE TRANSLATABLE
- The WPML Multilingual CMS plugin should be installed and activated.
- Click on WPML→ ‘Translation Options’.
- Tick the All Accordions (sp_easy_accordion) item to make the accordion shortcode translatable.
- Click on the Save button to save changes.
- If the WPML Translation Management plugin is installed, the option will be found through Translation Management → Multilingual Content Setup → Scrolling down.
- Now, there appears a Plus icon. By clicking the icon, the shortcode can be translated with a new shortcode in a different language.
STEP 2: CREATING A TRANSLATED SHORTCODE INTO ANOTHER LANGUAGE
- Click on the All Accordions menu.
- Click on the + sign of that shortcode under the other language column.
- A new shortcode page will be opened as usual.
- Add title, content, styles as usual.
- Click on Publish button.
STEP 3: PLACING THE NEW SHORTCODE IN POST OR PAGE EDITOR OR WIDGET
- Click on the All Accordions menu.
- Then, click on another language tab from the top. In our case, Japanese.
- There will be the translated shortcode.
- Copy the shortcode.
- Go to your translated post/page where the main shortcode is pasted.
- Replace the shortcode with the translated shortcode.
Conclusion: If all the steps are followed correctly, the shortcodes should run properly. Thus, users can see the translated shortcodes in different languages with the WPML plugin by clicking the language switch.