Search code examples
ibm-mobilefirstbundletranslationarabicmultilingual

For Arabic Language Translation which is better way to take it and do


We developing Hybrid mobile application using Worklight 7.1 and Jquery mobile 1.4.5.

These Application supported right now two langues only i.e(Arabic and English).We are thinking two ways which way best to take to develop the application we don't no because of we are developing first time for the multi language.

1.Take it separate(English & Arabic) Html pages.

2.Taking one html and NSL budiles(en,ar).

We have few doubts, Assume let's we take it first option their lot of html pages are increasing and Css and functionality also increase. May be here file size will be going to increase or execution speed going to less or application performance is going to slow etc.

Let's take it second option we take it single html page and less functionality but we don't no how to align the positions for the Arabic language like tabular form data,default icons position and etc. May be here execution speed going to less or application performance is going to slow etc.

Please any one tell me which way is best and how to resolve the above issues. If anybody have sample application for multi langue worklight application using NSL buddile please provide US it will so help.


Solution

  • MobileFirst Platform Foundation 7.1 provides a translation mechanism where you can set system strings in different languages as well as applicative strings.

    You can find the messages.js file, which is intended for application strings, in the common\js folder.

    Messages = {
        headerText: "Default header",
        actionsLabel: "Default action label",
        sampleText: "Default sample text",
    };
    

    Application messages that are stored in the messages.js file can be referenced in two ways:

    • As a JavaScript object property. For example: Messages.headerText
    • As an ID of an HTML element with class="translate": <h1 id="headerText" class="translate"></h1>

    For system strings, you can find these here: You can find a full list of system messages in the www\default\worklight\messages\messages.json

    To update a string, for example: You can find a full list of system messages in the www\default\worklight\messages\messages.json

    You can find additional information in this tutorial: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/advanced-client-side-development/enabling-translation/