Class Index | File Index

## Classes

- _global_
- M
- M.ActionSheetDialogView
- M.AlertDialogView
- M.Application
- M.Base64
- M.ButtonGroupView
- M.ButtonView
- M.ConfirmDialogView
- M.ContainerView
- M.Controller
- M.Cypher
- M.DataProvider
- M.Date
- M.DateValidator
- M.EmailValidator
- M.Environment
- M.EventDispatcher
- M.FormView
- M.GridView
- M.I18N
- M.ImageView
- M.LabelView
- M.ListItemView
- M.ListView
- M.LoaderView
- M.LocalStorageProvider
- M.Logger
- M.Math
- M.Model
- M.ModelAttribute
- M.ModelRegistry
- M.NotMinusValidator
- M.NumberValidator
- M.Object
- M.Observable
- M.PageView
- M.PhoneValidator
- M.PresenceValidator
- M.RecordManager
- M.RemoteStorageProvider
- M.Request
- M.ScrollView
- M.SearchBarView
- M.SelectionListItemView
- M.SelectionListView
- M.SHA256
- M.TabBarItemView
- M.TabBarView
- M.TextFieldView
- M.ToggleView
- M.ToolbarView
- M.UrlValidator
- M.Validator
- M.View
- M.ViewManager
- M.WebSqlProvider

# Class M.I18N

Extends M.Object.
M.I18N defines a prototype for for internationalisation and localisation within The M-Project. It is used to set and get the application's language and to localize any string within an application.
Defined in: i18n.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| M.I18N()

Field Summary
Field Attributes | Field Name and Description
--- | ---
| defaultLanguage The system's default language.
| languageMapper This property is used to map the navigator's language to an ISO standard if necessary.
| type The type of this object.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| getLanguage() This method is used to get a language for the current user.
| isLanguageAvailable(language) This method checks if the passed language is available within the app or not.
| l(key) This method returns the localized string for the given key based on the current language.
| setLanguage(language) This method sets the applications current language and forces it to reload.

Methods borrowed from class M.Object:
  bindToCaller, create, destroy, extend, get, include, set

Class Detail
M.I18N()
Field Detail
{String} defaultLanguage
The system's default language.

{Object} languageMapper
This property is used to map the navigator's language to an ISO standard if necessary. E.g. 'de' will be mapped to 'de_de'. Currently we only provide support for english and german. More languages are about to come or can be added by overwriting this property.

{String} type
The type of this object.
Method Detail
{String} getLanguage()
This method is used to get a language for the current user. This process is divided into three steps. If one step leads to a language, this on is returned. The steps are prioritized as follows: - get the user's language by checking his navigator - use the application's default language - use the systems's default language

Returns:
  {String} The user's language.

{Boolean} isLanguageAvailable(language)
This method checks if the passed language is available within the app or not.

Parameters:
{String} language
  The language to be checked.

Returns:
  {Boolean} Indicates whether the requested language is available or not.

{String} l(key)
This method returns the localized string for the given key based on the current language.

Parameters:
{String} key
  The key to the localized string.

Returns:
  {String} The localizes string based on the current application language.

setLanguage(language)
This method sets the applications current language and forces it to reload.

Parameters:
{String} language
  The language to be set.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 08 2010 15:07:30 GMT+0100 (MEZ)