SAP SMP 3.0 Internationalization i18n

Source: Internet
Author: User
Tags i18n locale

As an example of the logon module in the SMP SDK Kapsel API, this module defaults to the English language pack.

In the execution

Cordova-d Platform Add Android
Cordova-d Plugin Add C:\SAP\MobileSDK3\KapselSDK\plugins\logon

After the command, there are two more language resource files in the project:

Plugins\com.sap.mp.cordova.plugins.logon\www\common\assets\i18n\i18n.properties

Platforms\android\assets\www\smp\logon\i18n\i18n.properties


For the sake of laziness, I copied i18n.propertie directly and modified the file name to I18n_zh.properties

Platforms\android\assets\www\smp\logon\i18n\i18n_zh.properties


Modify I18n_zh.properties, such as

Fld_user_label= User Name

Note Keep the file UTF-8 encoded.


Just rerun the project app in the Eclipse Android development environment and be aware that the Android emulator language is also set to ZH_CN.

-------------------------------------------------------------------------------------

In the I18n.js code snippet of the logon module


JQuery.sap.require ("jquery.sap.resources");
var locale = Sap.ui.getCore (). GetConfiguration (). GetLanguage ();
var i18n = jQuery.sap.resources ({' URL ': '). /i18n/i18n.properties ", ' locale ': locale});


getlocalizedstring = function (key) {
return I18n.gettext (key);
}

Called the JQuery.sap.resources method

This method is an API in SAP UI5

-------------------------------------------------------------------------------------

Reference: Using JQuery.i18n.properties to achieve the internationalization of the Web front end

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.