How to add translations to LiveArt
Most localization of LiveArt could be accomplished via HTML and main configuration files.
However, a number of system messages are used directly in the JS code and we have extracted them into strings for better handling.
To change the translation string for specific action:
1. Find and make a copy of dictionary object from LA.js file (attribute of laTranslation; applicable only to 0.10.* version).
2. Rename this copy (e.g. dictionaryDE) and paste it as new global variable in desired place - e.g. in HTML inline or new .js file:
2.1 HTML example:
2.2 New .js file example:
Add to HTML template file:
Add to dictionaryDE.js file:
3. Finally, set this object to the translation attribute of laOptions in LA.config.js
To change the translation string for specific action:
1. Find and make a copy of dictionary object from LA.js file (attribute of laTranslation; applicable only to 0.10.* version).
2. Rename this copy (e.g. dictionaryDE) and paste it as new global variable in desired place - e.g. in HTML inline or new .js file:
2.1 HTML example:
<script type="text/javascript">
var dictionaryDE = {
// content from laOptions.translation, e.g.:
"DESIGN_SAVED_MESSAGE": "New translation! Design '%title%' saved successfully!"
}
</script>
2.2 New .js file example:
Add to HTML template file:
<script type="text/javascript" src="dictionaryDE.js" defer="defer"></script>
Add to dictionaryDE.js file:
var dictionaryDE = {
// content from laOptions.translation, e.g.:
"DESIGN_SAVED_MESSAGE": "New translation! Design '%title%' saved successfully!"
}
3. Finally, set this object to the translation attribute of laOptions in LA.config.js
laOptions.translation
= dictionaryDE;Important Notes:
- Translation with the following format %key% will be replaced with specific information. Please do not change the token name.
- The copy of the object (dictionaryDE) may contain only messages that need to be translated.