examples/phonegap1/plugins/cordova-plugin-globalization/src/blackberry10/index.js
function (successCB, failureCB, args, env) {
        var result = new PluginResult(args, env);
        var response = g11n.getInstance().InvokeMethod('getPreferredLanguage', args);
        var data = JSON.parse(response);
        console.log('getPreferredLanguage: ' + JSON.stringify(response));

        if (data.error !== undefined) {
            result.error({
                code: data.error.code,
                message: data.error.message
            });
        } else {
            result.ok({
                value: data.result
            });
        }
    }
function (successCB, failureCB, args, env) {
        var result = new PluginResult(args, env);
        var response = g11n.getInstance().InvokeMethod('getPreferredLanguage', args);
        var data = JSON.parse(response);
        console.log('getPreferredLanguage: ' + JSON.stringify(response));

        if (data.error !== undefined) {
            result.error({
                code: data.error.code,
                message: data.error.message
            });
        } else {
            result.ok({
                value: data.result
            });
        }
    }
function ( successCB , failureCB , args , env ) { var result = new PluginResult ( args , env ) ; var response = g11n . getInstance ( ) . InvokeMethod ( 'getPreferredLanguage' , args ) ; var data = JSON . parse ( response ) ; console . log ( 'getPreferredLanguage: ' + JSON . stringify ( response ) ) ; if ( data . error !== undefined ) { result . error ( { code : data . error . code , message : data . error . message } ) ; } else { result . ok ( { value : data . result } ) ; } }
Returns the string identifier for the client's current language.
It returns the language identifier string to the successCB callback with a
properties object as a parameter. If there is an error getting the language,
then the errorCB callback is invoked.

@param {Function} successCB
@param {Function} errorCB

@return Object.value {String}: The language identifier

@error GlobalizationError.UNKNOWN_ERROR

Example
globalization.getPreferredLanguage(function (language) {alert('language:' + language.value + '\n');},
function () {});
Returns the string identifier for the client s current language . It returns the language identifier string to the successCB callback with a properties object as a parameter . If there is an error getting the language then the errorCB callback is invoked .