Skip to content

Commit 6f3f8cf

Browse files
taahamahdihoehoetvhssBrainicism
authoredJan 14, 2022
Framework for localization (#1162)
* Begin localization work * Rename kr to ko, misc translations * Add eslint-plugin-i18next * Create translation keys * JSON key naming; replace in codebase * Remove prefix * Rename locales dir to i18n * Fix key typos * Fix linting/prettier errors * Fix tests * Add missing translate calls; revert start.sh change * Remove eslint-plugin-i18next * Remove trailing comma in json * Fix minor typos; add arg aliases for ,list * Remove extra keys in en; sync en/ko * Add keys for precheck * Add missing translate calls * Add locale to GAMEPLAY * Add missing translation for prechecks * Move priority back to help * Remove double translation calls Calling translate on an already translated string creates new entries in the locale file * exp.streak -> exp.explanation.streak * Fix translation keys, revert longer embed timeout * Reorder en.json * Scope some misc translations; sync ko with en * Fix rank ordering * Translate missing permissions title * Move localizationManager init to test_setup * Use nested JSON in translations and scope commands * Fully nest translations * Sort JSON keys; sync to ko * Update i18n-node JSON formatting to 4 spaces * Correctly scope play and timer example strings * Remove partial "up to" string * Better plural handling; improved ,locale interface Also, * Fix some calls to translation in discord_utils * Rescope some translations * Sync ko.json * Prefix command in locale translation * Fix storing locale in db, translation errors * Use correct locale when song ends/timer ends * Translated validation errors * Fixed some translation keys * Fix loading locales on bot start, storing locales * Sort locales; sync ko * Translate usage words and improve consistency * Remove hint partial string; improve skip's consistency * Remove badge translations * Improve lb translation scoping * Also adds a missing translation for leaderboardScope * Use two curly bracket for mustache * Fix groups/add/include/exclude inconsistency * Also, simplifies gender help translation * Correct more mistakes * Sync ko with en * Add ,locale arg validation; explicitly state languages * Sync ko * Add Korean localization (thanks hoehoetvhs!) * Minor translation edits * Finalize Korean localization * Various fixes to both translations * Add leaderboard quote translations * Fix forceskip title and ,end translation * Translate win message; fix "by" in kr * 'EXP' -> '경험치' * Localize songs correctly guessed counter * Correct kr "here" (바로가기 -> 여기) * Korean translation corrections by hoehoetvhs * More Korean translation corrections by hoehoetvhs * Add back ko songs correctly guessed * Update ko.json (#1168) * Update ko.json * add Blod * Add Blod & Fixed {{groupsList}} * Fix excessive indentation * Update ko.json (#1169) Boost time display error fixed & word order error fixed * Translate {time} left in active vote bonus * Remove extraneous tempLeaderboards game message * Update Korean File (#1170) Fixed many errors. * Translate end of game messages * Translate validation failure title * Replace GameOption with string literal in include conflict * Update ko.json (0.8 Version) (#1171) We worked to match "en.json" and modified some word order. * Update ko.json (Version 0.9) (#1172) * Update ko.json (Version 0.9) Fixed strange Ottawa word order found so far. * Update ko.json * Update ko.json (Version 0.9) Fixed strange Ottawa word order found so far. * Update ko.json (Version 0.9) Fixed strange Ottawa word order found so far. * Update ko.json (Version 0.9) Fixed strange Ottawa word order found so far. * Update ko.json (Version 0.9) Fixed strange Ottawa word order found so far. * Add eslint rules for i18n translation files (#1173) * Add missing elimination game message * Localize command failure message * Update ko.json (0.9.2 Version) (#1174) * Update ko.json (0.9.1 Version) 941~982 Line: Fix Word * Update ko.json (0.9.2 Version) Dump 0.9.2 * Update ko.json (0.9.3 Version) (#1175) Localize command failure message * Add i18next style message validation * Switch from i18n-node to i18next (#1176) * Switch from i18n-node to i18next * Save missing entries; remove mustache * ko: ordinal => ordinalNum; count => num * Remove duplicate command failure translation Co-authored-by: hoehoetvhs <[email protected]> Co-authored-by: Brian Le <[email protected]>
1 parent 7ddcaf4 commit 6f3f8cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+6773
-1392
lines changed
 

‎.eslintrc.i18n.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
extends: ["plugin:i18n-json/recommended"],
5+
rules: {
6+
"i18n-json/identical-keys": [
7+
"warn",
8+
{
9+
filePath: path.resolve("./i18n/en.json"),
10+
},
11+
],
12+
"i18n-json/valid-message-syntax": [
13+
"warn",
14+
{
15+
syntax: path.resolve("./i18n/i18next_syntax_validator.js"),
16+
},
17+
],
18+
"i18n-json/sorted-keys": [
19+
"warn",
20+
{
21+
order: "asc",
22+
indentSpaces: 4,
23+
},
24+
],
25+
},
26+
};

‎.github/workflows/gci-tests.yml

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
run: npm run prettier_ci
4444
- name: npm run lint
4545
run: npm run lint_ci
46+
- name: Check translations
47+
run: npm run lint_i18n
4648
- name: Copy .env for CI
4749
run: |
4850
echo "DB_USER=root" >> .env

0 commit comments

Comments
 (0)
Please sign in to comment.