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 the dictionary object
To change the translation string for specific action:
1. Find and make a copy of the dictionary object
1.1 For version
0.10.*: open LA.js file, copy laTranslation.dictionary object
1.2: For version 1.0.0-beta*: Open browser console, and run:
1.2.1 document.getElementById('copy').setAttribute("id", "copyBtn");
1.2.2 copy(laTranslation.dictionary);
2. 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
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 (partial copy).