Localization: Localized Gacha Machine Names (#2645)

* Localization: Localized Gacha Machine Names

* Update src/locales/zh_TW/egg.ts

Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com>

* Update src/locales/zh_TW/egg.ts

Co-authored-by: Enoch <enoch.jwsong@gmail.com>

* Update src/locales/de/egg.ts

Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>

* Update src/locales/fr/egg.ts

Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>

* Update src/locales/ko/egg.ts

Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com>

* Update src/locales/zh_TW/egg.ts

Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com>

* Update src/locales/zh_CN/egg.ts

Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com>

* Update src/locales/es/egg.ts

Co-authored-by: InnocentGameDev <asdargmng@gmail.com>

* Update Brazilian Portuguese translation for egg.ts

* added smaller text size option

* update egg.ts translations for German and Brazilian Portuguese

* some updates

* update egg.ts translations for Spanish and Brazilian Portuguese

* Update EggGachaUiHandler to use array.includes for language check

* update German translation for legendary egg gatcha

* Update src/locales/es/egg.ts

Co-authored-by: InnocentGameDev <asdargmng@gmail.com>

* update translations for egg.ts in Spanish and Brazilian Portuguese

---------

Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com>
Co-authored-by: Enoch <enoch.jwsong@gmail.com>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>
Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com>
Co-authored-by: InnocentGameDev <asdargmng@gmail.com>
This commit is contained in:
José Ricardo Fleury Oliveira 2024-07-04 22:26:56 -03:00 committed by GitHub
parent 2bfefa630b
commit 04d456a60e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 89 additions and 8 deletions

View File

@ -22,4 +22,7 @@ export const egg: SimpleTranslationEntries = {
"hatchFromTheEgg": "Ein {{pokemonName}} ist aus dem Ei geschlüpft!", "hatchFromTheEgg": "Ein {{pokemonName}} ist aus dem Ei geschlüpft!",
"eggMoveUnlock": "Ei-Attacke freigeschaltet: {{moveName}}", "eggMoveUnlock": "Ei-Attacke freigeschaltet: {{moveName}}",
"rareEggMoveUnlock": "Seltene Ei-Attacke freigeschaltet: {{moveName}}", "rareEggMoveUnlock": "Seltene Ei-Attacke freigeschaltet: {{moveName}}",
"moveUPGacha": "Mehr\nEi-Attacken!",
"shinyUPGacha": "Mehr\nSchillernde!",
"legendaryUPGacha": "erscheint\nöfter!",
} as const; } as const;

View File

@ -22,4 +22,7 @@ export const egg: SimpleTranslationEntries = {
"hatchFromTheEgg": "{{pokemonName}} hatched from the egg!", "hatchFromTheEgg": "{{pokemonName}} hatched from the egg!",
"eggMoveUnlock": "Egg Move unlocked: {{moveName}}", "eggMoveUnlock": "Egg Move unlocked: {{moveName}}",
"rareEggMoveUnlock": "Rare Egg Move unlocked: {{moveName}}", "rareEggMoveUnlock": "Rare Egg Move unlocked: {{moveName}}",
"moveUPGacha": "Move UP!",
"shinyUPGacha": "Shiny UP!",
"legendaryUPGacha": "UP!",
} as const; } as const;

View File

@ -22,4 +22,7 @@ export const egg: SimpleTranslationEntries = {
"hatchFromTheEgg": "¡Ha salido un {{pokemonName}} del Huevo!", "hatchFromTheEgg": "¡Ha salido un {{pokemonName}} del Huevo!",
"eggMoveUnlock": "Mov. Huevo desbloqueado:\n{{moveName}}", "eggMoveUnlock": "Mov. Huevo desbloqueado:\n{{moveName}}",
"rareEggMoveUnlock": "Mov. Huevo Raro desbloqueado:\n{{moveName}}", "rareEggMoveUnlock": "Mov. Huevo Raro desbloqueado:\n{{moveName}}",
"moveUPGacha": "¡Más Mov.\nHuevo Raro!",
"shinyUPGacha": "¡Más Shiny!",
"legendaryUPGacha": ", ¡mayor\nprob.!",
} as const; } as const;

