# Translator Events

These events are in translator.js file.

# Ti.App.fireEvent('translateFromWorkbench')

Translates the value from value-object-attribute triple to the system's language.

Example:

Ti.App.fireEvent('translateFromWorkbench', {
  callBackFunc: 'myCallbackFunction',
  source: 'mySource',
  path: 'myPath',
  value: 'myValue',
  object: 'myObject',
  attribute: 'myAttribute'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view from which the sessionID will be gathered.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • path - path to .jsp file. If null, then "/home/home.jsp" will be used instead.
  • value - value parameter, this will be translated to system language by using translation value on DB.
  • object - used for getting the description from cache.
  • attribute - Attribute of the object that is matched with a label in object. If match is valid, then this translation will be added to the DB for the system language.

# Ti.App.fireEvent('translateWeb')

Translates each object in toBeTranslated parameter and shows within mainWebView.

Example:

Ti.App.fireEvent('translateFromWorkbench', {
  toBeTranslated: [toBeTranslated0, toBeTranslated1, ...]
})
  • toBeTranslated - toBeTranslated objects.