JMap.Language.addBundle
This method lets you add your own translations into JMap NG translation engine (for instance, all translations needed for one of your extensions)
Once added, a bundle cannot be overriden, and its identity must be unique (its id). You can specify a default locale for your bundle, in wich case the JMap NG translation engine will fall back to your bundle's default locale instead of on the system's default locale if a translation is not found in your bundle for the current locale.
a JTranslationBundle object
JMap.Language.bundleExitsById
Returns true if the bundle exists in the JMap NG translation engine, false otherwise
JMap.Language.getAllBundleIds
Returns the list of bundle ids used by the JMap NG translation engine
JMap.Language.getBundleById
Returns the translation bundle identified by the id
the id of the bundle to retrieve
JMap.Language.getBundles
Returns an bbject of all the translation bundles loaded in JMap NG at the moment of the call, indexed by id
JMap.Language.getDateFnsDateFormat
Returns the date format associated with the current locale (specific to the date-fns JS library)
JMap.Language.getDateFnsLocale
Returns the format for date-fns library.
true to return the format including the time
JMap.Language.getDefaultLocale
Get the default locale used by JMap NG. This locale can be used when a translation is not available in the current locale, for instance.
JMap.Language.getLocale
Get the current locale.
JMap.Language.getLocales
Get the list of all available locales as an array of string.
JMap.Language.is12HoursTimeFormat
Returns true if the current locale has a AM/PM setting for time format (08:00 PM), as opposed to a 24 hours format (20:00)
JMap.Language.isValidLocale
returns true is the passed locale is supported by JMap NG, false otherwise
the locale to be tested
JMap.Language.setLocale
Sets the current locale. JMap NG will automatically reload.
the new locale to use
JMap.Language.translate
Returns a translated string from the speficied bundle, for the current local, or for a specified locale.
Parameters are supported, and must be passed as an array (or a single param) which must have the same length as the number of parameters in the translated string. Parameters must be identified by numbers starting at zero, corresponding to the index of the param in the array supplied
a JTranslateParams object
JMap.Language
From this section you can manage the locale and translations used in JMap NG.