Add American Spanish language

Closes #985

Just in-game names are different. Rest is copied from EU translation.
This commit is contained in:
Kalle
2022-11-03 22:10:24 +02:00
parent 123565a952
commit 6ff4efdc20
32 changed files with 826 additions and 10 deletions

View File

@@ -20,7 +20,11 @@ import invariant from "tiny-invariant";
import type { MainWeaponParams, SubWeaponParams } from "~/modules/analyzer";
import type { ParamsJson } from "~/modules/analyzer/types";
import { z } from "zod";
import { LANG_JSONS_TO_CREATE, loadLangDicts } from "./utils";
import {
LANG_JSONS_TO_CREATE,
loadLangDicts,
translationJsonFolderName,
} from "./utils";
const CURRENT_SEASON = 1;
@@ -603,7 +607,7 @@ function writeTranslationsJsons(arr: TranslationArray) {
"..",
"public",
"locales",
langCode.slice(2),
translationJsonFolderName(langCode),
`weapons.json`
),
JSON.stringify(

View File

@@ -8,7 +8,11 @@ import shoes from "./dicts/GearInfoShoes.json";
import fs from "node:fs";
import path from "node:path";
import invariant from "tiny-invariant";
import { LANG_JSONS_TO_CREATE, loadLangDicts } from "./utils";
import {
LANG_JSONS_TO_CREATE,
loadLangDicts,
translationJsonFolderName,
} from "./utils";
const CURRENT_SEASON = 1;
const OUTPUT_DIR_PATH = path.join(__dirname, "output");
@@ -117,7 +121,7 @@ async function main() {
"..",
"public",
"locales",
langCode.slice(2),
translationJsonFolderName(langCode),
`gear.json`
),
JSON.stringify(translationsMap, null, 2) + "\n"

View File

@@ -1,7 +1,11 @@
/* eslint-disable */
// @ts-nocheck
import { LANG_JSONS_TO_CREATE, loadLangDicts } from "./utils";
import {
LANG_JSONS_TO_CREATE,
loadLangDicts,
translationJsonFolderName,
} from "./utils";
import fs from "fs";
import path from "path";
import invariant from "tiny-invariant";
@@ -61,7 +65,7 @@ async function main() {
"..",
"public",
"locales",
langCode.slice(2),
translationJsonFolderName(langCode),
`game-misc.json`
),
JSON.stringify(translationsMap, null, 2) + "\n"

View File

@@ -12,6 +12,7 @@ export const LANG_JSONS_TO_CREATE = [
"CNzh",
"EUde",
"EUes",
"USes",
"EUfr",
"EUit",
"EUnl",
@@ -36,3 +37,9 @@ export async function loadLangDicts() {
return result;
}
export function translationJsonFolderName(langCode: string) {
if (langCode === "EUes") return "es-ES";
if (langCode === "USes") return "es-US";
return langCode.slice(2);
}