Skip to content

Commit

Permalink
Add language metadata (common-voice#3704)
Browse files Browse the repository at this point in the history
* Ensure columns correct type

* add locale metadata

* Ensure columns correct type

* add locale metadata

* Update query with metadata

* Update language type

* Normalize flag name across db backend and frontend

* Rename migration to ensure runs in correct order

* Simplify query

* Refactor language logic

* Add translation flag

* Update on startup import

* Update startup scripts

* Remove migration with data

* Ensure all langauges in locales are joined on

* Remove debug code

* Update store to use db

* Update store to use db

* Update migration

* Remove build script for importing languages

* Remove build script for importing languages

* Ignore already inserted variants

* Remove noisey logging

* Remove last static files

* Remove locales dependancy

* Add test to see if build passes
  • Loading branch information
mozgzh authored May 17, 2022
1 parent 911ea01 commit 3e3d0d9
Show file tree
Hide file tree
Showing 15 changed files with 161 additions and 482 deletions.
5 changes: 4 additions & 1 deletion common/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export type Language = {
id: number;
name: string;
sentenceCount: SentenceCount;
isContributable?: boolean;
is_contributable?: boolean;
is_translated?: boolean;
native_name: string;
text_direction: string;
};

// single variant object
Expand Down
144 changes: 0 additions & 144 deletions locales/native-names.json

This file was deleted.

12 changes: 0 additions & 12 deletions locales/rtl.json

This file was deleted.

Empty file added locales/test.json
Empty file.
120 changes: 0 additions & 120 deletions locales/translated.json

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@
"build:server": "cd server && yarn build && cd ..",
"build:common": "cd common && yarn build && cd ..",
"build:maint": "cd maintenance && yarn build && cd ..",
"import-locales": "node scripts/import-locales",
"lint": "eslint .",
"lint:common": "eslint ./common",
"lint:server": "eslint ./server",
"lint:web": "cd web && yarn lint",
"prettier": "prettier \"**/*.{ts,tsx}\" --write",
"start": "yarn build:common && concurrently -p \"[{name}]\" -n \"CO,BE,FE\" -c \"bgYellow.bold,bgBlue.bold,bgMagenta.bold,bgCyan.bold\" \"cd common && yarn dev\" \"cd server && yarn start\" \"cd web && yarn dev\" \"yarn import-locales\"",
"start:prod": "yarn build:common && yarn import-locales && node server/js/main.js",
"start": "yarn build:common && concurrently -p \"[{name}]\" -n \"CO,BE,FE\" -c \"bgYellow.bold,bgBlue.bold,bgMagenta.bold,bgCyan.bold\" \"cd common && yarn dev\" \"cd server && yarn start\" \"cd web && yarn dev\"",
"start:prod": "yarn build:common && node server/js/main.js",
"start:maint": "cd maintenance && yarn dev",
"test": "yarn build:common && concurrently --kill-others-on-fail \"cd web && yarn test\" \"cd server && SERVER_CONFIG_PATH='../config.json' yarn test\""
},
Expand Down
Loading

0 comments on commit 3e3d0d9

Please sign in to comment.