You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need all strings in the custom blocks to be translatable into other languages.
We'll do this using dotCMS Language variables, which allow users to create different versions of the strings for different languages. We'll create the Language variables in the default language, using the English versions of the strings; if customers want translations in languages other than English, they can easily create them.
Making the strings translatable requires changes to both the plugin and the custom blocks.
Plugin
Implement new code to create Language variables for each of the strings, with a unique key for each string.
Language variables are a type of content in dotCMS.
So, this will mean making one method call for each string, to create the Language variable content for that string.
The code to create the Language variables should only be run if the Language variables don't already exist.
If the Language variables already exist, they should not be overwritten.
The code then will be a series of IF statements (or potentially a loop), one for each key (warning: bad pseudocode below):
if {{key doesn't exist}}
{{call method to create Language variable with the key and the default string}}
The code to create the Language variables will be hard-coded in the plugin (not changeable via the App).
The strings can be changed via the Language variables in the dotCMS back-end.
UI
Change all string retrieval to pull the strings based on the key, using the methods already identified.
The text was updated successfully, but these errors were encountered:
We need all strings in the custom blocks to be translatable into other languages.
We'll do this using dotCMS Language variables, which allow users to create different versions of the strings for different languages. We'll create the Language variables in the default language, using the English versions of the strings; if customers want translations in languages other than English, they can easily create them.
Making the strings translatable requires changes to both the plugin and the custom blocks.
Plugin
Implement new code to create Language variables for each of the strings, with a unique key for each string.
UI
Change all string retrieval to pull the strings based on the key, using the methods already identified.
The text was updated successfully, but these errors were encountered: