LocaleModule


The LocaleModule class encapsulates access to the locale identifier of the device.

Example

const Diagnostics = require('Diagnostics');
    const Locale = require('Locale');

    const localeInfoAsArray = Locale.fromDevice.split('_');
    const language = localeInfoAsArray[0];

    switch (language) {
      case 'en':
        Diagnostics.log('Hello');
        break;
      case 'es':
        Diagnostics.log('Hola');
        break;
      case 'fr':
        Diagnostics.log('Bonjour');
        break;
      default:
        Diagnostics.log('Locale language of this device is neither English, Spanish nor French');
        break;
    }

Properties

PropertyDescription

fromDevice

(get) fromDevice: LocaleModule (set) (Not Available)

Provides access to a devices locale.

Methods

This class exposes no methods.