hs.host.locale.availableLocales() -> table
hs.host.locale.current() -> string
hs.host.locale.details([identifier]) -> table
identifier
- an optional string, specifying the locale to display information about. If you do not specify an identifier, information about the user's currently selected locale is returned.alternateQuotationBeginDelimiterKey
- A string containing the alternating begin quotation symbol associated with the locale. In some locales, when quotations are nested, the quotation characters alternate.alternateQuotationEndDelimiterKey
- A string containing the alternate end quotation symbol associated with the locale. In some locales, when quotations are nested, the quotation characters alternate.calendar
- A table containing key-value pairs describing for calendar associated with the locale. The table will contain one or more of the following pairs:AMSymbol
- The AM symbol for time in the locale's calendar.calendarIdentifier
- A string representing the calendar identity.eraSymbols
- An array table of strings specifying the names of the eras as recognized in the locale's calendar.firstWeekday
- The index in weekdaySymbols
of the first weekday in the locale's calendar.longEraSymbols
- An array table of strings specifying long names of the eras as recognized in the locale's calendar.minimumDaysInFirstWeek
- The minimum number of days, an integer value, in the first week in the locale's calendar.monthSymbols
- An array table of strings for the months of the year in the locale's calendar.PMSymbol
- The PM symbol for time in the locale's calendar.quarterSymbols
- An array table of strings for the quarters of the year in the locale's calendar.shortMonthSymbols
- An array table of short strings for the months of the year in the locale's calendar.shortQuarterSymbols
- An array table of short strings for the quarters of the year in the locale's calendar.shortStandaloneMonthSymbols
- An array table of short standalone strings for the months of the year in the locale's calendar.shortStandaloneQuarterSymbols
- An array table of short standalone strings for the quarters of the year in the locale's calendar.shortStandaloneWeekdaySymbols
- An array table of short standalone strings for the days of the week in the locale's calendar.shortWeekdaySymbols
- An array table of short strings for the days of the week in the locale's calendar.standaloneMonthSymbols
- An array table of standalone strings for the months of the year in the locale's calendar.standaloneQuarterSymbols
- An array table of standalone strings for the quarters of the year in the locale's calendar.standaloneWeekdaySymbols
- An array table of standalone strings for the days of the week in the locale's calendar.veryShortMonthSymbols
- An array table of very short strings for the months of the year in the locale's calendar.veryShortStandaloneMonthSymbols
- An array table of very short standalone strings for the months of the year in the locale's calendar.veryShortStandaloneWeekdaySymbols
- An array table of very short standalone strings for the days of the week in the locale's calendar.veryShortWeekdaySymbols
- An array table of very short strings for the days of the week in the locale's calendar.weekdaySymbols
- An array table of strings for the days of the week in the locale's calendar.collationIdentifier
- A string containing the collation associated with the locale.collatorIdentifier
- A string containing the collation identifier for the locale.countryCode
- A string containing the locale country code.currencyCode
- A string containing the currency code associated with the locale.currencySymbol
- A string containing the currency symbol associated with the locale.decimalSeparator
- A string containing the decimal separator associated with the locale.exemplarCharacterSet
- An array table of strings which make up the exemplar character set for the locale.groupingSeparator
- A string containing the numeric grouping separator associated with the locale.identifier
- A string containing the locale identifier.languageCode
- A string containing the locale language code.measurementSystem
- A string containing the measurement system associated with the locale.quotationBeginDelimiterKey
- A string containing the begin quotation symbol associated with the locale.quotationEndDelimiterKey
- A string containing the end quotation symbol associated with the locale.scriptCode
- A string containing the locale script code.temperatureUnit
- A string containing the preferred measurement system for temperature.timeFormatIs24Hour
- A boolean specifying whether time is expressed in a 24 hour format (true) or 12 hour format (false).usesMetricSystem
- A boolean specifying whether or not the locale uses the metric system.variantCode
- A string containing the locale variant code.hs.host.locale.localizedString(localeCode[, baseLocaleCode]) -> string | nil, string | nil
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Function | | Description | Returns the localized string for a specific language code. | | Parameters |localeCode
- The locale code for the locale you want to return the localized string of.baseLocaleCode
- An optional string, specifying the locale to use for the string. If you do not specify a baseLocaleCode
, the user's currently selected locale is used.nil
if either the localeCode
or baseLocaleCode
is invalid. For example, if the localeCode
is "de_CH", this will return "German".nil
if either the localeCode
or baseLocaleCode
is invalid. For example, if the localeCode
is "de_CH", this will return "German (Switzerland)".localeCode
and optional baseLocaleCode
must be one of the strings returned by hs.host.locale.availableLocales.hs.host.locale.preferredLanguages() -> table
hs.host.locale.registerCallback(function) -> uuidString
fn
- the function to be invoked when a setting changeshs.host.locale.unregisterCallback(uuidString) -> boolean
uuidString
- the uuidString returned by hs.host.locale.registerCallback when you registered the callback function