View File

@ -22,4 +22,7 @@ export const egg: SimpleTranslationEntries = {
"hatchFromTheEgg": "{{pokemonName}} sort de lŒuf !", "hatchFromTheEgg": "{{pokemonName}} sort de lŒuf !",
"eggMoveUnlock": "Capacité Œuf débloquée :\n{{moveName}}", "eggMoveUnlock": "Capacité Œuf débloquée :\n{{moveName}}",
"rareEggMoveUnlock": "Capacité Œuf Rare débloquée :\n{{moveName}}", "rareEggMoveUnlock": "Capacité Œuf Rare débloquée :\n{{moveName}}",
"moveUPGacha": "Bonus Capacité\nŒuf Rare !",
"shinyUPGacha": "Bonus\nChromatique !",
"legendaryUPGacha": "Bonus !",
} as const; } as const;

View File

@ -22,4 +22,7 @@ export const egg: SimpleTranslationEntries = {
"hatchFromTheEgg": "DallUovo è nato {{pokemonName}}!", "hatchFromTheEgg": "DallUovo è nato {{pokemonName}}!",
"eggMoveUnlock": "Egg Move unlocked: {{moveName}}", "eggMoveUnlock": "Egg Move unlocked: {{moveName}}",
"rareEggMoveUnlock": "Rare Egg Move unlocked: {{moveName}}", "rareEggMoveUnlock": "Rare Egg Move unlocked: {{moveName}}",
"moveUPGacha": "Move UP!",
"shinyUPGacha": "Shiny UP!",
"legendaryUPGacha": "UP!",
} as const; } as const;

View File

@ -22,4 +22,7 @@ export const egg: SimpleTranslationEntries = {
"hatchFromTheEgg": "알이 부화해서\n{{pokemonName}}[[가]] 태어났다!", "hatchFromTheEgg": "알이 부화해서\n{{pokemonName}}[[가]] 태어났다!",
"eggMoveUnlock": "알 기술 {{moveName}}[[를]]\n사용할 수 있게 되었다!", "eggMoveUnlock": "알 기술 {{moveName}}[[를]]\n사용할 수 있게 되었다!",
"rareEggMoveUnlock": "레어 알 기술 {{moveName}}[[를]]\n사용할 수 있게 되었다!", "rareEggMoveUnlock": "레어 알 기술 {{moveName}}[[를]]\n사용할 수 있게 되었다!",
"moveUPGacha": "기술 UP!",
"shinyUPGacha": "특별색 UP!",
"legendaryUPGacha": "UP!",
} as const; } as const;

View File

@ -22,4 +22,7 @@ export const egg: SimpleTranslationEntries = {
"hatchFromTheEgg": "{{pokemonName}} nasceu do ovo!", "hatchFromTheEgg": "{{pokemonName}} nasceu do ovo!",
"eggMoveUnlock": "Movimento de Ovo desbloqueado: {{moveName}}", "eggMoveUnlock": "Movimento de Ovo desbloqueado: {{moveName}}",
"rareEggMoveUnlock": "Movimento Raro de Ovo desbloqueado: {{moveName}}", "rareEggMoveUnlock": "Movimento Raro de Ovo desbloqueado: {{moveName}}",
"moveUPGacha": "Movimento\nde Ovo Bônus!",
"shinyUPGacha": "Shiny Bônus!",
"legendaryUPGacha": "Bônus!",
} as const; } as const;

View File

