From 9834abc177d412686f22435e6e85d3b8524c9184 Mon Sep 17 00:00:00 2001 From: rnicar Date: Mon, 6 May 2024 20:24:26 +0200 Subject: [PATCH] New growth rate lang files --- src/locales/de/growth.ts | 10 ++++++++++ src/locales/en/growth.ts | 10 ++++++++++ src/locales/es/growth.ts | 10 ++++++++++ src/locales/fr/growth.ts | 10 ++++++++++ src/locales/it/growth.ts | 10 ++++++++++ src/plugins/i18n.ts | 23 ++++++++++++++++++----- src/ui/starter-select-ui-handler.ts | 9 ++++++++- 7 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 src/locales/de/growth.ts create mode 100644 src/locales/en/growth.ts create mode 100644 src/locales/es/growth.ts create mode 100644 src/locales/fr/growth.ts create mode 100644 src/locales/it/growth.ts diff --git a/src/locales/de/growth.ts b/src/locales/de/growth.ts new file mode 100644 index 00000000000..a0d1cb5eeaa --- /dev/null +++ b/src/locales/de/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Erratic", + "Fast": "Fast", + "Medium_Fast": "Medium Fast", + "Medium_Slow": "Medium Slow", + "Slow": "Slow", + "Fluctuating": "Fluctuating" +} as const; \ No newline at end of file diff --git a/src/locales/en/growth.ts b/src/locales/en/growth.ts new file mode 100644 index 00000000000..a0d1cb5eeaa --- /dev/null +++ b/src/locales/en/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Erratic", + "Fast": "Fast", + "Medium_Fast": "Medium Fast", + "Medium_Slow": "Medium Slow", + "Slow": "Slow", + "Fluctuating": "Fluctuating" +} as const; \ No newline at end of file diff --git a/src/locales/es/growth.ts b/src/locales/es/growth.ts new file mode 100644 index 00000000000..d89f5c16b2b --- /dev/null +++ b/src/locales/es/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Errático", + "Fast": "Rápido", + "Medium_Fast": "Medio Rápido", + "Medium_Slow": "Medio Lento", + "Slow": "Lento", + "Fluctuating": "Fluctuante" +} as const; \ No newline at end of file diff --git a/src/locales/fr/growth.ts b/src/locales/fr/growth.ts new file mode 100644 index 00000000000..a0d1cb5eeaa --- /dev/null +++ b/src/locales/fr/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Erratic", + "Fast": "Fast", + "Medium_Fast": "Medium Fast", + "Medium_Slow": "Medium Slow", + "Slow": "Slow", + "Fluctuating": "Fluctuating" +} as const; \ No newline at end of file diff --git a/src/locales/it/growth.ts b/src/locales/it/growth.ts new file mode 100644 index 00000000000..a0d1cb5eeaa --- /dev/null +++ b/src/locales/it/growth.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const growth: SimpleTranslationEntries = { + "Erratic": "Erratic", + "Fast": "Fast", + "Medium_Fast": "Medium Fast", + "Medium_Slow": "Medium Slow", + "Slow": "Slow", + "Fluctuating": "Fluctuating" +} as const; \ No newline at end of file diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 8ad0711f596..9a7de0a95fd 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -73,6 +73,12 @@ import { starterSelectUiHandler as frStarterSelectUiHandler } from '../locales/f import { starterSelectUiHandler as itStarterSelectUiHandler} from '../locales/it/starter-select-ui-handler'; import { starterSelectUiHandler as deStarterSelectUiHandler } from '../locales/de/starter-select-ui-handler'; +import { growth as enGrowth } from '../locales/en/growth'; +import { growth as esGrowth } from '../locales/es/growth'; +import { growth as frGrowth } from '../locales/fr/growth'; +import { growth as itGrowth } from '../locales/it/growth'; +import { growth as deGrowth } from '../locales/de/growth'; + export interface SimpleTranslationEntries { [key: string]: string } @@ -142,7 +148,9 @@ export function initI18n(): void { commandUiHandler: enCommandUiHandler, fightUiHandler: enFightUiHandler, tutorial: enTutorial, - starterSelectUiHandler: enStarterSelectUiHandler + starterSelectUiHandler: enStarterSelectUiHandler, + growth: enGrowth + }, es: { menu: esMenu, @@ -156,7 +164,8 @@ export function initI18n(): void { commandUiHandler: esCommandUiHandler, fightUiHandler: esFightUiHandler, tutorial: esTutorial, - starterSelectUiHandler: esStarterSelectUiHandler + starterSelectUiHandler: esStarterSelectUiHandler, + growth: esGrowth }, fr: { menu: frMenu, @@ -170,7 +179,8 @@ export function initI18n(): void { commandUiHandler: frCommandUiHandler, fightUiHandler: frFightUiHandler, tutorial: frTutorial, - starterSelectUiHandler: frStarterSelectUiHandler + starterSelectUiHandler: frStarterSelectUiHandler, + growth: frGrowth }, it: { menu: itMenu, @@ -184,7 +194,8 @@ export function initI18n(): void { commandUiHandler: itCommandUiHandler, fightUiHandler: itFightUiHandler, tutorial: itTutorial, - starterSelectUiHandler: itStarterSelectUiHandler + starterSelectUiHandler: itStarterSelectUiHandler, + growth: itGrowth }, de: { menu: deMenu, @@ -198,7 +209,8 @@ export function initI18n(): void { commandUiHandler: deCommandUiHandler, fightUiHandler: deFightUiHandler, tutorial: deTutorial, - starterSelectUiHandler: deStarterSelectUiHandler + starterSelectUiHandler: deStarterSelectUiHandler, + growth: deGrowth } }, }); @@ -220,6 +232,7 @@ declare module 'i18next' { fightUiHandler: typeof enFightUiHandler; tutorial: typeof enTutorial; starterSelectUiHandler: typeof enStarterSelectUiHandler; + growth: typeof enGrowth; }; } } diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index aa97b655a6b..2b5ea5d5dca 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1281,7 +1281,14 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonLuckText.setTint(getVariantTint(Math.min(luck - 1, 2) as Variant)); this.pokemonLuckLabelText.setVisible(this.pokemonLuckText.visible); - this.pokemonGrowthRateText.setText(Utils.toReadableString(GrowthRate[species.growthRate])); + //Growth translate + let growthReadable = Utils.toReadableString(GrowthRate[species.growthRate]); + let growthAux = growthReadable.replace(" ", "_") + if(i18next.exists("growth:" + growthAux)){ + growthReadable = i18next.t("growth:"+ growthAux as any) + } + this.pokemonGrowthRateText.setText(growthReadable); + this.pokemonGrowthRateText.setColor(getGrowthRateColor(species.growthRate)); this.pokemonGrowthRateText.setShadowColor(getGrowthRateColor(species.growthRate, true)); this.pokemonGrowthRateLabelText.setVisible(true);