Skip to content

Add Spanish Language a UI alternative language #330

@JavaTMP

Description

@JavaTMP

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):

  1. Insert into language table : INSERT INTO language (languageId, isDefaultLang) VALUES ('es', false);
  2. Insert into languageTranslation table : INSERT INTO languageTranslation (languageId, langId, languageName) VALUES ('es' ,'en', 'Spanish (ES)');
  3. Because English is the default language the above is the minimum inserts for supporting Spanish for Database tables.
  4. Copy src\main\resources\i18n\messages_en.properties and rename it to src\main\resources\i18n\messages_es.properties
  5. Translate all english values to Spanish in above file src\main\resources\i18n\messages_es.properties.
  6. Go To Gulp configuration file JavaTMP-App-Starter/gulpfile.js.
  7. 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.
  8. 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.
  1. You can know regenerate front end dist resources by run gulp default or gulp generate-dist.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions