From e9ca17c51929b21cbbc6939bad9a9201a709b823 Mon Sep 17 00:00:00 2001 From: ArceUseless <36188730+ArceUseless@users.noreply.github.com> Date: Sun, 12 May 2024 04:04:09 +0200 Subject: [PATCH] New growth rate lang files (#563) * New growth rate lang files * Update i18n.ts, fixing overwrite * Added growth to lang conf files --------- Co-authored-by: rnicar --- src/locales/de/config.ts | 4 +++- src/locales/de/growth.ts | 10 ++++++++++ src/locales/en/config.ts | 4 +++- src/locales/en/growth.ts | 10 ++++++++++ src/locales/es/config.ts | 4 +++- src/locales/es/growth.ts | 10 ++++++++++ src/locales/fr/config.ts | 4 +++- src/locales/fr/growth.ts | 10 ++++++++++ src/locales/it/config.ts | 4 +++- src/locales/it/growth.ts | 10 ++++++++++ src/plugins/i18n.ts | 1 + src/ui/starter-select-ui-handler.ts | 9 ++++++++- 12 files changed, 74 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/config.ts b/src/locales/de/config.ts index c388d7dec..e876fa48f 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const deConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ No newline at end of file diff --git a/src/locales/de/growth.ts b/src/locales/de/growth.ts new file mode 100644 index 000000000..a0d1cb5ee --- /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/config.ts b/src/locales/en/config.ts index 11cbc42d9..d1aa349b7 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const enConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ 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 000000000..a0d1cb5ee --- /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/config.ts b/src/locales/es/config.ts index 093a4b393..ecb9538da 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const esConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ 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 000000000..d89f5c16b --- /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/config.ts b/src/locales/fr/config.ts index a2e678ca6..5b2668ccc 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const frConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ 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 000000000..a0d1cb5ee --- /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/config.ts b/src/locales/it/config.ts index af394bd64..d641e66c6 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -2,6 +2,7 @@ import { ability } from "./ability"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; import { fightUiHandler } from "./fight-ui-handler"; +import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; @@ -24,5 +25,6 @@ export const itConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + growth: growth } \ 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 000000000..a0d1cb5ee --- /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 91006979b..d5a37127e 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -103,6 +103,7 @@ declare module 'i18next' { fightUiHandler: SimpleTranslationEntries; tutorial: SimpleTranslationEntries; starterSelectUiHandler: SimpleTranslationEntries; + growth: SimpleTranslationEntries; }; } } diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 514bb173a..b341cf947 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1294,7 +1294,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);