@ -22,4 +22,7 @@ export const egg: SimpleTranslationEntries = {
"hatchFromTheEgg": "{{pokemonName}} 从蛋中孵化了!", "hatchFromTheEgg": "{{pokemonName}} 从蛋中孵化了!",
"eggMoveUnlock": "蛋招式已解锁: {{moveName}}", "eggMoveUnlock": "蛋招式已解锁: {{moveName}}",
"rareEggMoveUnlock": "稀有蛋招式已解锁: {{moveName}}", "rareEggMoveUnlock": "稀有蛋招式已解锁: {{moveName}}",
"moveUPGacha": "蛋招式UP!",
"shinyUPGacha": "闪光UP!",
"legendaryUPGacha": "UP!",
} as const; } as const;

View File

@ -22,4 +22,7 @@ export const egg: SimpleTranslationEntries = {
"hatchFromTheEgg": "{{pokemonName}} 從蛋中孵化了!", "hatchFromTheEgg": "{{pokemonName}} 從蛋中孵化了!",
"eggMoveUnlock": "蛋招式已解鎖: {{moveName}}", "eggMoveUnlock": "蛋招式已解鎖: {{moveName}}",
"rareEggMoveUnlock": "稀有蛋招式已解鎖: {{moveName}}", "rareEggMoveUnlock": "稀有蛋招式已解鎖: {{moveName}}",
"moveUPGacha": "蛋招式UP!",
"shinyUPGacha": "闪光UP!",
"legendaryUPGacha": "UP!",
} as const; } as const;

View File

