- Description
- How to use it - Setup and custom language files
- How-to translate: Different translation types
- Tips and additional information
Description
You can switch the Frontend language via: https://yourdomain.akiomacloud.de?setLng=en-EN
You may replace en-EN for English with fr-FR for French or de-DE for Germany and others.
Translations will be done in the corresponding <app>.common.json files in the swat-webui project:
For every supported language you will find/need to create a sub folder as seen in the screenshot.
If the desired language is not explicitly declared, the application will attempt to use the user’s browser language. In this case, the translation.languages application parameter contains the full list of supported languages.
- The application fetches the user’s browser language;
- The browser language (e.g. “en-US”) is explicitly checked against the whitelisted languages (the application parameter above);
- If not found, the shorthand version (or language code, e.g. “en”) is taken and implicitly checked against the whitelist by the library;
- If not found, the application will be set to the default language (”de”).
How to use it - Setup and custom language files
Make sure you have setup the following files
- src/backend/.restapplicationsettings
- Execute a b1 trim after setup
"application": {
"translationNamespaces": "TApp.common,swat.common"- src/webui/akioma/locales/es/TApp.common.json - Here you need the corresponding translation file
- Every time you change something in the translation file you need to reload the frontend with a hard reload to see the changes
- src/webui/webpack/config/static.config.js
- Execute a b1 trim after setup
{ from: 'akioma/locales', to: 'locales' }Build.One supports beside the different languages also custom languages, so that each merchant can define their own wording. For this you can add a new language file in the specific language folder as described in chapter “Translations”.
The path should be webui/Akioma/locales/Specific language folder”. The name of the new file should be application.[CLIENT_NAME].common.json.
In this new merchant language file specify only the values, which are different from the standard translations.
How-to translate: Different translation types
The translation file is structured in a nested manner. Each json object represent one Build.One Design Object. For example this shows the translations for the object “appointmentb”, which includes the elements “_title”, “appallday”, “appstatus”. The “appstatus_entries” are the translations for the possible values of “appstatus”.
Default
To adress a object in the json file, use the name of the object. You can find this name in the attributes of a element in the designer. In the following example you see the object in the json file (1), the object in the designer (2) and the name as attribute (3)
The simplest structure of a json object is:
“[Name]” : {
“_title”: “[Value]”,
“[Elementname]”: “[Value]”
},
There are some special objects which have to adress differently, these are described afterwards.
Screen Title (_title)
To translate the title of an element use always “_title” in json object
Toolbars
Add it in section “toolbars”
ittree
For addressing the ittree correctly you can’t just use the name of the ittree, but have to put together the attribute “name” and parts of the attribute “typeRange”.
So the correct name to adress it is [name]_[second part of typeRange after the “.”].
Example: You have the following values:
Name = ittree typeRange = pos.org.
Than you can address this element in the json-file with
Forms & Grids
For translation you have to use the instanceName of the form to identify it.
The identifier of fields must be lower case.
"instanceNameOfForm/Grid": {
"_title": "My Personal Form 4711",
"_titleShort": "Form 4711", //the S must be written in uppercase letters
"fieldnamelowercase": "Sample Data"
},Buttons and fieldsets
Add the name in lowercase letters only.
FAB
To translate FAB, you can use the MenuCode of the button as the root entry of the json object and then the FunctionCodes of the different functions as child-items of the json object.
Menu Structure / Menu Functions
If you want to translate the side navigation bar you need to put the menu structure code of the top node of the menu structure and than the menu structure code of the function.
"swatframework": {
"ExampleMenuCode": "Test1",
"ExampleMenu2Code": "Test2"Back to Documentation
Back to Build.One Help-Center Home
Tips and additional information
Change the application master language
If you want to set the master language in the application to show a specific language modify it in the application settings
- Navigate to Manage → Application Settings
- Search for parameter
application.masterLanguage - Change the value, e.g. to “en”
- Save your changes
Restarting language server
If you find the following message in the console of the dev tools, you have to restart the language server via ABL: Restart Language Server
Check current language
In dev tools go to the console:
- How to check if language was applied:
window.akioma.applicationSettings.application.masterLocale - Check current language:
window.akioma.applicationSettings.application.masterLanguage
Helper to find object names
window.akioma.translation.setProperty("debug", true) —> now all object names will be shown in the Info section of the console:Multiple Files
Back to Documentation
Back to Home Page