Skip to content
This repository
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

..
Octocat-spinner-32 js
Octocat-spinner-32 src
Octocat-spinner-32 README.md
Octocat-spinner-32 library.xml
README.md

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 PlayBook v1.0.6.2390

Requires BlackBerry WebWorks SDK for Tablet OS v2.1 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 Tablet OS extensions directory using your File Explorer. Default path is C:\Program Files\Research In Motion\BlackBerry WebWorks SDK for TabletOS\bbwp\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 Tablet\Locale

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

  6. Copy the downloaded Tablet\Locale\src directory to your new ext\blackberry.system.locale\src 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" />

Summary

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

Code Example

<html>
  <head>
    <meta name="viewport" id="viewport" content="height=device-height,width=device-width,user-scalable=no" />
    <script type="text/javascript" >
      function deviceLocale(){
         alert(blackberry.system.locale.deviceLocale);
        }

      function appLocale() {
        alert(blackberry.system.locale.appLocale);
      }
    </script>
  </head>
  <body >
    <button onclick="deviceLocale()">Device Locale</button>
    <button onclick="appLocale();">App Locale</button>
  </body>
</html>
Something went wrong with that request. Please try again.