From d592187f2ce514c45e0417c703254a555c5a3fec Mon Sep 17 00:00:00 2001 From: Lee ByungHoon Date: Sat, 8 Jun 2024 04:08:34 +0900 Subject: [PATCH] [Localization] Add localization in party-ui-handler (#1712) * [Localization] Add localization in party-ui-handler * [Localization] Add "Release", "Apply", "Teach" localization, changed translation of Korean * [Localization] Translated party-ui-handler's localization to Deutsch --- src/locales/de/config.ts | 4 +++- src/locales/de/party-ui-handler.ts | 10 ++++++++++ src/locales/en/config.ts | 4 +++- src/locales/en/party-ui-handler.ts | 10 ++++++++++ src/locales/es/config.ts | 4 +++- src/locales/es/party-ui-handler.ts | 10 ++++++++++ src/locales/fr/config.ts | 4 +++- src/locales/fr/party-ui-handler.ts | 10 ++++++++++ src/locales/it/config.ts | 4 +++- src/locales/it/party-ui-handler.ts | 10 ++++++++++ src/locales/ko/config.ts | 4 +++- src/locales/ko/party-ui-handler.ts | 10 ++++++++++ src/locales/pt_BR/config.ts | 4 +++- src/locales/pt_BR/party-ui-handler.ts | 10 ++++++++++ src/locales/zh_CN/config.ts | 4 +++- src/locales/zh_CN/party-ui-handler.ts | 10 ++++++++++ src/locales/zh_TW/config.ts | 4 +++- src/locales/zh_TW/party-ui-handler.ts | 10 ++++++++++ src/plugins/i18n.ts | 1 + src/ui/party-ui-handler.ts | 9 ++++++++- 20 files changed, 126 insertions(+), 10 deletions(-) create mode 100644 src/locales/de/party-ui-handler.ts create mode 100644 src/locales/en/party-ui-handler.ts create mode 100644 src/locales/es/party-ui-handler.ts create mode 100644 src/locales/fr/party-ui-handler.ts create mode 100644 src/locales/it/party-ui-handler.ts create mode 100644 src/locales/ko/party-ui-handler.ts create mode 100644 src/locales/pt_BR/party-ui-handler.ts create mode 100644 src/locales/zh_CN/party-ui-handler.ts create mode 100644 src/locales/zh_TW/party-ui-handler.ts diff --git a/src/locales/de/config.ts b/src/locales/de/config.ts index e243aac135d..afee437a652 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -35,6 +35,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; export const deConfig = { ability: ability, @@ -73,5 +74,6 @@ export const deConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + partyUiHandler: partyUiHandler }; diff --git a/src/locales/de/party-ui-handler.ts b/src/locales/de/party-ui-handler.ts new file mode 100644 index 00000000000..103c6837889 --- /dev/null +++ b/src/locales/de/party-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const partyUiHandler: SimpleTranslationEntries = { + "SEND_OUT": "Einwechseln", + "SUMMARY": "Bericht", + "CANCEL": "Abbrechen", + "RELEASE": "Freilassen", + "APPLY": "Anwenden", + "TEACH": "Erlernen" +} as const; diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index 0891a6a4c10..383b52d4c19 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -35,6 +35,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; export const enConfig = { ability: ability, @@ -73,5 +74,6 @@ export const enConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + partyUiHandler: partyUiHandler }; diff --git a/src/locales/en/party-ui-handler.ts b/src/locales/en/party-ui-handler.ts new file mode 100644 index 00000000000..9d3c7baa9ae --- /dev/null +++ b/src/locales/en/party-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const partyUiHandler: SimpleTranslationEntries = { + "SEND_OUT": "Send Out", + "SUMMARY": "Summary", + "CANCEL": "Cancel", + "RELEASE": "Release", + "APPLY": "Apply", + "TEACH": "Teach" +} as const; diff --git a/src/locales/es/config.ts b/src/locales/es/config.ts index 7e1935a23a0..f6d1ac0f1c1 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -35,6 +35,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; export const esConfig = { ability: ability, @@ -73,5 +74,6 @@ export const esConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + partyUiHandler: partyUiHandler }; diff --git a/src/locales/es/party-ui-handler.ts b/src/locales/es/party-ui-handler.ts new file mode 100644 index 00000000000..9d3c7baa9ae --- /dev/null +++ b/src/locales/es/party-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const partyUiHandler: SimpleTranslationEntries = { + "SEND_OUT": "Send Out", + "SUMMARY": "Summary", + "CANCEL": "Cancel", + "RELEASE": "Release", + "APPLY": "Apply", + "TEACH": "Teach" +} as const; diff --git a/src/locales/fr/config.ts b/src/locales/fr/config.ts index ee9e9a1e2ac..d523d35bb87 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -35,6 +35,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; export const frConfig = { ability: ability, @@ -73,5 +74,6 @@ export const frConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + partyUiHandler: partyUiHandler }; diff --git a/src/locales/fr/party-ui-handler.ts b/src/locales/fr/party-ui-handler.ts new file mode 100644 index 00000000000..9d3c7baa9ae --- /dev/null +++ b/src/locales/fr/party-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const partyUiHandler: SimpleTranslationEntries = { + "SEND_OUT": "Send Out", + "SUMMARY": "Summary", + "CANCEL": "Cancel", + "RELEASE": "Release", + "APPLY": "Apply", + "TEACH": "Teach" +} as const; diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index 8549afb12be..3f53c8fca01 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -35,6 +35,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; export const itConfig = { ability: ability, @@ -73,5 +74,6 @@ export const itConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + partyUiHandler: partyUiHandler }; diff --git a/src/locales/it/party-ui-handler.ts b/src/locales/it/party-ui-handler.ts new file mode 100644 index 00000000000..9d3c7baa9ae --- /dev/null +++ b/src/locales/it/party-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const partyUiHandler: SimpleTranslationEntries = { + "SEND_OUT": "Send Out", + "SUMMARY": "Summary", + "CANCEL": "Cancel", + "RELEASE": "Release", + "APPLY": "Apply", + "TEACH": "Teach" +} as const; diff --git a/src/locales/ko/config.ts b/src/locales/ko/config.ts index ad0035ede0f..936154153be 100644 --- a/src/locales/ko/config.ts +++ b/src/locales/ko/config.ts @@ -35,6 +35,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; export const koConfig = { ability: ability, @@ -73,5 +74,6 @@ export const koConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + partyUiHandler: partyUiHandler }; diff --git a/src/locales/ko/party-ui-handler.ts b/src/locales/ko/party-ui-handler.ts new file mode 100644 index 00000000000..ce731e4915f --- /dev/null +++ b/src/locales/ko/party-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const partyUiHandler: SimpleTranslationEntries = { + "SEND_OUT": "교체한다", + "SUMMARY": "능력치를 본다", + "CANCEL": "그만둔다", + "RELEASE": "놓아준다", + "APPLY": "사용한다", + "TEACH": "가르친다" +} as const; diff --git a/src/locales/pt_BR/config.ts b/src/locales/pt_BR/config.ts index 1aadb5b20b1..3baca7df382 100644 --- a/src/locales/pt_BR/config.ts +++ b/src/locales/pt_BR/config.ts @@ -35,6 +35,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; export const ptBrConfig = { ability: ability, @@ -73,5 +74,6 @@ export const ptBrConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + partyUiHandler: partyUiHandler }; diff --git a/src/locales/pt_BR/party-ui-handler.ts b/src/locales/pt_BR/party-ui-handler.ts new file mode 100644 index 00000000000..9d3c7baa9ae --- /dev/null +++ b/src/locales/pt_BR/party-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const partyUiHandler: SimpleTranslationEntries = { + "SEND_OUT": "Send Out", + "SUMMARY": "Summary", + "CANCEL": "Cancel", + "RELEASE": "Release", + "APPLY": "Apply", + "TEACH": "Teach" +} as const; diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 7a8ab5595f7..0560b829dea 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -35,6 +35,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; export const zhCnConfig = { ability: ability, @@ -73,5 +74,6 @@ export const zhCnConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + partyUiHandler: partyUiHandler }; diff --git a/src/locales/zh_CN/party-ui-handler.ts b/src/locales/zh_CN/party-ui-handler.ts new file mode 100644 index 00000000000..9d3c7baa9ae --- /dev/null +++ b/src/locales/zh_CN/party-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const partyUiHandler: SimpleTranslationEntries = { + "SEND_OUT": "Send Out", + "SUMMARY": "Summary", + "CANCEL": "Cancel", + "RELEASE": "Release", + "APPLY": "Apply", + "TEACH": "Teach" +} as const; diff --git a/src/locales/zh_TW/config.ts b/src/locales/zh_TW/config.ts index 1b942e0234f..c7045da3d97 100644 --- a/src/locales/zh_TW/config.ts +++ b/src/locales/zh_TW/config.ts @@ -35,6 +35,7 @@ import { titles, trainerClasses, trainerNames } from "./trainers"; import { tutorial } from "./tutorial"; import { voucher } from "./voucher"; import { weather } from "./weather"; +import { partyUiHandler } from "./party-ui-handler"; export const zhTwConfig = { ability: ability, @@ -73,5 +74,6 @@ export const zhTwConfig = { trainerNames: trainerNames, tutorial: tutorial, voucher: voucher, - weather: weather + weather: weather, + partyUiHandler: partyUiHandler }; diff --git a/src/locales/zh_TW/party-ui-handler.ts b/src/locales/zh_TW/party-ui-handler.ts new file mode 100644 index 00000000000..9d3c7baa9ae --- /dev/null +++ b/src/locales/zh_TW/party-ui-handler.ts @@ -0,0 +1,10 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const partyUiHandler: SimpleTranslationEntries = { + "SEND_OUT": "Send Out", + "SUMMARY": "Summary", + "CANCEL": "Cancel", + "RELEASE": "Release", + "APPLY": "Apply", + "TEACH": "Teach" +} as const; diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 7d485d3f046..5356c94fe7f 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -233,6 +233,7 @@ declare module "i18next" { PGFbattleSpecDialogue: SimpleTranslationEntries; PGFmiscDialogue: SimpleTranslationEntries; PGFdoubleBattleDialogue: DialogueTranslationEntries; + partyUiHandler: SimpleTranslationEntries; }; } } diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index c51fea747a9..425a9dd788d 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -18,6 +18,7 @@ import { SpeciesFormChangeItemTrigger } from "../data/pokemon-forms"; import { getVariantTint } from "#app/data/variant"; import {Button} from "../enums/buttons"; import MoveInfoOverlay from "./move-info-overlay"; +import i18next from "i18next"; const defaultMessage = "Choose a Pokémon."; @@ -131,6 +132,8 @@ export default class PartyUiHandler extends MessageUiHandler { public static NoEffectMessage = "It won't have any effect."; + private localizedOptions = [PartyOption.SEND_OUT, PartyOption.SUMMARY, PartyOption.CANCEL, PartyOption.APPLY, PartyOption.RELEASE, PartyOption.TEACH]; + constructor(scene: BattleScene) { super(scene, Mode.PARTY); } @@ -810,7 +813,11 @@ export default class PartyUiHandler extends MessageUiHandler { const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM]; optionName = `${modifier.active ? "Deactivate" : "Activate"} ${modifier.type.name}`; } else { - optionName = Utils.toReadableString(PartyOption[option]); + if (this.localizedOptions.includes(option)) { + optionName = i18next.t(`partyUiHandler:${PartyOption[option]}`); + } else { + optionName = Utils.toReadableString(PartyOption[option]); + } } break; }