This is the internationalization module
- Copyright:
- 2022, the Converse.js contributors
- License:
- Mozilla Public License (MPLv2)
- Source:
Namespaces
Methods
(async, private, inner) fetchTranslations() → {Jed}
Fetch the translations for the given local at the given URL.
- Source:
Returns:
- Type
- Jed
(private, inner) getDayJSLocale(locale)
Given a locale, return the closest locale returned by dayJS
Parameters:
Name | Type | Description |
---|---|---|
locale |
string |
- Source:
(private, inner) getLocale(preferred_locale, isSupportedByLibrary) → {string}
Determines which locale is supported by the user's system as well as by the relevant library (e.g. converse.js or dayjs).
Parameters:
Name | Type | Description |
---|---|---|
preferred_locale |
string | |
isSupportedByLibrary |
function | Returns a boolean indicating whether the locale is supported. |
- Source:
Returns:
- Type
- string
(inner) getLocale(preferred_locale, available_locales)
Parameters:
Name | Type | Description |
---|---|---|
preferred_locale |
string | |
available_locales |
Array.<string> |
- Source:
(private, inner) isConverseLocale(locale, supported_locales)
Parameters:
Name | Type | Description |
---|---|---|
locale |
string | |
supported_locales |
Array.<string> |
- Source:
(private, inner) isLocaleAvailable(locale, available)
Check whether the locale or sub locale (e.g. en-US, en) is supported.
Parameters:
Name | Type | Description |
---|---|---|
locale |
String | The locale to check for |
available |
function | Returns a boolean indicating whether the locale is supported |
- Source:
(inner) translate(str)
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The string to be translated |
- Source: