From 96af567cd4d014ffa6afe554d1d2f26fb068022b Mon Sep 17 00:00:00 2001 From: Lugiad Date: Fri, 17 May 2024 12:21:35 +0200 Subject: [PATCH] IV Scanner Results Translation (#990) * Update battle-message-ui-handler.ts * Update i18n.ts * Update config.ts * Update config.ts * Update config.ts * Update config.ts * Update config.ts * Update config.ts * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Update battle-message-ui-handler.ts * German battle-message-ui-handler.ts * Update config.ts --------- Co-authored-by: Benjamin Odom --- src/locales/de/battle-message-ui-handler.ts | 10 ++++++++ src/locales/de/config.ts | 5 ++-- src/locales/en/battle-message-ui-handler.ts | 10 ++++++++ src/locales/en/config.ts | 5 ++-- src/locales/es/battle-message-ui-handler.ts | 10 ++++++++ src/locales/es/config.ts | 5 ++-- src/locales/fr/battle-message-ui-handler.ts | 10 ++++++++ src/locales/fr/config.ts | 6 ++--- src/locales/it/battle-message-ui-handler.ts | 10 ++++++++ src/locales/it/config.ts | 5 ++-- .../pt_BR/battle-message-ui-handler.ts | 10 ++++++++ .../zh_CN/battle-message-ui-handler.ts | 10 ++++++++ src/locales/zh_CN/config.ts | 5 ++-- src/plugins/i18n.ts | 3 ++- src/ui/battle-message-ui-handler.ts | 25 ++++++++++--------- 15 files changed, 103 insertions(+), 26 deletions(-) create mode 100644 src/locales/de/battle-message-ui-handler.ts create mode 100644 src/locales/en/battle-message-ui-handler.ts create mode 100644 src/locales/es/battle-message-ui-handler.ts create mode 100644 src/locales/fr/battle-message-ui-handler.ts create mode 100644 src/locales/it/battle-message-ui-handler.ts create mode 100644 src/locales/pt_BR/battle-message-ui-handler.ts create mode 100644 src/locales/zh_CN/battle-message-ui-handler.ts diff --git a/src/locales/de/battle-message-ui-handler.ts b/src/locales/de/battle-message-ui-handler.ts new file mode 100644 index 00000000000..daedb8550d0 --- /dev/null +++ b/src/locales/de/battle-message-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const battleMessageUiHandler: SimpleTranslationEntries = { + "ivBest": "Sensationell", + "ivFantastic": "Fantastisch", + "ivVeryGood": "Sehr Gut", + "ivPrettyGood": "Gut", + "ivDecent": "Nicht Übel", + "ivNoGood": "Schlecht", +} as const; diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index 9ff1699778b..7aeeeb7a925 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -18,9 +18,9 @@ import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { weather } from "./weather"; +import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; - export const deConfig = { ability: ability, abilityTriggers: abilityTriggers, @@ -44,5 +44,6 @@ export const deConfig = { trainerNames: trainerNames, tutorial: tutorial, weather: weather, + battleMessageUiHandler: battleMessageUiHandler, berry: berry, -} +} \ No newline at end of file diff --git a/src/locales/en/battle-message-ui-handler.ts b/src/locales/en/battle-message-ui-handler.ts new file mode 100644 index 00000000000..346f856872c --- /dev/null +++ b/src/locales/en/battle-message-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const battleMessageUiHandler: SimpleTranslationEntries = { + "ivBest": "Best", + "ivFantastic": "Fantastic", + "ivVeryGood": "Very Good", + "ivPrettyGood": "Pretty Good", + "ivDecent": "Decent", + "ivNoGood": "No Good", +} as const; \ No newline at end of file diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index b2dfe9c9b4c..6b23d2f2983 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -18,9 +18,9 @@ import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { weather } from "./weather"; +import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; - export const enConfig = { ability: ability, abilityTriggers: abilityTriggers, @@ -44,5 +44,6 @@ export const enConfig = { trainerNames: trainerNames, tutorial: tutorial, weather: weather, + battleMessageUiHandler: battleMessageUiHandler, berry: berry, -} +} \ No newline at end of file diff --git a/src/locales/es/battle-message-ui-handler.ts b/src/locales/es/battle-message-ui-handler.ts new file mode 100644 index 00000000000..346f856872c --- /dev/null +++ b/src/locales/es/battle-message-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const battleMessageUiHandler: SimpleTranslationEntries = { + "ivBest": "Best", + "ivFantastic": "Fantastic", + "ivVeryGood": "Very Good", + "ivPrettyGood": "Pretty Good", + "ivDecent": "Decent", + "ivNoGood": "No Good", +} as const; \ No newline at end of file diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index 61b01cfa6b5..a3b06982d33 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -18,9 +18,9 @@ import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { weather } from "./weather"; +import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; - export const esConfig = { ability: ability, abilityTriggers: abilityTriggers, @@ -44,5 +44,6 @@ export const esConfig = { trainerNames: trainerNames, tutorial: tutorial, weather: weather, + battleMessageUiHandler: battleMessageUiHandler, berry: berry, -} +} \ No newline at end of file diff --git a/src/locales/fr/battle-message-ui-handler.ts b/src/locales/fr/battle-message-ui-handler.ts new file mode 100644 index 00000000000..8dc980d49a4 --- /dev/null +++ b/src/locales/fr/battle-message-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const battleMessageUiHandler: SimpleTranslationEntries = { + "ivBest": "Exceptionnel", + "ivFantastic": "Fantastique", + "ivVeryGood": "Très bon", + "ivPrettyGood": "Bon", + "ivDecent": "Passable…", + "ivNoGood": "Pas top…", +} as const; diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index ef8f8bb7538..867a08621bb 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -18,9 +18,9 @@ import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { weather } from "./weather"; +import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; - export const frConfig = { ability: ability, abilityTriggers: abilityTriggers, @@ -44,6 +44,6 @@ export const frConfig = { trainerNames: trainerNames, tutorial: tutorial, weather: weather, + battleMessageUiHandler: battleMessageUiHandler, berry: berry, -} - +} \ No newline at end of file diff --git a/src/locales/it/battle-message-ui-handler.ts b/src/locales/it/battle-message-ui-handler.ts new file mode 100644 index 00000000000..346f856872c --- /dev/null +++ b/src/locales/it/battle-message-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const battleMessageUiHandler: SimpleTranslationEntries = { + "ivBest": "Best", + "ivFantastic": "Fantastic", + "ivVeryGood": "Very Good", + "ivPrettyGood": "Pretty Good", + "ivDecent": "Decent", + "ivNoGood": "No Good", +} as const; \ No newline at end of file diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index 3d8d9b0e4b7..89d78304120 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -18,9 +18,9 @@ import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { weather } from "./weather"; +import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; - export const itConfig = { ability: ability, abilityTriggers: abilityTriggers, @@ -44,5 +44,6 @@ export const itConfig = { trainerNames: trainerNames, tutorial: tutorial, weather: weather, + battleMessageUiHandler: battleMessageUiHandler, berry: berry, -} +} \ No newline at end of file diff --git a/src/locales/pt_BR/battle-message-ui-handler.ts b/src/locales/pt_BR/battle-message-ui-handler.ts new file mode 100644 index 00000000000..346f856872c --- /dev/null +++ b/src/locales/pt_BR/battle-message-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const battleMessageUiHandler: SimpleTranslationEntries = { + "ivBest": "Best", + "ivFantastic": "Fantastic", + "ivVeryGood": "Very Good", + "ivPrettyGood": "Pretty Good", + "ivDecent": "Decent", + "ivNoGood": "No Good", +} as const; \ No newline at end of file diff --git a/src/locales/zh_CN/battle-message-ui-handler.ts b/src/locales/zh_CN/battle-message-ui-handler.ts new file mode 100644 index 00000000000..346f856872c --- /dev/null +++ b/src/locales/zh_CN/battle-message-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const battleMessageUiHandler: SimpleTranslationEntries = { + "ivBest": "Best", + "ivFantastic": "Fantastic", + "ivVeryGood": "Very Good", + "ivPrettyGood": "Pretty Good", + "ivDecent": "Decent", + "ivNoGood": "No Good", +} as const; \ No newline at end of file diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 69f07a4f1a7..9c3a62f59f0 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -18,9 +18,9 @@ import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { weather } from "./weather"; +import { battleMessageUiHandler } from "./battle-message-ui-handler"; import { berry } from "./berry"; - export const zhCnConfig = { ability: ability, abilityTriggers: abilityTriggers, @@ -44,5 +44,6 @@ export const zhCnConfig = { trainerNames: trainerNames, tutorial: tutorial, weather: weather, + battleMessageUiHandler: battleMessageUiHandler, berry: berry, -} +} \ No newline at end of file diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 30cc4bfcac2..5c9de28fe82 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -148,6 +148,7 @@ declare module 'i18next' { egg: SimpleTranslationEntries; weather: SimpleTranslationEntries; modifierType: ModifierTypeTranslationEntries; + battleMessageUiHandler: SimpleTranslationEntries; berry: BerryTranslationEntries; }; } @@ -159,4 +160,4 @@ export function getIsInitialized(): boolean { return isInitialized; } -let isInitialized = false; \ No newline at end of file +let isInitialized = false; diff --git a/src/ui/battle-message-ui-handler.ts b/src/ui/battle-message-ui-handler.ts index abcf04b7cc8..b7dccef52b5 100644 --- a/src/ui/battle-message-ui-handler.ts +++ b/src/ui/battle-message-ui-handler.ts @@ -7,6 +7,7 @@ import { getStatName, Stat } from "../data/pokemon-stat"; import { addWindow } from "./ui-theme"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import {Button} from "../enums/buttons"; +import i18next from '../plugins/i18n'; export default class BattleMessageUiHandler extends MessageUiHandler { private levelUpStatsContainer: Phaser.GameObjects.Container; @@ -234,20 +235,20 @@ export default class BattleMessageUiHandler extends MessageUiHandler { const textStyle: TextStyle = isBetter ? TextStyle.SUMMARY_GREEN : TextStyle.SUMMARY; const color = getTextColor(textStyle, false, uiTheme); return `[color=${color}][shadow=${getTextColor(textStyle, true, uiTheme)}]${text}[/shadow][/color]`; - }; +}; - if (value > 30) - return coloredText('Best', value > starterIvs[typeIv]); - if (value === 30) - return coloredText('Fantastic', value > starterIvs[typeIv]); - if (value > 20) - return coloredText('Very Good', value > starterIvs[typeIv]); - if (value > 10) - return coloredText('Pretty Good', value > starterIvs[typeIv]); - if (value > 0) - return coloredText('Decent', value > starterIvs[typeIv]); + if (value > 30) + return coloredText(i18next.t('battleMessageUiHandler:ivBest'), value > starterIvs[typeIv]); + if (value === 30) + return coloredText(i18next.t('battleMessageUiHandler:ivFantastic'), value > starterIvs[typeIv]); + if (value > 20) + return coloredText(i18next.t('battleMessageUiHandler:ivVeryGood'), value > starterIvs[typeIv]); + if (value > 10) + return coloredText(i18next.t('battleMessageUiHandler:ivPrettyGood'), value > starterIvs[typeIv]); + if (value > 0) + return coloredText(i18next.t('battleMessageUiHandler:ivDecent'), value > starterIvs[typeIv]); - return coloredText('No Good', value > starterIvs[typeIv]); + return coloredText(i18next.t('battleMessageUiHandler:ivNoGood'), value > starterIvs[typeIv]); } showNameText(name: string): void {