This project demonstrates how to build a custom language bundle.
Clone this project and ensure that you have all required dependencies installed correctly (see Documentation).
Then run the following commands from the project root directory to start a local development server:
# install all required node modules
$ mvn initialize
# start dev server
$ mvn compile -Denv=dev -Pinclude-mapapps-deps
# run unit tests
$ mvn test -P run-js-tests,include-mapapps-deps
Prepare application.properties
for the additionl language
client.config.supportedLocales=en,de,<your language code>
To set the map.apps default language change the following property accordingly:
client.config.defaultLocale=<your language code>
In order to apply the new bundle add the following property:
appservice.default.bundles=system,templatelayout,language-pack
Thus the bundle will be loaded with every app automatically.
- Rename folder
mapapps-custom-nls\src\main\js\bundles\language-pack\nls\en
with your country code, e.g.mapapps-custom-nls\src\main\js\bundles\language-pack\nls\fr
- Edit file
mapapps-custom-nls\src\main\js\bundles\language-pack\nls\bundle.js
and replaceen
with your country code (here:fr
)
module.exports = {
root: {},
"fr": true
};
- Add your translations to file
mapapps-custom-nls\src\main\js\bundles\language-pack\nls\fr\bundle.js