Translation fixes ptBR (#1468)

* translation fixes

* info container

* localized position and text size in pokemon-info-container
This commit is contained in:
José Ricardo Fleury Oliveira 2024-05-28 11:00:27 -03:00 committed by GitHub
parent d835cfd13f
commit 5512be8f31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 84 additions and 41 deletions

View File

@ -2,4 +2,5 @@ import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const abilityTriggers: SimpleTranslationEntries = { export const abilityTriggers: SimpleTranslationEntries = {
"blockRecoilDamage" : "{{abilityName}} de {{pokemonName}}\nprotegeu-o do dano de recuo!", "blockRecoilDamage" : "{{abilityName}} de {{pokemonName}}\nprotegeu-o do dano de recuo!",
"badDreams": "{{pokemonName}} está tendo pesadelos!",
} as const; } as const;

View File

@ -1,10 +1,10 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n"; import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const battleMessageUiHandler: SimpleTranslationEntries = { export const battleMessageUiHandler: SimpleTranslationEntries = {
"ivBest": "Melhor", "ivBest": "Perfeito",
"ivFantastic": "Fantástico", "ivFantastic": "Fantástico",
"ivVeryGood": "Muito Bom", "ivVeryGood": "Muito Bom",
"ivPrettyGood": "Bom", "ivPrettyGood": "Bom",
"ivDecent": "Regular", "ivDecent": "Regular",
"ivNoGood": "Ruim", "ivNoGood": "Ruim",
} as const; } as const;

View File

@ -4,7 +4,7 @@ export const nature: SimpleTranslationEntries = {
"Hardy": "Destemida", "Hardy": "Destemida",
"Lonely": "Solitária", "Lonely": "Solitária",
"Brave": "Valente", "Brave": "Valente",
"Adamant": "Rígida", "Adamant": "Adamante",
"Naughty": "Teimosa", "Naughty": "Teimosa",
"Bold": "Corajosa", "Bold": "Corajosa",
"Docile": "Dócil", "Docile": "Dócil",
@ -20,7 +20,7 @@ export const nature: SimpleTranslationEntries = {
"Mild": "Mansa", "Mild": "Mansa",
"Quiet": "Quieta", "Quiet": "Quieta",
"Bashful": "Atrapalhada", "Bashful": "Atrapalhada",
"Rash": "Rabugenta", "Rash": "Ousada",
"Calm": "Calma", "Calm": "Calma",
"Gentle": "Gentil", "Gentle": "Gentil",
"Sassy": "Atrevida", "Sassy": "Atrevida",

View File

@ -1,11 +1,11 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n"; import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const pokemonInfoContainer: SimpleTranslationEntries = { export const pokemonInfoContainer: SimpleTranslationEntries = {
"moveset": "Moveset", "moveset": "Movimentos",
"gender": "Gender:", "gender": "Gênero:",
"ability": "Ability:", "ability": "Habilidade:",
"nature": "Nature:", "nature": "Natureza:",
"epic": "Epic", "epic": "Épico",
"rare": "Rare", "rare": "Raro",
"common": "Common" "common": "Comum",
} as const; } as const;

View File

