-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include built-in locales by default.
Related d3/d3-format#8.
- Loading branch information
Showing
21 changed files
with
110 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,55 @@ | ||
import isoFormat from "./src/isoFormat"; | ||
import locale from "./src/locale/en-US"; | ||
import localeFormat from "./src/localeFormat"; | ||
import locale from "./src/locale"; | ||
|
||
export var format = locale.format; | ||
export var utcFormat = locale.utcFormat; | ||
import caEs from "./src/locale/ca-ES.js"; | ||
import deDe from "./src/locale/de-DE.js"; | ||
import enCa from "./src/locale/en-CA.js"; | ||
import enGb from "./src/locale/en-GB.js"; | ||
import enUs from "./src/locale/en-US.js"; | ||
import esEs from "./src/locale/es-ES.js"; | ||
import fiFi from "./src/locale/fi-FI.js"; | ||
import frCa from "./src/locale/fr-CA.js"; | ||
import frFr from "./src/locale/fr-FR.js"; | ||
import heIl from "./src/locale/he-IL.js"; | ||
import itIt from "./src/locale/it-IT.js"; | ||
import mkMk from "./src/locale/mk-MK.js"; | ||
import nlNl from "./src/locale/nl-NL.js"; | ||
import plPl from "./src/locale/pl-PL.js"; | ||
import ptBr from "./src/locale/pt-BR.js"; | ||
import ruRu from "./src/locale/ru-RU.js"; | ||
import zhCn from "./src/locale/zh-CN.js"; | ||
|
||
var localeDefinitions = (new Map) | ||
.set("ca-ES", caEs) | ||
.set("de-DE", deDe) | ||
.set("en-CA", enCa) | ||
.set("en-GB", enGb) | ||
.set("en-US", enUs) | ||
.set("es-ES", esEs) | ||
.set("fi-FI", fiFi) | ||
.set("fr-CA", frCa) | ||
.set("fr-FR", frFr) | ||
.set("he-IL", heIl) | ||
.set("it-IT", itIt) | ||
.set("mk-MK", mkMk) | ||
.set("nl-NL", nlNl) | ||
.set("pl-PL", plPl) | ||
.set("pt-BR", ptBr) | ||
.set("ru-RU", ruRu) | ||
.set("zh-CN", zhCn); | ||
|
||
var defaultLocale = locale(enUs); | ||
export var format = defaultLocale.format; | ||
export var utcFormat = defaultLocale.utcFormat; | ||
|
||
export function localeFormat(definition) { | ||
if (typeof definition === "string") { | ||
definition = localeDefinitions.get(definition); | ||
if (!definition) return null; | ||
} | ||
return locale(definition); | ||
}; | ||
|
||
export { | ||
isoFormat, | ||
localeFormat | ||
isoFormat | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters