Fundamentals / Internationalization |
Add translations to the snippet files for Web applications.
Some of the Genero Web Client messages and widget text translations are handled in the snippets.
For example, in the default main template (main.xhtml) for the HTML5 theme, a javascript variable named gwcLocalizedMessages contains text translations. Examples have been provided for English (en) and French (fr). Translations have also been added for Spanish and Portuguese.
/// Lines in this code snippet have been truncated to aid in page formatting. /// The code has been replaced with an ellipse (...) var gwcLocalizedMessages = {{ 'en':{{ unexpectedClosingWarningMessage: 'The Genero application is still running...', clickForDownload: 'Click here if the download doesn\'t start...', fileUploadConfirmation: 'Upload the file ?', monthList: 'January,February,March,April,May,June,July,August,...', dayList: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday', decimalSeparator: '.', 'restore column sort':'reset column sort', 'show all columns':'show all columns', 'restore default settings':'reset settings', 'Stored settings cleared':'Stored settings were cleared. Please...' }, 'fr':{{ unexpectedClosingWarningMessage: 'L\'application Genero est en cours ...', clickForDownload: 'Cliquez ici si le téléchargement ne ...', fileUploadConfirmation: 'Télécharger le fichier ?', monthList: 'Janvier,Février,Mars,Avril,Mai,Juin,Juillet,Août,...', dayList: 'Dimanche,Lundi,Mardi,Mercredi,Jeudi,Vendredi,Samedi', decimalSeparator: ',', 'restore column sort':'rétablir le tri des colonnes', 'show all columns':'voir toutes les colonnes', 'restore default settings':'restaurer les réglages par défaut', 'Stored settings cleared':'Les paramètres mémorisés ont été effacés. ...' } };
The language selected is a result of javascript instructions:
window.navigator.language || window.navigator.userLanguage || defaultLang;