BTT Web 2.0 On-Demand Internet banking Workplace supports G11N & I18N.
Internet banking developers can develop a script file, for example, LangList.js, to list the languages to be internationalized, and map it to a resource file, such as Lang-en_US.js. In the resource file, developers list the pairs of key-values of the content to be internationalized.
When an end-user logs on, he or she will see a page in the same language as the OS default language.
The end-user can also change the language by specifying a favorite language as shown in the sample. In this case the page is reloaded and shown in the language the user has selected.
/** * the base uri of language resource file */ BTTLocale.baseUri = "BTTWeb20/locale/language/"; BTTLocale.prefix = "Lang-"; BTTLocale.extension = ".js"; /** * the mapping from language string to resource file */ BTTLocale.Lang = { "zh-cn": "zh_CN", "en-gb": "en_GB", "en-us": "en_US", "en-ca": "en_CA" }Where:
Make sure you use the quotation marks for the key because JavaScript™ can't parse String with " - " in it correctly.
BTTLocale.resource = { //service repository my_service: "My service", basic_widget: "Basic Widgets", html_service: "Html Service", web1_transaction: "Web1.0 Transaction", ... //tooltips tip_tab_close:"click to close tab", tip_tab_logo: "click to edit tab logo", tip_max:"max", tip_restore: "restore", ... //other information add_tab: "add new tab", add_column: "add new column" ... //Attention: Don't add "," after the last key-value pairs }
As described in the parameters specification for each tag in Service.xml, the name attribute is the service name which is displayed in the service list tree.
See the following table lists for details.
Key | Description |
---|---|
tip_tab_close | Tips for the close icon of a tab |
tip_tab_logo | Tips for a tab logo |
tip_max | Tips for the max icon of a widget |
tip_restore | Tips for the restore icon of a widget |
tip_edit | Tips for the edit icon of a widget |
tip_refresh | Tips for the refresh icon of a widget |
tip_collapse | Tips for the collapse icon of a widget |
tip_close | Tips for the close icon of a widget |
function showTools(){ $("add_tab").innerHTML = BTTLocale.getText("add_tab"); $("add_column").innerHTML = BTTLocale.getText("add_column"); ... }
The first parameter is the key of text that needs to be internalized. Other parameters are what need to be internationalized.
function user(name){ this.name = name; this.visit = function(){ var t = new Date(); var track = BTTLocale.getText("visit_track",this.name,t); alert(track); } } var user1 = new user("Jack"); user1.visit ();
visit_track: "User {1} visited you at {2}",