Skip to content

Interface: LocaleModule ​

A locale module, as register() takes it — the shape of plotly.js's lib/locales/*.js, so a Plotly locale registers unchanged.

Example ​

ts
register({
  moduleType: 'locale',
  name: 'de',
  dictionary: { Zoom: 'Zoom', 'Reset axes': 'Achsen zurücksetzen' },
  format: { decimal: ',', thousands: '.', shortMonths: ['Jan', 'Feb', 'Mär' /* … */] },
});

Extends ​

Properties ​

PropertyTypeDescriptionInherited from
dictionary?Readonly<Record<string, string>>English UI string → translation (Plotly's keys, e.g. 'Zoom', 'trace', 'open:').LocaleDefinition.dictionary
format?Readonly<Partial<LocaleFormat>>Formats; missing keys fall back to the language, then to English.LocaleDefinition.format
moduleType"locale"--
namestringBCP 47 name, e.g. 'de' or 'de-CH' (matched case-insensitively; _ works as -).-

Released under the MIT License.