O'Reilly logo

PhoneGap 3.x Mobile Application Development HOTSHOT by Kerri Shotts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Determining the user's locale

A locale indicates the formatting preferences and language that the user prefers. In order to display numbers and text in the way that the user expects, it is critical that we be able to determine this value.

Getting on with it

A locale can consist of a two-character language code, or it can consist of both a two-character language code and a two-character region code. They typically look like this: en (English), es (Spanish), en-US (American English), es-MX (Spanish in Mexico), and so on. YASMF can support any locale for text translation (though you must specify the translations), but it can only support the locales supported by jQuery/globalize for number and date formatting. You can see the list of supported locales ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required