From abc9264b3dee8d96713c7bd765cd36f09715a646 Mon Sep 17 00:00:00 2001 From: Lugiad <2070109+Adri1@users.noreply.github.com> Date: Thu, 31 Oct 2024 21:54:05 +0100 Subject: [PATCH] [Localization] Spanish modification form es to es-ES (#4753) * Update and rename statuses_es.json to statuses_es-ES.json * Rename statuses_es.png to statuses_es-ES.png * Update and rename types_es.json to types_es-ES.json * Rename types_es.png to types_es-ES.png * Update i18n.ts * Update settings.ts * Update settings-display-ui-handler.ts * Update starter-select-ui-handler.ts * Update utils.ts * Update settings-display-ui-handler.ts * Update loading-scene.ts * Update timed-event-manager.ts * change remaining 'es' to 'es-ES' in various UIs * change halloween event banner from es to es-ES * update to latest locale commit --------- Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com> --- ...t-es.png => halloween2024-event-es-ES.png} | Bin .../{statuses_es.json => statuses_es-ES.json} | 2 +- .../{statuses_es.png => statuses_es-ES.png} | Bin .../{types_es.json => types_es-ES.json} | 2 +- .../images/{types_es.png => types_es-ES.png} | Bin public/locales | 2 +- src/loading-scene.ts | 2 +- src/plugins/i18n.ts | 2 +- src/system/settings/settings.ts | 4 ++-- src/timed-event-manager.ts | 2 +- src/ui/egg-gacha-ui-handler.ts | 8 ++++---- src/ui/pokemon-info-container.ts | 18 ------------------ src/ui/registration-form-ui-handler.ts | 2 +- src/ui/run-info-ui-handler.ts | 2 +- .../settings/settings-display-ui-handler.ts | 6 +++--- src/ui/starter-select-ui-handler.ts | 2 +- src/utils.ts | 2 +- 17 files changed, 19 insertions(+), 37 deletions(-) rename public/images/events/{halloween2024-event-es.png => halloween2024-event-es-ES.png} (100%) rename public/images/{statuses_es.json => statuses_es-ES.json} (98%) rename public/images/{statuses_es.png => statuses_es-ES.png} (100%) rename public/images/{types_es.json => types_es-ES.json} (99%) rename public/images/{types_es.png => types_es-ES.png} (100%) diff --git a/public/images/events/halloween2024-event-es.png b/public/images/events/halloween2024-event-es-ES.png similarity index 100% rename from public/images/events/halloween2024-event-es.png rename to public/images/events/halloween2024-event-es-ES.png diff --git a/public/images/statuses_es.json b/public/images/statuses_es-ES.json similarity index 98% rename from public/images/statuses_es.json rename to public/images/statuses_es-ES.json index 4b44aa117e4..dbb3783842a 100644 --- a/public/images/statuses_es.json +++ b/public/images/statuses_es-ES.json @@ -1,7 +1,7 @@ { "textures": [ { - "image": "statuses_es.png", + "image": "statuses_es-ES.png", "format": "RGBA8888", "size": { "w": 22, diff --git a/public/images/statuses_es.png b/public/images/statuses_es-ES.png similarity index 100% rename from public/images/statuses_es.png rename to public/images/statuses_es-ES.png diff --git a/public/images/types_es.json b/public/images/types_es-ES.json similarity index 99% rename from public/images/types_es.json rename to public/images/types_es-ES.json index 0fb922e8939..198899c0f12 100644 --- a/public/images/types_es.json +++ b/public/images/types_es-ES.json @@ -1,7 +1,7 @@ { "textures": [ { - "image": "types_es.png", + "image": "types_es-ES.png", "format": "RGBA8888", "size": { "w": 32, diff --git a/public/images/types_es.png b/public/images/types_es-ES.png similarity index 100% rename from public/images/types_es.png rename to public/images/types_es-ES.png diff --git a/public/locales b/public/locales index 71390cba88f..3cf6d553541 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit 71390cba88f4103d0d2273d59a6dd8340a4fa54f +Subproject commit 3cf6d553541d79ba165387bc73fb06544d00f1f9 diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 578b9aba4fc..1aed61b34ba 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -244,7 +244,7 @@ export class LoadingScene extends SceneBase { this.loadAtlas("statuses", ""); this.loadAtlas("types", ""); } - const availableLangs = [ "en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN" ]; + const availableLangs = [ "en", "de", "it", "fr", "ja", "ko", "es-ES", "pt-BR", "zh-CN" ]; if (lang && availableLangs.includes(lang)) { this.loadImage("halloween2024-event-" + lang, "events"); } else { diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 91a67b9414c..845739dfcac 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -153,7 +153,7 @@ export async function initI18n(): Promise { i18next.use(new KoreanPostpositionProcessor()); await i18next.init({ fallbackLng: "en", - supportedLngs: [ "en", "es", "fr", "it", "de", "zh-CN", "zh-TW", "pt-BR", "ko", "ja", "ca-ES" ], + supportedLngs: [ "en", "es-ES", "fr", "it", "de", "zh-CN", "zh-TW", "pt-BR", "ko", "ja", "ca-ES" ], backend: { loadPath(lng: string, [ ns ]: string[]) { let fileName: string; diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index be440d5d93e..e6fb884ffdf 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -866,8 +866,8 @@ export function setSetting(scene: BattleScene, setting: string, value: integer): handler: () => changeLocaleHandler("en") }, { - label: "Español", - handler: () => changeLocaleHandler("es") + label: "Español (ES)", + handler: () => changeLocaleHandler("es-ES") }, { label: "Italiano", diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index 4c56ada1c94..3b2b3619397 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -35,7 +35,7 @@ const timedEvents: TimedEvent[] = [ endDate: new Date(Date.UTC(2024, 10, 4, 0)), bannerKey: "halloween2024-event-", scale: 0.21, - availableLangs: [ "en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN" ] + availableLangs: [ "en", "de", "it", "fr", "ja", "ko", "es-ES", "pt-BR", "zh-CN" ] } ]; diff --git a/src/ui/egg-gacha-ui-handler.ts b/src/ui/egg-gacha-ui-handler.ts index 8f977ba2ac0..b14f5381a84 100644 --- a/src/ui/egg-gacha-ui-handler.ts +++ b/src/ui/egg-gacha-ui-handler.ts @@ -107,7 +107,7 @@ export default class EggGachaUiHandler extends MessageUiHandler { let pokemonIconX = -20; let pokemonIconY = 6; - if ([ "de", "es", "fr", "ko", "pt-BR" ].includes(currentLanguage)) { + if ([ "de", "es-ES", "fr", "ko", "pt-BR" ].includes(currentLanguage)) { gachaTextStyle = TextStyle.SMALLER_WINDOW_ALT; gachaX = 2; gachaY = 2; @@ -115,7 +115,7 @@ export default class EggGachaUiHandler extends MessageUiHandler { let legendaryLabelX = gachaX; let legendaryLabelY = gachaY; - if ([ "de", "es" ].includes(currentLanguage)) { + if ([ "de", "es-ES" ].includes(currentLanguage)) { pokemonIconX = -25; pokemonIconY = 10; legendaryLabelX = -6; @@ -128,7 +128,7 @@ export default class EggGachaUiHandler extends MessageUiHandler { switch (gachaType as GachaType) { case GachaType.LEGENDARY: - if ([ "de", "es" ].includes(currentLanguage)) { + if ([ "de", "es-ES" ].includes(currentLanguage)) { gachaUpLabel.setAlign("center"); gachaUpLabel.setY(0); } @@ -149,7 +149,7 @@ export default class EggGachaUiHandler extends MessageUiHandler { gachaInfoContainer.add(pokemonIcon); break; case GachaType.MOVE: - if ([ "de", "es", "fr", "pt-BR" ].includes(currentLanguage)) { + if ([ "de", "es-ES", "fr", "pt-BR" ].includes(currentLanguage)) { gachaUpLabel.setAlign("center"); gachaUpLabel.setY(0); } diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index 6cc70bd598f..5b11aff43b1 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -21,24 +21,6 @@ interface LanguageSetting { } const languageSettings: { [key: string]: LanguageSetting } = { - "en": { - infoContainerTextSize: "64px" - }, - "de": { - infoContainerTextSize: "64px", - }, - "es": { - infoContainerTextSize: "64px" - }, - "fr": { - infoContainerTextSize: "64px" - }, - "it": { - infoContainerTextSize: "64px" - }, - "zh": { - infoContainerTextSize: "64px" - }, "pt": { infoContainerTextSize: "60px", infoContainerLabelXPos: -15, diff --git a/src/ui/registration-form-ui-handler.ts b/src/ui/registration-form-ui-handler.ts index fc9eb85cbaf..2c35ff8ee7f 100644 --- a/src/ui/registration-form-ui-handler.ts +++ b/src/ui/registration-form-ui-handler.ts @@ -13,7 +13,7 @@ interface LanguageSetting { } const languageSettings: { [key: string]: LanguageSetting } = { - "es":{ + "es-ES": { inputFieldFontSize: "50px", errorMessageFontSize: "40px", } diff --git a/src/ui/run-info-ui-handler.ts b/src/ui/run-info-ui-handler.ts index 0ca47241136..4975f05b8a3 100644 --- a/src/ui/run-info-ui-handler.ts +++ b/src/ui/run-info-ui-handler.ts @@ -674,7 +674,7 @@ export default class RunInfoUiHandler extends UiHandler { const def = i18next.t("pokemonInfo:Stat.DEFshortened") + ": " + pStats[2]; const spatk = i18next.t("pokemonInfo:Stat.SPATKshortened") + ": " + pStats[3]; const spdef = i18next.t("pokemonInfo:Stat.SPDEFshortened") + ": " + pStats[4]; - const speedLabel = (currentLanguage === "es" || currentLanguage === "pt_BR") ? i18next.t("runHistory:SPDshortened") : i18next.t("pokemonInfo:Stat.SPDshortened"); + const speedLabel = (currentLanguage === "es-ES" || currentLanguage === "pt_BR") ? i18next.t("runHistory:SPDshortened") : i18next.t("pokemonInfo:Stat.SPDshortened"); const speed = speedLabel + ": " + pStats[5]; // Column 1: HP Atk Def const pokeStatText1 = addBBCodeTextObject(this.scene, -5, 0, hp, TextStyle.SUMMARY, { fontSize: textContainerFontSize, lineSpacing: lineSpacing }); diff --git a/src/ui/settings/settings-display-ui-handler.ts b/src/ui/settings/settings-display-ui-handler.ts index a25dbf87b7d..c4cbb0dfe58 100644 --- a/src/ui/settings/settings-display-ui-handler.ts +++ b/src/ui/settings/settings-display-ui-handler.ts @@ -29,10 +29,10 @@ export default class SettingsDisplayUiHandler extends AbstractSettingsUiHandler label: "English", }; break; - case "es": + case "es-ES": this.settings[languageIndex].options[0] = { - value: "Español", - label: "Español", + value: "Español (ES)", + label: "Español (ES)", }; break; case "it": diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index bb999dc736a..22408ef829f 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -81,7 +81,7 @@ const languageSettings: { [key: string]: LanguageSetting } = { instructionTextSize: "35px", starterInfoXPos: 33, }, - "es":{ + "es-ES":{ starterInfoTextSize: "56px", instructionTextSize: "35px", }, diff --git a/src/utils.ts b/src/utils.ts index 8a35a4b3f07..b615dcf122b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -487,7 +487,7 @@ export function verifyLang(lang?: string): boolean { } switch (lang) { - case "es": + case "es-ES": case "fr": case "de": case "it":