Add new language
-
Florian Neumann
1 week ago #62470Hey!
I am trying to add a new language option for the language menu of my application. For demonstration, see below a screenshot with the alphabetical list of languages, missing for instance the desired language “arabic”.
In the Documentation (Translate Applications) you mention the following:
”
If the desired language is not available, please contact your administrator, as these are maintained in the server settings.”
Can someone help, clarify where to add / maintain languages within the server settings?
Thank you so much in advance!
Armin Winkler
Has successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
6 days ago #62521::Hi Florian,
unfortunately it’s currently not possible to select ‘Arabic’ as application language from the selection list. If you would like to have this language added in a future Simplifier release, please don’t hesitate to create a Feature Request in our Ideas portal for that matter.
The note on our documentation page about the possibility to maintain languages in the Simplifier settings as an administrator is wrong and will be removed soon – there is no such option available in the settings. We’re sorry for this misinformation and any inconvenience it might have caused on your side.
The good news for you is, that in general the OpenUI5 library supports the Arabic language. This means, you could include our standard client-side business object ‘SF_AppSettings’ with its function ‘setAppLanguage’ inside of your business process to load the language using the language key ‘ar’ as is documented here. The language key needs to be mapped to the input parameter ‘language’ in the input mapping of the business object activity in the Process Designer.
As a prerequisite however, you first need to add your Arabic translations for the display texts to the application. As mentioned earlier, this is unfortunately not possible by just adding a new language to the application from the list and uploading a PO file containing all your translation texts. Instead, you need to create a .properties file first which you then need to add manually to the source code of your application. Here’s how to do it:
- Create a file on your local machine named ‘i18n_ar.properties’. It can be opened by any text editor afterwards.
- Inside of the file, you can add your translation texts in the following format: Login$Login_Mask$loginButtonText=Login (in this example, ‘Login would be the name of the screen the widget is placed on. ‘Login_Mask’ is the unique ID of the widget as specified in the UI Designer. Finally, ‘loginButtonText’ is the name of the property that should be translated. After the ‘=’ character you can add the Arabic translation for the given widget property).
- For every translation entry in your .properties file, a new line needs to be created.
- When you’re done filling the file with your translations, please select the ‘Code’ entry from the ‘Others’ menu in the Application Editor.
- Please open the ‘i18n’ folder from the project structure and select it so that it is highlighted in blue. Then click on the upload button on the top left and upload the file under the file name mentioned under 1. to the ‘i18n’ folder.
- Next, select the file ‘Component-dbg.js’ from the project structure and add the ‘ar’ language key to the array that gets assigned to the variable named ‘supportedLanguages’ in the first line of the ‘init’ function.
- Press ‘Save All’ on the top right, but do not deploy the application afterwards. Your changes are live immediately, i.e. when you open the application and the business object function is invoked during runtime, the Arabic language should be loaded.
- Important note: The previous steps need to be repeated every time the application gets deployed because this will overwrite the project structure completely and you will lose the manually added .properties file in the ‘i18n’ folder.
Please let us know whether this solves your problem. Kind regards,
Armin
- This reply was modified 6 days ago by Armin Winkler.
Florian Neumann
You must be logged in to reply to this topic.