-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
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.propertiesand rename it tosrc\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
srcinside it there is a key calledlocaleJS, add a key for Spanish languageeslike we did for
en and ar. - if we did not copy specific plugin Spanish language file you should copy it in the
configvariable. for example
- For plugin
jquery-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. - 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 calledes.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.
- You can know regenerate front end dist resources by run
gulp defaultorgulp generate-dist. - Go to file
src\main\resources\static\assets\app\js\javatmp.plugins.wrapper.jsif 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 pluginnumeralfor 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.
Metadata
Metadata
Assignees
Labels
No labels