Skip to content

Commit

Permalink
fix: Number format
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Jan 8, 2025
1 parent 7b0bd2e commit 5aa93fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/locales/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
FormatLocaleDefinition,
FormatLocaleObject,
} from "d3-format";
import numberFormatCh from "d3-format/locale/de-CH.json";
import {
timeFormatLocale,
TimeLocaleDefinition,
Expand Down Expand Up @@ -54,7 +55,7 @@ i18n.activate(defaultLocale);

/**
* Parses a valid app locale from a locale string (e.g. a Accept-Language header).
* If unparseable, returns default locale.
* If unparsable, returns default locale.
* @param localeString locale string, e.g. de,en-US;q=0.7,en;q=0.3
*/
export const parseLocaleString = (
Expand All @@ -78,7 +79,7 @@ export const getD3TimeFormatLocale = (locale: string): TimeLocaleObject =>
d3TimeFormatLocales[locale] ?? d3TimeFormatLocales.de;

const d3FormatLocales: { [locale: string]: FormatLocaleObject } = {
de: formatLocale(timeFormatDe as FormatLocaleDefinition),
de: formatLocale(numberFormatCh as FormatLocaleDefinition),
// fr: formatLocale(timeFormatDe as FormatLocaleDefinition),
// it: formatLocale(timeFormatDe as FormatLocaleDefinition),
// en: formatLocale(timeFormatDe as FormatLocaleDefinition),
Expand Down

0 comments on commit 5aa93fe

Please sign in to comment.