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:
See:
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
Properties
Name Type Argument Description
language String dictionary title
name String dictionary name
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
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:
See:

load(options)

Override Resource load method.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
See:

loadDesignerDico(options)

Load designerDico.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
See:

loadPreset()

Overrides Resource's loadPreset method.
Source:
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:
See:

updateI18n(options)

update a i18n with previously set values.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
See: