Description
It is possible to have the Android application download localized labels and messages from the backend, i.e. AX/NAV. It /BC,
The mobile app will automatically detect when it is necessary to download labels.
Flow
The mobile app will automatically detect if when it is necessary to download these labels based on a couple of "configuration" elements part of reference data.
...
labels:
- If for example @{Mylabel} does not exist in mobile app own translation files, then a "GetLocalizationData" request is made
- If "Mylabel" is present in the response, that value is used
Requirements
- Mobile WMS extension v4.38
- The two "UserLanguageCustomizationVersion" and "UserLanguage "elements must be present in Reference Data
- Labels i mobile configuration must rewritten as "@{MyLabel}" in order to trigger translation
Requirements of GetReferenceData response
In order for this mechanism to work, two "configuration" elements must be part of the the GetReferenceData response.
- UserLanguage
- string, e.g. "ENENU" or "DKDAN"
- UserLanguageCustomizationVersion (new)
- string, e.g. "v1", a date timestamp or something else entirely
...
Code Block | ||
---|---|---|
| ||
<response messageid="{C81C8843-2482-4FBF-BA9E-8EEE041EEE53}" status="Completed" xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2007/04/Documents/Response"> <responseData> <ReferenceData xmlns=""> ... <Configuration> <Key>UserLanguage</Key> <Value>EN-US<<Value>ENU</Value> </Configuration> <Configuration> <Key>UserLanguageCustomizationVersion</Key> <Value>bm08-09-2017 07:34:19<<Value>20190829103219</Value> </Configuration> ... </ReferenceData> </responseData> </response> |
GetLocalizationData request
If the application does not already have the set of localization data in the specified version, it will request it from the backend via a GetLocalizationData call.
...
Code Block | ||
---|---|---|
| ||
<request name="GetLocalizationData" created="2017-09-08T09:34:22+02:00" xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2007/04/Documents/Request"> <requestData name="GetLocalizationData"> <languageCode>EN-US<<languageCode>ENU</languageCode> </requestData> </request> |
GetLocalizationData response
The application will expect a response similar to the example below:
Code Block | ||
---|---|---|
| ||
<response messageid="{276565E5-8912-4192-8092-BC00924A1F0C}" status="Completed" xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2007/04/Documents/Response"> <responseData> <localization> <language code="EN-USENU" version="bm08-09-2017 07:34:1920190829103219"> <string name="MainMenuPutAway">Put away</string> <string name="MainMenuReplenishment">Replenishment</string> <string name="PageReplenishmentOrderListTitle">Replenishment orders</string> <string name="ReleaseOrderMenuItem">Release</string> <string name="PageReplenishmentOrderLinesTitle">Replenishment lines</string> <string name="Item Number:">Varenummer/stregkode</string> </language> </localization> </responseData> </response> |
Data is user profile specific
On the device the localization data is stored as part of the user profile, i.e. it is tied to the 'user and endpoint' combination and thus custom localized labels and messages for one user will not interfere with those for another user. This means full custom translated languages could be transferred using this feature.
Setup message in Mobile Message table (Currently only supported in Business Central 4.38.xxx.xx release minimum)
Go to Mobile Messages:
Create new message with Code corresponding the label in Mobile WMS that you would like to change:
In this example we would like to change the Main Menu Put Away Icon label.
Label now changes from PutAway to Put Away Goods when login into the system.