@ -7,15 +7,15 @@ import { SimpleTranslationEntries } from "#app/plugins/i18n";
*/ */
export const starterSelectUiHandler: SimpleTranslationEntries = { export const starterSelectUiHandler: SimpleTranslationEntries = {
"confirmStartTeam": "Começar com esses Pokémon?", "confirmStartTeam": "Começar com esses Pokémon?",
"gen1": "I", "gen1": "G1",
"gen2": "II", "gen2": "G2",
"gen3": "III", "gen3": "G3",
"gen4": "IV", "gen4": "G4",
"gen5": "V", "gen5": "G5",
"gen6": "VI", "gen6": "G6",
"gen7": "VII", "gen7": "G7",
"gen8": "VIII", "gen8": "G8",
"gen9": "IX", "gen9": "G9",
"growthRate": "Crescimento:", "growthRate": "Crescimento:",
"ability": "Habilidade:", "ability": "Habilidade:",
"passive": "Passiva:", "passive": "Passiva:",
@ -30,12 +30,12 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"selectMoveSwapWith": "Escolha o movimento que substituirá", "selectMoveSwapWith": "Escolha o movimento que substituirá",
"unlockPassive": "Aprender Passiva", "unlockPassive": "Aprender Passiva",
"reduceCost": "Reduzir Custo", "reduceCost": "Reduzir Custo",
"cycleShiny": "R: Mudar Shiny", "cycleShiny": "R: » Shiny",
"cycleForm": "F: Mudar Forma", "cycleForm": "F: » Forma",
"cycleGender": "G: Mudar Gênero", "cycleGender": "G: » Gênero",
"cycleAbility": "E: Mudar Habilidade", "cycleAbility": "E: » Habilidade",
"cycleNature": "N: Mudar Natureza", "cycleNature": "N: » Natureza",
"cycleVariant": "V: Mudar Variante", "cycleVariant": "V: » Variante",
"enablePassive": "Ativar Passiva", "enablePassive": "Ativar Passiva",
"disablePassive": "Desativar Passiva", "disablePassive": "Desativar Passiva",
"locked": "Bloqueada", "locked": "Bloqueada",

View File

@ -1,16 +1,48 @@
import { getVariantTint } from "#app/data/variant";
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
import BattleScene from "../battle-scene"; import BattleScene from "../battle-scene";
import { Gender, getGenderColor, getGenderSymbol } from "../data/gender"; import { Gender, getGenderColor, getGenderSymbol } from "../data/gender";
import { getNatureName } from "../data/nature";
import { Type } from "../data/type";
import Pokemon from "../field/pokemon"; import Pokemon from "../field/pokemon";
import i18next from "../plugins/i18n";
import * as Utils from "../utils";
import ConfirmUiHandler from "./confirm-ui-handler";
import { StatsContainer } from "./stats-container"; import { StatsContainer } from "./stats-container";
import { TextStyle, addBBCodeTextObject, addTextObject, getTextColor } from "./text"; import { TextStyle, addBBCodeTextObject, addTextObject, getTextColor } from "./text";
import { addWindow } from "./ui-theme"; import { addWindow } from "./ui-theme";
import { getNatureName } from "../data/nature";
import * as Utils from "../utils"; interface LanguageSetting {
import { Type } from "../data/type"; infoContainerTextSize: string;
import { getVariantTint } from "#app/data/variant"; infoContainerLabelXPos?: integer;
import ConfirmUiHandler from "./confirm-ui-handler"; infoContainerTextXPos?: integer;
import i18next from "../plugins/i18n"; }
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: -16,
infoContainerTextXPos: -12,
},
};
export default class PokemonInfoContainer extends Phaser.GameObjects.Container { export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
private readonly infoWindowWidth = 104; private readonly infoWindowWidth = 104;
@ -41,6 +73,9 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
} }
setup(): void { setup(): void {
const currentLanguage = i18next.language;
const langSettingKey = Object.keys(languageSettings).find(lang => currentLanguage.includes(lang));
const textSettings = languageSettings[langSettingKey];
const infoBg = addWindow(this.scene, 0, 0, this.infoWindowWidth, 132); const infoBg = addWindow(this.scene, 0, 0, this.infoWindowWidth, 132);
infoBg.setOrigin(0.5, 0.5); infoBg.setOrigin(0.5, 0.5);
@ -87,29 +122,36 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
this.add(infoBg); this.add(infoBg);
this.add(this.statsContainer); this.add(this.statsContainer);
this.pokemonGenderLabelText = addTextObject(this.scene, -18, 18, i18next.t("pokemonInfoContainer:gender"), TextStyle.WINDOW, { fontSize: "64px" }); // The position should be set per language
const infoContainerLabelXPos = textSettings?.infoContainerLabelXPos || -18;
const infoContainerTextXPos = textSettings?.infoContainerTextXPos || -14;
// The font size should be set by language
const infoContainerTextSize = textSettings?.infoContainerTextSize || "64px";
this.pokemonGenderLabelText = addTextObject(this.scene, infoContainerLabelXPos, 18, i18next.t("pokemonInfoContainer:gender"), TextStyle.WINDOW, { fontSize: infoContainerTextSize });
this.pokemonGenderLabelText.setOrigin(1, 0); this.pokemonGenderLabelText.setOrigin(1, 0);
this.pokemonGenderLabelText.setVisible(false); this.pokemonGenderLabelText.setVisible(false);
this.add(this.pokemonGenderLabelText); this.add(this.pokemonGenderLabelText);
this.pokemonGenderText = addTextObject(this.scene, -14, 18, "", TextStyle.WINDOW, { fontSize: "64px" }); this.pokemonGenderText = addTextObject(this.scene, infoContainerTextXPos, 18, "", TextStyle.WINDOW, { fontSize: infoContainerTextSize });
this.pokemonGenderText.setOrigin(0, 0); this.pokemonGenderText.setOrigin(0, 0);
this.pokemonGenderText.setVisible(false); this.pokemonGenderText.setVisible(false);
this.add(this.pokemonGenderText); this.add(this.pokemonGenderText);
this.pokemonAbilityLabelText = addTextObject(this.scene, -18, 28, i18next.t("pokemonInfoContainer:ability"), TextStyle.WINDOW, { fontSize: "64px" }); this.pokemonAbilityLabelText = addTextObject(this.scene, infoContainerLabelXPos, 28, i18next.t("pokemonInfoContainer:ability"), TextStyle.WINDOW, { fontSize: infoContainerTextSize });
this.pokemonAbilityLabelText.setOrigin(1, 0); this.pokemonAbilityLabelText.setOrigin(1, 0);
this.add(this.pokemonAbilityLabelText); this.add(this.pokemonAbilityLabelText);
this.pokemonAbilityText = addTextObject(this.scene, -14, 28, "", TextStyle.WINDOW, { fontSize: "64px" }); this.pokemonAbilityText = addTextObject(this.scene, infoContainerTextXPos, 28, "", TextStyle.WINDOW, { fontSize: infoContainerTextSize });
this.pokemonAbilityText.setOrigin(0, 0); this.pokemonAbilityText.setOrigin(0, 0);
this.add(this.pokemonAbilityText); this.add(this.pokemonAbilityText);
this.pokemonNatureLabelText = addTextObject(this.scene, -18, 38, i18next.t("pokemonInfoContainer:nature"), TextStyle.WINDOW, { fontSize: "64px" }); this.pokemonNatureLabelText = addTextObject(this.scene, infoContainerLabelXPos, 38, i18next.t("pokemonInfoContainer:nature"), TextStyle.WINDOW, { fontSize: infoContainerTextSize });
this.pokemonNatureLabelText.setOrigin(1, 0); this.pokemonNatureLabelText.setOrigin(1, 0);
this.add(this.pokemonNatureLabelText); this.add(this.pokemonNatureLabelText);
this.pokemonNatureText = addBBCodeTextObject(this.scene, -14, 38, "", TextStyle.WINDOW, { fontSize: "64px", lineSpacing: 3, maxLines: 2 }); this.pokemonNatureText = addBBCodeTextObject(this.scene, infoContainerTextXPos, 38, "", TextStyle.WINDOW, { fontSize: infoContainerTextSize, lineSpacing: 3, maxLines: 2 });
this.pokemonNatureText.setOrigin(0, 0); this.pokemonNatureText.setOrigin(0, 0);
this.add(this.pokemonNatureText); this.add(this.pokemonNatureText);

View File

@ -76,9 +76,9 @@ const languageSettings: { [key: string]: LanguageSetting } = {
starterInfoYOffset: 2 starterInfoYOffset: 2
}, },
"pt":{ "pt":{
starterInfoTextSize: "47px", starterInfoTextSize: "48px",
instructionTextSize: "38px", instructionTextSize: "42px",
starterInfoXPos: 32, starterInfoXPos: 33,
}, },
}; };