How to translate dynamic content?
In this article, you'll learn how to translate dynamic content.
First of all, note that this feature is currently not available on WordPress.
What is Dynamic Content?
Dynamic content on a website refers to elements that change based on user interaction or real-time updates. Examples of dynamic content include user-generated comments, real-time stock updates, or personalized greetings. Translating dynamic content can be a bit tricky, but this guide will simplify the process for you.
Steps to Translate Dynamic Content with Weglot
Access the Web Inspector: Navigate to the webpage you want to translate. Right-click on the page to reveal a menu and select "Inspect" to open the web inspector panel.
Identify the Dynamic Element: In the inspector panel, use the selector tool to hover over the area that isn't being translated. This will highlight the element.
Find the Class or ID: Once the element is highlighted, look for its .class or #ID in the inspector panel.
- Update Weglot Setting: Head over to your Weglot Dashboard. Then, under Settings, navigate to App Settings (or "Your CMS name" Settings).
To add the dynamic content you'd like to translate, click the "Add Dynamic" button. This will open up the "Add Dynamic Element" box, where you can input the specific .class or #ID associated with the content.
Quick Tips
- Prefix a class name with a period (.) and an ID with a hashtag (#).
- You can also add a description to remember what the added selector translates.
5. Save and Refresh: Click on "Save". You might need to clear your browser cache and refresh the page to see the translated content.
- Import/Export dynamic rules
To import or export dynamic rules, you need to manage at least an Advanced plan (see our pricing page).
Once in your App Settings (or "Your CMS name" Settings), you can use the "Actions" button to import/export translations:
Please note that you can import only CSV files, with a maximum of 500 dynamic elements and the files need to fit a specific structure. You can download an example file.
It is important not to modify the headers/the structure of the file because the import will not work as intended if the headers are modified.
To do an import, you can drag the file or click on the "Add" button.
Once the file is added, just click on "Next" and it will be imported.
Feedback
If you have any thoughts or questions about this guide, let us know! We'd love to hear from you.