Class: I18nDico
I18nDico
new I18nDico()
Create a new instance of I18nDico
Properties:
| Name | Type | Description |
|---|---|---|
dicoJson |
String | json object containing the language entries |
language |
String | The language of the dico |
name |
String | The name of the dico |
Source: i18n/I18nDico.js, line 57
See:
Examples
Load Dico from app
function loadI18n(p_app){
var i18n = p_app.i18n;
i18n.load({
onSuccess:function(){
var dico = i18n.dicos[0];
dico.load({
onSuccess:function(){
alert("Dico "+dico.name+" loaded!");
}
});
}
});
};
Load designer Dico from process
function loadi18n(p){
var i18n = p.i18n;
i18n.load({
onSuccess:function(){
i18n.loadDesignerDico({
onSuccess:function(){
alert(JSON.stringify(i18n.designerDico));
}
});
}
});
};
Methods
generateUrl()
Overrides Resource's generateUrl method to return the request url
Source: i18n/I18nDico.js, line 78
See:
load(options)
Override Resource load method.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
Source: i18n/I18nDico.js, line 91
See:
loadPreset()
Overrides Resource's loadPreset method.
Source: i18n/I18nDico.js, line 72
See:
update(options)
Update override.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
Source: i18n/I18nDico.js, line 136
See:
Example
Update Library
function loadI18n(p_app){
var i18n = p_app.i18n;
var opti18n = {};
opti18n.onSuccess = function(){
var library = i18n.languages[0];
var optLib = {};
optLib.onSuccess = function(){
library.dicoJson.widget.id_name.text="New Name";//Change JSON values
optUp = {};
optUp.onSuccess=function(){
alert("Lib updated!");
};
optUp.onFailure=function(e){
alert("Lib NOT updated! "+JSON.stringify(e));
};
library.update(optUp);
};
library.load(optLib);
};
i18n.load(opti18n);
};