Configure Custom Labels/Messages

Description

It is possible to have the Android application download localized labels and messages from the backend, i.e. AX/NAV/BC,

The mobile app will automatically detect when it is necessary to download labels.

Flow

The mobile app will automatically detect when it is necessary to download labels:

  1. If for example @{Mylabel} does not exist in mobile app own translation files, then a "GetLocalizationData" request is made
  2. 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 GetReferenceData response

  • UserLanguage
    • string, e.g. "ENU" or "DAN"
  • UserLanguageCustomizationVersion   (new)
    • string, e.g. "v1", a date timestamp or something else entirely

The latter is new and must be present for the application to use this feature.

Snippet of GetReferenceData response showing the new element in action:

<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>ENU</Value>
      </Configuration>
      <Configuration>
        <Key>UserLanguageCustomizationVersion</Key>
        <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.

Request message example:

<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>ENU</languageCode>
  </requestData>
</request>

GetLocalizationData response

The application will expect a response similar to the example below:

<response messageid="{276565E5-8912-4192-8092-BC00924A1F0C}" status="Completed" xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2007/04/Documents/Response">
  <responseData>
    <localization>
      <language code="ENU" version="20190829103219">
        <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.