Implemented ability to override definitions from @formatjs. Added fixed definitions for Esperanto (#26)

* Introduce locale searching

Some locales may be absent or incorrect in default packages so these
should be obtained from other places instead.

* Add fixed Esperanto locale

* Update Esperanto locales

* Redo locale substitution

This reverts commit f2e1047fd8.

* Include locales in the repository

* Add newline character at the end
This commit is contained in:
kotwys 2020-07-24 19:24:55 +04:00 committed by GitHub
parent 930a272cd0
commit 208817f69e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 52 additions and 1 deletions

View File

@ -3,3 +3,4 @@ dll
storybook-static storybook-static
node_modules node_modules
cache cache
packages/app/services/i18n/overrides

View File

@ -9,3 +9,4 @@ cache
*.svg *.svg
*.hbs *.hbs
.gitlab-ci.yml .gitlab-ci.yml
packages/app/services/i18n/overrides

View File

@ -132,6 +132,7 @@
"exports-loader": "^0.7.0", "exports-loader": "^0.7.0",
"extract-react-intl-messages": "^4.1.1", "extract-react-intl-messages": "^4.1.1",
"file-loader": "^6.0.0", "file-loader": "^6.0.0",
"file-replace-loader": "^1.2.0",
"html-loader": "^1.1.0", "html-loader": "^1.1.0",
"html-webpack-plugin": "^4.3.0", "html-webpack-plugin": "^4.3.0",
"identity-obj-proxy": "^3.0.0", "identity-obj-proxy": "^3.0.0",

View File

@ -0,0 +1,2 @@
/* @generated */
Intl.RelativeTimeFormat&&"function"==typeof Intl.RelativeTimeFormat.__addLocaleData&&Intl.RelativeTimeFormat.__addLocaleData({data:{eo:{nu:["latn"],year:{0:"en ĉi tiu jaro",1:"en la sekva jaro","-1":"en la pasinta jaro",past:{one:"antaŭ {0} jaro",other:"antaŭ {0} jaroj"},future:{one:"post {0} jaro",other:"post {0} jaroj"}},"year-short":{0:"ĉi-jare",1:"venontjare","-1":"pasintjare",past:{one:"antaŭ {0} jaro",other:"antaŭ {0} jaroj"},future:{one:"post {0} jaro",other:"post {0} jaroj"}},"year-narrow":{0:"ĉi-jare",1:"venontjare","-1":"pasintjare",past:{one:"antaŭ {0} jaro",other:"antaŭ {0} jaroj"},future:{one:"post {0} jaro",other:"post {0} jaroj"}},quarter:{0:"en ĉi tiu kvaronjaro",1:"en la venonta kvaronjaro","-1":"en la pasinta kvaronjaro",past:{one:"antaŭ {0} kvaronjaro",other:"antaŭ {0} kvaronjaroj"},future:{one:"post {0} kvaronjaro",other:"post {0} kvaronjaroj"}},"quarter-short":{0:"ĉi-kvaronjare",1:"venontkvaronjare","-1":"pasintkvaronjare",past:{one:"antaŭ {0} kvaronjaro",other:"antaŭ {0} kvaronjaroj"},future:{one:"post {0} kvaronjaro",other:"post {0} kvaronjaroj"}},"quarter-narrow":{0:"ĉi-kvaronjare",1:"venontkvaronjare","-1":"pasintkvaronjare",past:{one:"antaŭ {0} kvaronjaro",other:"antaŭ {0} kvaronjaroj"},future:{one:"post {0} kvaronjaro",other:"post {0} kvaronjaroj"}},month:{0:"en ĉi tiu monato",1:"en la venonta monato","-1":"en la pasinta monato",past:{one:"antaŭ {0} monato",other:"antaŭ {0} monatoj"},future:{one:"post {0} monato",other:"post {0} monatoj"}},"month-short":{0:"ĉi-monate",1:"venontmonate","-1":"pasintmonate",past:{one:"antaŭ {0} monato",other:"antaŭ {0} monatoj"},future:{one:"post {0} monato",other:"post {0} monatoj"}},"month-narrow":{0:"ĉi-monate",1:"venontmonate","-1":"pasintmonate",past:{one:"antaŭ {0} monato",other:"antaŭ {0} monatoj"},future:{one:"post {0} monato",other:"post {0} monatoj"}},week:{0:"en ĉi tiu semajno",1:"en la venonta semajno","-1":"en la pasinta semajno",past:{one:"antaŭ {0} semajno",other:"antaŭ {0} semajnoj"},future:{one:"post {0} semajno",other:"post {0} semajnoj"}},"week-short":{0:"ĉi-semajne",1:"venontsemajne","-1":"pasintsemajne",past:{one:"antaŭ {0} semajno",other:"antaŭ {0} semajnoj"},future:{one:"post {0} semajno",other:"post {0} semajnoj"}},"week-narrow":{0:"ĉi-semajne",1:"venontsemajne","-1":"pasintsemajne",past:{one:"antaŭ {0} semajno",other:"antaŭ {0} semajnoj"},future:{one:"post {0} semajno",other:"post {0} semajnoj"}},day:{0:"hodiaŭ",1:"morgaŭ",2:"postmorgaŭ","-2":"antaŭhieraŭ","-1":"hieraŭ",past:{one:"antaŭ {0} tago",other:"antaŭ {0} tagoj"},future:{one:"post {0} tago",other:"post {0} tagoj"}},"day-short":{0:"hodiaŭ",1:"morgaŭ",2:"postmorgaŭ","-2":"antaŭhieraŭ","-1":"hieraŭ",past:{one:"antaŭ {0} tago",other:"antaŭ {0} tagoj"},future:{one:"post {0} tago",other:"post {0} tagoj"}},"day-narrow":{0:"hodiaŭ",1:"morgaŭ",2:"postmorgaŭ","-2":"antaŭhieraŭ","-1":"hieraŭ",past:{one:"antaŭ {0} tago",other:"antaŭ {0} tagoj"},future:{one:"post {0} tago",other:"post {0} tagoj"}},hour:{0:"en ĉi tiu horo",past:{one:"antaŭ {0} horo",other:"antaŭ {0} horoj"},future:{one:"post {0} horo",other:"post {0} horoj"}},"hour-short":{0:"ĉi-hore",past:{one:"antaŭ {0} horo",other:"antaŭ {0} horoj"},future:{one:"post {0} horo",other:"post {0} horoj"}},"hour-narrow":{0:"ĉi-hore",past:{one:"antaŭ {0} horo",other:"antaŭ {0} horoj"},future:{one:"post {0} horo",other:"post {0} horoj"}},minute:{0:"en ĉi tiu minuto",past:{one:"antaŭ {0} minuto",other:"antaŭ {0} minutoj"},future:{one:"post {0} minuto",other:"post {0} minutoj"}},"minute-short":{0:"ĉi-minute",past:{one:"antaŭ {0} minuto",other:"antaŭ {0} minutoj"},future:{one:"post {0} minuto",other:"post {0} minutoj"}},"minute-narrow":{0:"ĉi-minute",past:{one:"antaŭ {0} minuto",other:"antaŭ {0} minutoj"},future:{one:"post {0} minuto",other:"post {0} minutoj"}},second:{0:"en ĉi tiu sekundo",past:{one:"antaŭ {0} sekundo",other:"antaŭ {0} sekundoj"},future:{one:"post {0} sekundo",other:"post {0} sekundoj"}},"second-short":{0:"ĉi-sekunde",past:{one:"antaŭ {0} sekundo",other:"antaŭ {0} sekundoj"},future:{one:"post {0} sekundo",other:"post {0} sekundoj"}},"second-narrow":{0:"ĉi-sekunde",past:{one:"antaŭ {0} sekundo",other:"antaŭ {0} sekundoj"},future:{one:"post {0} sekundo",other:"post {0} sekundoj"}}}},availableLocales:["eo"],aliases:{},parentLocales:{}});

View File

@ -21,5 +21,6 @@
"jsx": "preserve", "jsx": "preserve",
"strict": true "strict": true
}, },
"include": ["@types", "packages", "config", ".storybook"] "include": ["@types", "packages", "config", ".storybook"],
"exclude": ["packages/app/services/i18n/overrides"]
} }

