Skip to content
Snippets Groups Projects
Unverified Commit 40cae7e7 authored by Paul Rosenzweig's avatar Paul Rosenzweig Committed by GitHub
Browse files

Split Chinese i18n into zh, zh-HK, and zh-TW variants (#12193)

parent 660d1521
No related branches found
No related tags found
No related merge requests found
......@@ -32,17 +32,18 @@ mkdir -p "$FRONTEND_LANG_DIR"
for LOCALE in $LOCALES; do
LOCALE_FILE="locales/$LOCALE.po"
LOCALE_WITH_UNDERSCORE=$(echo "$LOCALE" | tr '-' '_')
# frontend
# NOTE: just copy these for now, but eventially precompile from .po to .json
./bin/i18n/build-translation-frontend-resource \
"$LOCALE_FILE" \
"$FRONTEND_LANG_DIR/$LOCALE.json"
"$FRONTEND_LANG_DIR/$LOCALE_WITH_UNDERSCORE.json"
# backend
msgfmt \
--java2 \
-d "resources" \
-r "metabase.Messages" \
-l "$LOCALE" \
-l "$LOCALE_WITH_UNDERSCORE" \
"$LOCALE_FILE"
done
......@@ -15,10 +15,9 @@ const url = require("url");
const POEDITOR_API_TOKEN = process.env["POEDITOR_API_TOKEN"];
const POEDITOR_PROJECT_ID = "200535"; // Metabae POEditor project
// currently we don't support variants of language
const aliases = {
"pt-br": "pt",
"zh-CN": "zh",
"pt-br": "pt", // default to brazilian portuguese
"zh-Hans": "zh", // default to simplified chinese
};
async function main(args) {
......@@ -28,7 +27,10 @@ async function main(args) {
// list available languages
const { result: { languages } } = await poeditor("languages/list");
for (const language of languages) {
const code = aliases[language.code] || language.code;
const code = (aliases[language.code] || language.code)
// use "zh-TW" rather than "zh-tw"
.replace(/-.*$/, s => s.toUpperCase());
if (wanted.has(code)) {
wanted.delete(code);
console.log(`Downloading: ${code} (${language.percentage}%)`);
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
{
:locales #{"en" "zh" "uk" "fr" "nl" "tr" "sk" "it" "es" "nb" "ca" "de" "fa" "ja" "vi" "pl" "pt" "ru" }
:locales #{"en" "zh" "zh-HK" "zh-TW" "uk" "fr" "nl" "tr" "sk" "it" "es" "nb" "ca" "de" "fa" "ja" "vi" "pl" "pt" "ru" }
:packages ["metabase"]
:bundle "metabase.Messages"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment