Skip to content

Commit

Permalink
Move translation files out of src/
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-low committed Oct 29, 2024
1 parent 4250b13 commit 31231e4
Show file tree
Hide file tree
Showing 25 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
host = https://www.transifex.com

[o:osmlab:p:maproulette3:r:en-us-json]
file_filter = src/lang/<lang>.json
source_file = src/lang/en-US.json
file_filter = lang/<lang>.json
source_file = lang/en-US.json
source_lang = en
type = KEYVALUEJSON
minimum_perc = 10
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ used for creating production builds.
Translations for other locales are managed through
[transifex](https://www.transifex.com/maproulette/maproulette3), who kindly provides
us with free service through their Open Source program. Translation files are
pulled into the code repository from time to time and stored in the `src/lang/`
pulled into the code repository from time to time and stored in the `lang/`
directory.

Adding support for additional locales is quick and straight-forward: edit
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"vitest": "^2.1.2"
},
"scripts": {
"build-intl": "NODE_ENV=production extract-messages -l=en-US -o src/lang/ -d en-US --flat -f json 'src/**/!(*.test).js'",
"build-intl": "NODE_ENV=production extract-messages -l=en-US -o lang/ -d en-US --flat -f json 'src/**/!(*.test).js'",
"update-layers": "node scripts/update_layers.js",
"update-layers-prod": "NODE_ENV=production node scripts/update_layers.js",
"start-js": "vite",
Expand Down
40 changes: 20 additions & 20 deletions src/services/User/Locale/Locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,102 +44,102 @@ export const Locale = Object.freeze(Object.keys(unsortedLocale).sort().reduce(
const LocaleImports = {
[Locale.enUS]: () =>
Promise.all([
import("../../../lang/en-US.json"),
import("../../../../lang/en-US.json"),
import("@formatjs/intl-relativetimeformat/locale-data/en"),
]),
[Locale.es]: () =>
Promise.all([
import("../../../lang/es.json"),
import("../../../../lang/es.json"),
import("@formatjs/intl-relativetimeformat/locale-data/es"),
]),
[Locale.fr]: () =>
Promise.all([
import("../../../lang/fr.json"),
import("../../../../lang/fr.json"),
import("@formatjs/intl-relativetimeformat/locale-data/fr"),
]),
[Locale.de]: () =>
Promise.all([
import("../../../lang/de.json"),
import("../../../../lang/de.json"),
import("@formatjs/intl-relativetimeformat/locale-data/de"),
]),
[Locale.it]: () =>
Promise.all([
import("../../../lang/it_IT.json"),
import("../../../../lang/it_IT.json"),
import("@formatjs/intl-relativetimeformat/locale-data/it"),
]),
[Locale.af]: () =>
Promise.all([
import("../../../lang/af.json"),
import("../../../../lang/af.json"),
import("@formatjs/intl-relativetimeformat/locale-data/af"),
]),
[Locale.ja]: () =>
Promise.all([
import("../../../lang/ja.json"),
import("../../../../lang/ja.json"),
import("@formatjs/intl-relativetimeformat/locale-data/ja"),
]),
[Locale.ko]: () =>
Promise.all([
import("../../../lang/ko.json"),
import("../../../../lang/ko.json"),
import("@formatjs/intl-relativetimeformat/locale-data/ko"),
]),
[Locale.nl]: () =>
Promise.all([
import("../../../lang/nl.json"),
import("../../../../lang/nl.json"),
import("@formatjs/intl-relativetimeformat/locale-data/nl"),
]),
[Locale.uk]: () =>
Promise.all([
import("../../../lang/uk.json"),
import("../../../../lang/uk.json"),
import("@formatjs/intl-relativetimeformat/locale-data/uk"),
]),
[Locale.vi]: () =>
Promise.all([
import("../../../lang/vi.json"),
import("../../../../lang/vi.json"),
import("@formatjs/intl-relativetimeformat/locale-data/vi"),
]),
[Locale["pt-BR"]]: () =>
Promise.all([
import("../../../lang/pt_BR.json"),
import("../../../../lang/pt_BR.json"),
import("@formatjs/intl-relativetimeformat/locale-data/pt"),
]),
[Locale["pt-PT"]]: () =>
Promise.all([
import("../../../lang/pt_PT.json"),
import("../../../../lang/pt_PT.json"),
import("@formatjs/intl-relativetimeformat/locale-data/pt"),
]),
[Locale["cs-CZ"]]: () =>
Promise.all([
import("../../../lang/cs_CZ.json"),
import("../../../../lang/cs_CZ.json"),
import("@formatjs/intl-relativetimeformat/locale-data/cs"),
]),
[Locale["fa-IR"]]: () =>
Promise.all([
import("../../../lang/fa_IR.json"),
import("../../../../lang/fa_IR.json"),
import("@formatjs/intl-relativetimeformat/locale-data/fa"),
]),
[Locale["ru-RU"]]: () =>
Promise.all([
import("../../../lang/ru_RU.json"),
import("../../../../lang/ru_RU.json"),
import("@formatjs/intl-relativetimeformat/locale-data/ru"),
]),
[Locale.tr]: () =>
Promise.all([
import("../../../lang/tr.json"),
import("../../../../lang/tr.json"),
import("@formatjs/intl-relativetimeformat/locale-data/tr"),
]),
[Locale.sr]: () =>
Promise.all([
import("../../../lang/sr.json"),
import("../../../../lang/sr.json"),
import("@formatjs/intl-relativetimeformat/locale-data/sr"),
]),
[Locale.pl]: () =>
Promise.all([
import("../../../lang/pl.json"),
import("../../../../lang/pl.json"),
import("@formatjs/intl-relativetimeformat/locale-data/pl"),
]),
[Locale["zh-TW"]]: () =>
Promise.all([
import("../../../lang/zh_TW.json"),
import("../../../../lang/zh_TW.json"),
import("@formatjs/intl-relativetimeformat/locale-data/zh"),
]),
};
Expand Down
2 changes: 1 addition & 1 deletion src/services/User/Locale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ decisions it does, the config file is a good place to start.


### Pulling the latest translation files from Transifex
Updated and new translation files will be pulled into the `src/lang/`
Updated and new translation files will be pulled into the `lang/`
directory. They should then be added and committed to the source repo like
normal.

Expand Down

0 comments on commit 31231e4

Please sign in to comment.