Add Spanish Language a UI alternative language:
Spanish Language code is es from https://www.w3schools.com/tags/ref_language_codes.asp
The following steps are the minimum to support Spanish language (Or any language):
- Insert into language table : INSERT INTO
language (languageId, isDefaultLang) VALUES ('es', false);
- Insert into languageTranslation table : INSERT INTO
languageTranslation (languageId, langId, languageName) VALUES ('es' ,'en', 'Spanish (ES)');
- Because English is the default language the above is the minimum inserts for supporting Spanish for Database tables.
- Copy
src\main\resources\i18n\messages_en.properties and rename it to src\main\resources\i18n\messages_es.properties
- Translate all english values to Spanish in above file
src\main\resources\i18n\messages_es.properties.
- Go To Gulp configuration file
JavaTMP-App-Starter/gulpfile.js.
- There is a variable called
src inside it there is a key called localeJS, add a key for Spanish language es like we did for
en and ar.
- if we did not copy specific plugin Spanish language file you should copy it in the
config variable. for example
- For plugin
jquery-validation we copied all translation from node_modules/jquery-validation/dist/localization to web/jquery-validation/dist/localization so you need Spanish language file for plugin jquery-validation called messages_es.js. Add it in your src.localJS.es array as ./web/components/jquery-validation/dist/localization/messages_es.js.
- For plugin select2 we did not copy all internationalization files in config.select2 array. so we should do by yourself after you check if the Spanish transaltion file exist or not. So go to folder
JavaTMP-App-Starter/node_modules/select2/dist/js/i18n
you will file a file called es.js which used for Spanish language.
Now we should first add it to config.select2 array as the following entry :
{"from": "${sourceNodeLib}/select2/dist/js/i18n/es.js", "to": "${destComponentsLib}/select2/dist/js/i18n"}
and then add ./web/select2/dist/js/i18n/es.js entry to array src.localeJS.es.
- You can know regenerate front end dist resources by run
gulp default or gulp generate-dist.
- Go to file
src\main\resources\static\assets\app\js\javatmp.plugins.wrapper.js if you we find any plugin does not provide
a support for Spanish you would add support for it in this file as we did for plugin numeral for Arabic language by the following Javascript code
if ($this.settings.locale === "es") {
...
}
And Sorry for un supporting Spanish in the current release we hope to support it in the future ones.
@carleetho kindly check this steps for helping you in supporting Spanish Language.
Add Spanish Language a UI alternative language:
Spanish Language code is
esfrom https://www.w3schools.com/tags/ref_language_codes.aspThe following steps are the minimum to support Spanish language (Or any language):
language(languageId,isDefaultLang) VALUES ('es', false);languageTranslation(languageId,langId,languageName) VALUES ('es' ,'en', 'Spanish (ES)');src\main\resources\i18n\messages_en.propertiesand rename it tosrc\main\resources\i18n\messages_es.propertiessrc\main\resources\i18n\messages_es.properties.JavaTMP-App-Starter/gulpfile.js.srcinside it there is a key calledlocaleJS, add a key for Spanish languageeslike we did foren and ar.
configvariable. for examplejquery-validationwe copied all translation fromnode_modules/jquery-validation/dist/localizationtoweb/jquery-validation/dist/localizationso you need Spanish language file for pluginjquery-validationcalledmessages_es.js. Add it in your src.localJS.es array as./web/components/jquery-validation/dist/localization/messages_es.js.JavaTMP-App-Starter/node_modules/select2/dist/js/i18nyou will file a file called
es.jswhich used for Spanish language.Now we should first add it to config.select2 array as the following entry :
{"from": "${sourceNodeLib}/select2/dist/js/i18n/es.js", "to": "${destComponentsLib}/select2/dist/js/i18n"}and then add
./web/select2/dist/js/i18n/es.jsentry to arraysrc.localeJS.es.gulp defaultorgulp generate-dist.src\main\resources\static\assets\app\js\javatmp.plugins.wrapper.jsif you we find any plugin does not providea support for Spanish you would add support for it in this file as we did for plugin
numeralfor Arabic language by the following Javascript codeAnd Sorry for un supporting Spanish in the current release we hope to support it in the future ones.
@carleetho kindly check this steps for helping you in supporting Spanish Language.