Class: I18n
I18n
new I18n()
Create a new instance of I18N
Properties:
| Name | Type | Description |
|---|---|---|
links |
Array | Contains the array of links |
designerDico |
JSON | Object containing the standard library structure |
dicos |
Array | Contains the array of applications |
dicoUrl |
String | Contains the Url of the dico(Internal Use) |
createUrl |
String | Contains the Url for the creation of dicos(Internal Use) |
Source: i18n/I18n.js, line 60
See:
- ProjectApp
- Resource
Examples
Load i18n from app
function loadI18n(p_app){//App object
var i18n = p_app.i18n;
i18n.load({
onSuccess:function(){
var dico = i18n.dicos[0];
alert(i18n.dicos.length);
i18n.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
createDico(options)
Create a new dictionary.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
language |
String | dictionary title |
name |
String | dictionary name |
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/I18n.js, line 188
See:
- updateI18n
Example
Create i18n library
function createI18nLib(p_app){
var i18n = p_app.i18n;
i18n.load({
onSuccess:function(){
i18n.createLib({
onSuccess:function(){
alert("Lib "+optLib.language+" created!");
}
});
}
});
};
generateUrl()
Overrides Resource's generateUrl method to return the request url
Source: i18n/I18n.js, line 84
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/I18n.js, line 106
See:
loadDesignerDico(options)
Load designerDico.
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/I18n.js, line 147
See:
loadPreset()
Overrides Resource's loadPreset method.
Source: i18n/I18n.js, line 78
See:
loadSet(rObject)
Overrides Resource's loadSet method to set local variables after request.
Parameters:
| Name | Type | Description |
|---|---|---|
rObject |
json | JSON representation of the loaded data. |
Source: i18n/I18n.js, line 94
See:
updateI18n(options)
update a i18n with previously set values.
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/I18n.js, line 242
See: