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 = {
"blockRecoilDamage" : "{{abilityName}} de {{pokemonName}}\nprotegeu-o do dano de recuo!",
"badDreams": "{{pokemonName}} está tendo pesadelos!",
} as const;

View File

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

View File

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

View File

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

View File

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

View File

@ -1,16 +1,48 @@
import { getVariantTint } from "#app/data/variant";
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
import BattleScene from "../battle-scene";
import { Gender, getGenderColor, getGenderSymbol } from "../data/gender";
import { getNatureName } from "../data/nature";
import { Type } from "../data/type";
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 { TextStyle, addBBCodeTextObject, addTextObject, getTextColor } from "./text";
import { addWindow } from "./ui-theme";
import { getNatureName } from "../data/nature";
import * as Utils from "../utils";
import { Type } from "../data/type";
import { getVariantTint } from "#app/data/variant";
import ConfirmUiHandler from "./confirm-ui-handler";
import i18next from "../plugins/i18n";
interface LanguageSetting {
infoContainerTextSize: string;
infoContainerLabelXPos?: integer;
infoContainerTextXPos?: integer;
}
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 {
private readonly infoWindowWidth = 104;
@ -41,6 +73,9 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
}
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);
infoBg.setOrigin(0.5, 0.5);
@ -87,29 +122,36 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
this.add(infoBg);
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.setVisible(false);
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.setVisible(false);
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.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.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.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.add(this.pokemonNatureText);

View File

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