locale Module

Description

TODO: Enter your module description here

Accessing the locale Module

To access this module from JavaScript, you would do the following:

var locale = require("com.shareourideas.locale");

The locale variable is a reference to the Module object.

Methods

setLocale("es")

This method is used to force phone default locale. Need to pass param locale string, like es, en, fr and ...

resetLocale() - iOS only

This method is used reset to phone default locale.

getLocale() - Android only

This method is used get current locale. By the way we can use default Appcelerator Titanium API for this Ti.Locale.currentLanguage

Usage

var locale = require('com.shareourideas.locale');
Ti.API.info("module is => " + locale);
locale.setLocale("es"); //Force the phone locale
Ti.API.info("welcome_message = " + Ti.Locale.getString("welcome_message"));
alert(Ti.Locale.getString("welcome_message"));

Author

Created by Karthi(http://titaniumtutorial.com) and Naga Harish(http://shareourideas.com) - nagaharish.movva@gmail.com

License

TODO: Enter your license/legal information here.