View File

@ -200,6 +200,19 @@ const webpackConfig = {
type: 'javascript/auto', type: 'javascript/auto',
use: ['fontgen-loader'], use: ['fontgen-loader'],
}, },
{
// Replace some locales provided by FormatJS with local ones
test: /@formatjs\/intl-\w+\/dist\/locale-data/,
loader: 'file-replace-loader',
options: {
condition: 'if-replacement-exists',
replacement: (resource) =>
resource.replace(
/node_modules\/@formatjs\/intl-(\w+)\/dist\/locale-data\/(\w+)\.js/,
'packages/app/services/i18n/overrides/$1/$2.js',
),
},
},
], ],
}, },

View File

@ -3511,6 +3511,11 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339"
integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA== integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==
"@types/json-schema@^7.0.4":
version "7.0.5"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd"
integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==
"@types/json5@^0.0.30": "@types/json5@^0.0.30":
version "0.0.30" version "0.0.30"
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.30.tgz#44cb52f32a809734ca562e685c6473b5754a7818" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.30.tgz#44cb52f32a809734ca562e685c6473b5754a7818"
@ -4295,6 +4300,16 @@ ajv@^6.10.0, ajv@^6.5.5:
json-schema-traverse "^0.4.1" json-schema-traverse "^0.4.1"
uri-js "^4.2.2" uri-js "^4.2.2"
ajv@^6.12.2:
version "6.12.3"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.3.tgz#18c5af38a111ddeb4f2697bd78d68abc1cabd706"
integrity sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==
dependencies:
fast-deep-equal "^3.1.1"
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
alphanum-sort@^1.0.0: alphanum-sort@^1.0.0:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
@ -8029,6 +8044,14 @@ file-loader@^6.0.0:
loader-utils "^2.0.0" loader-utils "^2.0.0"
schema-utils "^2.6.5" schema-utils "^2.6.5"
file-replace-loader@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/file-replace-loader/-/file-replace-loader-1.2.0.tgz#1271c51c5515380282192afb52c84b52ddd1dd1a"
integrity sha512-uIpToqndYZ4JwrTtDAedRk2721Dam9S4T0ZZQKrxljOA5BBEhIBVRNSwOc7X6vXmlVeXBM+goNvUq5Uis4UBCg==
dependencies:
loader-utils "^1.2.3"
schema-utils "^2.6.4"
file-system-cache@^1.0.5: file-system-cache@^1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.yarnpkg.com/file-system-cache/-/file-system-cache-1.0.5.tgz#84259b36a2bbb8d3d6eb1021d3132ffe64cfff4f" resolved "https://registry.yarnpkg.com/file-system-cache/-/file-system-cache-1.0.5.tgz#84259b36a2bbb8d3d6eb1021d3132ffe64cfff4f"
@ -14405,6 +14428,15 @@ schema-utils@^2.6.1:
ajv "^6.10.2" ajv "^6.10.2"
ajv-keywords "^3.4.1" ajv-keywords "^3.4.1"
schema-utils@^2.6.4:
version "2.7.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.0.tgz#17151f76d8eae67fbbf77960c33c676ad9f4efc7"
integrity sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==
dependencies:
"@types/json-schema" "^7.0.4"
ajv "^6.12.2"
ajv-keywords "^3.4.1"
scss-tokenizer@^0.2.3: scss-tokenizer@^0.2.3:
version "0.2.3" version "0.2.3"
resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1" resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1"