@ -96,25 +96,71 @@ export default class EggGachaUiHandler extends MessageUiHandler {
const gachaInfoContainer = this.scene.add.container(160, 46); const gachaInfoContainer = this.scene.add.container(160, 46);
const gachaUpLabel = addTextObject(this.scene, 4, 0, "UP!", TextStyle.WINDOW_ALT); const currentLanguage = i18next.resolvedLanguage;
let gachaTextStyle = TextStyle.WINDOW_ALT;
let gachaX = 4;
let gachaY = 0;
let pokemonIconX = -20;
let pokemonIconY = 6;
if (["de", "es", "fr", "pt-BR"].includes(currentLanguage)) {
gachaTextStyle = TextStyle.SMALLER_WINDOW_ALT;
gachaX = 2;
gachaY = 2;
}
let legendaryLabelX = gachaX;
let legendaryLabelY = gachaY;
if (["de", "es"].includes(currentLanguage)) {
pokemonIconX = -25;
pokemonIconY = 10;
legendaryLabelX = -6;
legendaryLabelY = 0;
}
const gachaUpLabel = addTextObject(this.scene, gachaX, gachaY, i18next.t("egg:legendaryUPGacha"), gachaTextStyle);
gachaUpLabel.setOrigin(0, 0); gachaUpLabel.setOrigin(0, 0);
gachaInfoContainer.add(gachaUpLabel); gachaInfoContainer.add(gachaUpLabel);
switch (gachaType as GachaType) { switch (gachaType as GachaType) {
case GachaType.LEGENDARY: case GachaType.LEGENDARY:
const pokemonIcon = this.scene.add.sprite(-20, 6, "pokemon_icons_0"); if (["de", "es"].includes(currentLanguage)) {
gachaUpLabel.setAlign("center");
gachaUpLabel.setY(0);
}
if (["pt-BR"].includes(currentLanguage)) {
gachaUpLabel.setX(legendaryLabelX - 2);
} else {
gachaUpLabel.setX(legendaryLabelX);
}
gachaUpLabel.setY(legendaryLabelY);
const pokemonIcon = this.scene.add.sprite(pokemonIconX, pokemonIconY, "pokemon_icons_0");
if (["pt-BR"].includes(currentLanguage)) {
pokemonIcon.setX(pokemonIconX - 2);
}
pokemonIcon.setScale(0.5); pokemonIcon.setScale(0.5);
pokemonIcon.setOrigin(0, 0.5); pokemonIcon.setOrigin(0, 0.5);
gachaInfoContainer.add(pokemonIcon); gachaInfoContainer.add(pokemonIcon);
break; break;
case GachaType.MOVE: case GachaType.MOVE:
gachaUpLabel.setText("Move UP!"); if (["de", "es", "fr", "pt-BR"].includes(currentLanguage)) {
gachaUpLabel.setAlign("center");
gachaUpLabel.setY(0);
}
gachaUpLabel.setText(i18next.t("egg:moveUPGacha"));
gachaUpLabel.setX(0); gachaUpLabel.setX(0);
gachaUpLabel.setOrigin(0.5, 0); gachaUpLabel.setOrigin(0.5, 0);
break; break;
case GachaType.SHINY: case GachaType.SHINY:
gachaUpLabel.setText("Shiny UP!"); if (["de", "fr"].includes(currentLanguage)) {
gachaUpLabel.setAlign("center");
gachaUpLabel.setY(0);
}
gachaUpLabel.setText(i18next.t("egg:shinyUPGacha"));
gachaUpLabel.setX(0); gachaUpLabel.setX(0);
gachaUpLabel.setOrigin(0.5, 0); gachaUpLabel.setOrigin(0.5, 0);
break; break;

View File

@ -1,10 +1,10 @@
import { EggTier } from "#enums/egg-type";
import { UiTheme } from "#enums/ui-theme";
import Phaser from "phaser";
import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText";
import InputText from "phaser3-rex-plugins/plugins/inputtext"; import InputText from "phaser3-rex-plugins/plugins/inputtext";
import BattleScene from "../battle-scene"; import BattleScene from "../battle-scene";
import { ModifierTier } from "../modifier/modifier-tier"; import { ModifierTier } from "../modifier/modifier-tier";
import Phaser from "phaser";
import { EggTier } from "#enums/egg-type";
import { UiTheme } from "#enums/ui-theme";
export enum TextStyle { export enum TextStyle {
MESSAGE, MESSAGE,
@ -33,7 +33,8 @@ export enum TextStyle {
MOVE_PP_FULL, MOVE_PP_FULL,
MOVE_PP_HALF_FULL, MOVE_PP_HALF_FULL,
MOVE_PP_NEAR_EMPTY, MOVE_PP_NEAR_EMPTY,
MOVE_PP_EMPTY MOVE_PP_EMPTY,
SMALLER_WINDOW_ALT
} }
export function addTextObject(scene: Phaser.Scene, x: number, y: number, content: string, style: TextStyle, extraStyleOptions?: Phaser.Types.GameObjects.Text.TextStyle): Phaser.GameObjects.Text { export function addTextObject(scene: Phaser.Scene, x: number, y: number, content: string, style: TextStyle, extraStyleOptions?: Phaser.Types.GameObjects.Text.TextStyle): Phaser.GameObjects.Text {
@ -140,6 +141,11 @@ export function getTextStyleOptions(style: TextStyle, uiTheme: UiTheme, extraSty
shadowXpos = 3; shadowXpos = 3;
shadowYpos = 3; shadowYpos = 3;
break; break;
case TextStyle.SMALLER_WINDOW_ALT:
styleOptions.fontSize = defaultFontSize - 36;
shadowXpos = 3;
shadowYpos = 3;
break;
} }
const shadowColor = getTextColor(style, true, uiTheme); const shadowColor = getTextColor(style, true, uiTheme);
@ -227,6 +233,8 @@ export function getTextColor(textStyle: TextStyle, shadow?: boolean, uiTheme: Ui
return !shadow ? "#f8b050" : "#c07800"; return !shadow ? "#f8b050" : "#c07800";
case TextStyle.SETTINGS_SELECTED: case TextStyle.SETTINGS_SELECTED:
return !shadow ? "#f88880" : "#f83018"; return !shadow ? "#f88880" : "#f83018";
case TextStyle.SMALLER_WINDOW_ALT:
return !shadow ? "#484848" : "#d0d0c8";
} }
} }