Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Locale Information

The Locale API will allow you to retrieve the locale string based on the device system settings, as well as the locale string configured for the current application.

Author: Tim Neil

Tested On

  • BlackBerry Storm 9550 v5.0.0.469
  • BlackBerry Bold 9700 v5.0.0.469
  • BlackBerry Torch 9800 v6.0.0.227

Requires BlackBerry WebWorks SDK for Smartphones v2.0 or higher

Have a problem with this extension? Log an Issue or contact the Author

How To Configure The Extension For Use

  1. Locate your BlackBerry WebWorks SDK for Smartphone extensions directory using your File Explorer. Default path is C:\Program Files\Research In Motion\BlackBerry WebWorks Packager\ext

  2. Create a new blackberry.system.locale directory in the ext directory

  3. Download the source from this repository and unzip it to a location on your computer

  4. Using File Explorer browse to this extension's downloaded source code Smartphone\Locale

  5. Copy the library.xml file from the downloaded Smartphone\Locale directory to your new ext\blackberry.system.locale directory

  6. Copy the downloaded Smartphone\Locale\src\blackberry directory to your new ext\blackberry.system.locale\blackberry directory

NOTE: Be sure to back-up this ext\blackberry.system.locale directory in your WebWorks SDK extensions directory before performing a WebWorks SDK upgrade. Simply copy it back into the ext directory after you have completed your SDK upgrade.

Required Feature ID

Whenever you use the below feature id in any of your WebWorks applications this extension will be loaded for use.

<feature id="blackberry.system.locale" />


static String deviceLocale // Returns locale setting of the device
static String appLocale // Returns locale of current application

Code Example

    <meta name="viewport" id="viewport" content="height=device-height,width=device-width,user-scalable=no" />
    <script type="text/javascript" >
      function deviceLocale(){

      function appLocale() {
  <body >
    <button onclick="deviceLocale()">Device Locale</button>
    <button onclick="appLocale();">App Locale</button>