Titanium.Locale

Submodule of Titanium.
Platform Since
Android 1.5
iPhone 1.5
iPad 1.5

Summary

The top level Locale module.

Description

The Locale module works with localization files to which are generated during compilation into the operating system specific localization formats. The Locale module provides locale-specific strings which can be referenced at runtime. Additionally, the module contains a few methods and properties for querying device locale information.

The macro L can be used as an alias for the Titanium.Locale.getString method.

Methods

Name Summary
addEventListener

Adds the specified callback as an event listener for the named event.

fireEvent

Fires a synthesized event to any registered listeners.

formatTelephoneNumber

format a telephone number according to the current locale.

getCurrencyCode

return a currency code for a given locale. (Android only.)

getCurrencySymbol

return a currency symbol for the given currency code. (Android only.)

getCurrentCountry

Gets the value of the currentCountry property.

getCurrentLanguage

Gets the value of the currentLanguage property.

getCurrentLocale

Gets the value of the currentLocale property. (Android only.)

getLocaleCurrencySymbol

return a currency symbol for the given locale. (Android only.)

getString

return a localization string

removeEventListener

Removes the specified callback as an event listener for the named event.

setCurrentCountry

Sets the value of the currentCountry property.

Properties

Name Type Summary
currentCountry String

return the current (default) ISO 2-letter country code for the device.

currentLanguage String

return the current language for the device based on the user's settings read-only

currentLocale String

return the current locale string for the device based on the user's settings (e.g., en-US). (Android only.) read-only

Events

This type has no events.