Localization Code Improvements
Joachim Kessler
be-terna develops apps for Microsoft's Business Central. We develope such an app in the Visual Studio Code development environment.
The front end for the user is a browser, for example edge. If the user needs help, he can request help via the front end, depending on the content and language.
The developer can place a link in the source code of the app which then leads to the required help. The rules are defined by Microsoft (https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/help/context-sensitive-help) and must be applied with these rules.
Our example for the app vendor rating:
- The base URL is stored in the app manifest (app.json):
...
"contextSensitiveHelpUrl": "https://be-terna.helpjuice.com/{0}/VR_",
...
The character string {0} is a placeholder and is replaced by the language code currently used by the user at the time the help is called (not at the time of compilation!).
The possible language codes are predefined by Microsoft and cannot be changed by the app developer. Valid language codes are, for example
"en-US", "de-DE", "hr-HR", "it-IT", "sl-SI" usw.
- The further branching is determined by the current page:
page 5140800 "BETQA Supplier Eval. Setup"
...
ContextSensitiveHelpPage = 'setup/evaluation-setup';
...
- When calling the help from the page
o the runtime environment replaces the placeholder {0} in the contextSensitiveHelpUrl with the currently active language code (e.g. en-US)
o and adds the content of the ContextSensitiveHelpPage.
o The resulting URL is then started in the browser:
https://be-terna.helpjuice.com/en-US/VR_setup/evaluation-setup
Unfortunately, it is not possible for Business Central to generate the URL
https://be-terna.helpjuice.com/en_US/VR_setup/evaluation-setup for the help call.
Our requirement is that Helpjuice creates a possibility to configure the currently unchangeable language codes such as en_US or de_de so that the URL generated by Microsoft can be reached.