Make more phases strings translatable and add their spanish locale

pull/245/head^2
PabloG02 2024-04-24 01:19:36 +02:00 committed by Samuel H
parent 7031ae797f
commit cd68d2c4a9
3 changed files with 63 additions and 25 deletions

View File

@ -44,8 +44,22 @@ export const menu: SimpleTranslationEntries = {
"playerGo": "Go! {{pokemonName}}!", "playerGo": "Go! {{pokemonName}}!",
"trainerGo": "{{trainerName}} sent out {{pokemonName}}!", "trainerGo": "{{trainerName}} sent out {{pokemonName}}!",
"switchQuestion": "Will you switch\n{{pokemonName}}?", "switchQuestion": "Will you switch\n{{pokemonName}}?",
"trainerDefeated": `You defeated\n{{trainerName}}!`,
"pokemonCaught": "{{pokemonName}} was caught!",
"pokemon": "Pokémon", "pokemon": "Pokémon",
"sendOutPokemon": "Go! {{pokemonName}}!", "sendOutPokemon": "Go! {{pokemonName}}!",
"attackFailed": "But it failed!",
"attackHitsCount": `Hit {{hitsTotal}} time(s)!`,
"expGain": "{{pokemonName}} gained\n{{exp}} EXP. Points!",
"levelUp": "{{pokemonName}} grew to\nLv. {{level}}!",
"learnMove": "{{pokemonName}} learned\n{{moveName}}!",
"learnMovePrompt": "{{pokemonName}} wants to learn the\nmove {{moveName}}.",
"learnMoveLimitReached": "However, {{pokemonName}} already\nknows four moves.",
"learnMoveReplaceQuestion": "Should a move be forgotten and\nreplaced with {{moveName}}?",
"learnMoveStopTeaching": "Stop trying to teach\n{{moveName}}?",
"learnMoveNotLearned": "{{pokemonName}} did not learn the\nmove {{moveName}}.",
"learnMoveForgetQuestion": "Which move should be forgotten?",
"learnMoveForgetSuccess": "{{pokemonName}} forgot how to\nuse {{moveName}}.",
"levelCapUp": "The level cap\nhas increased to {{levelCap}}!", "levelCapUp": "The level cap\nhas increased to {{levelCap}}!",
"moveNotImplemented": "{{moveName}} is not yet implemented and cannot be selected.", "moveNotImplemented": "{{moveName}} is not yet implemented and cannot be selected.",
"moveDisabled": "{{moveName}} is disabled!", "moveDisabled": "{{moveName}} is disabled!",
@ -56,7 +70,12 @@ export const menu: SimpleTranslationEntries = {
"noEscapeForce": "An unseen force\nprevents escape.", "noEscapeForce": "An unseen force\nprevents escape.",
"noEscapeTrainer": "You can't run\nfrom a trainer battle!", "noEscapeTrainer": "You can't run\nfrom a trainer battle!",
"noEscapePokemon": "{{pokemonName}}'s {{moveName}}\nprevents {{escapeVerb}}!", "noEscapePokemon": "{{pokemonName}}'s {{moveName}}\nprevents {{escapeVerb}}!",
"runAwaySuccess": "You got away safely!",
"runAwayCannotEscape": 'You can\'t escape!',
"escapeVerbSwitch": "switching", "escapeVerbSwitch": "switching",
"escapeVerbFlee": "fleeing", "escapeVerbFlee": "fleeing",
"notDisabled": "{{moveName}} is disabled\nno more!", "notDisabled": "{{moveName}} is disabled\nno more!",
"skipItemQuestion": "Are you sure you want to skip taking an item?",
"eggHatching": "Oh?",
"ivScannerUseQuestion": "Use IV Scanner on {{pokemonName}}?",
} as const; } as const;

View File

@ -20,7 +20,7 @@ export const menu: SimpleTranslationEntries = {
"boy": "Chico", "boy": "Chico",
"girl": "Chica", "girl": "Chica",
"bossAppeared": "¡{{bossName}} te corta el paso!", "bossAppeared": "¡{{bossName}} te corta el paso!",
"trainerAppeared": "¡{{trainerName}}\n te desafía!", "trainerAppeared": "¡{{trainerName}}\nte desafía!",
"singleWildAppeared": "¡Un {{pokemonName}} salvaje te corta el paso!", "singleWildAppeared": "¡Un {{pokemonName}} salvaje te corta el paso!",
"multiWildAppeared": "¡Un {{pokemonName1}} y un {{pokemonName2}} salvajes\nte cortan el paso!", "multiWildAppeared": "¡Un {{pokemonName1}} y un {{pokemonName2}} salvajes\nte cortan el paso!",
"playerComeBack": "¡{{pokemonName}}, ven aquí!", "playerComeBack": "¡{{pokemonName}}, ven aquí!",
@ -28,8 +28,22 @@ export const menu: SimpleTranslationEntries = {
"playerGo": "¡Adelante, {{pokemonName}}!", "playerGo": "¡Adelante, {{pokemonName}}!",
"trainerGo": "¡{{trainerName}} saca a {{pokemonName}}!", "trainerGo": "¡{{trainerName}} saca a {{pokemonName}}!",
"switchQuestion": "¿Quieres cambiar a\n{{pokemonName}}?", "switchQuestion": "¿Quieres cambiar a\n{{pokemonName}}?",
"trainerDefeated": "¡Has derrotado a\n{{trainerName}}!",
"pokemonCaught": "¡{{pokemonName}} atrapado!",
"pokemon": "Pokémon", "pokemon": "Pokémon",
"sendOutPokemon": "¡Adelante, {{pokemonName}}!", "sendOutPokemon": "¡Adelante, {{pokemonName}}!",
"attackFailed": "¡Pero ha fallado!",
"attackHitsCount": `N.º de golpes: {{hitsTotal}}.`,
"expGain": "{{pokemonName}} ha ganado\n{{exp}} puntos de experiencia.",
"levelUp": "¡{{pokemonName}} ha subido al \nNv. {{level}}!",
"learnMove": "¡{{pokemonName}} ha aprendido {{moveName}}!",
"learnMovePrompt": "{{pokemonName}} quiere aprender {{moveName}}.",
"learnMoveLimitReached": "Pero, {{pokemonName}} ya conoce\ncuatro movimientos.",
"learnMoveReplaceQuestion": "¿Quieres sustituir uno de sus movimientos por {{moveName}}?",
"learnMoveStopTeaching": "¿Prefieres que no aprenda\n{{moveName}}?",
"learnMoveNotLearned": "{{pokemonName}} no ha aprendido {{moveName}}.",
"learnMoveForgetQuestion": "¿Qué movimiento quieres que olvide?",
"learnMoveForgetSuccess": "{{pokemonName}} ha olvidado cómo utilizar {{moveName}}.",
"levelCapUp": "¡Se ha incrementado el\nnivel máximo a {{levelCap}}!", "levelCapUp": "¡Se ha incrementado el\nnivel máximo a {{levelCap}}!",
"moveNotImplemented": "{{moveName}} aún no está implementado y no se puede seleccionar.", "moveNotImplemented": "{{moveName}} aún no está implementado y no se puede seleccionar.",
"moveDisabled": "!No puede usar {{moveName}} porque ha sido anulado!", "moveDisabled": "!No puede usar {{moveName}} porque ha sido anulado!",
@ -40,7 +54,12 @@ export const menu: SimpleTranslationEntries = {
"noEscapeForce": "Una fuerza misteriosa\nte impide huir.", "noEscapeForce": "Una fuerza misteriosa\nte impide huir.",
"noEscapeTrainer": "¡No puedes huir de los\ncombates contra Entrenadores!", "noEscapeTrainer": "¡No puedes huir de los\ncombates contra Entrenadores!",
"noEscapePokemon": "¡El movimiento {{moveName}} de {{pokemonName}} impide la huida!", "noEscapePokemon": "¡El movimiento {{moveName}} de {{pokemonName}} impide la huida!",
"runAwaySuccess": "¡Escapas sin problemas!",
"runAwayCannotEscape": "¡No has podido escapar!",
"escapeVerbSwitch": "cambiar", "escapeVerbSwitch": "cambiar",
"escapeVerbFlee": "huir", "escapeVerbFlee": "huir",
"notDisabled": "¡El movimiento {{moveName}}\n ya no está anulado!", "notDisabled": "¡El movimiento {{moveName}}\nya no está anulado!",
"skipItemQuestion": "¿Estás seguro de que no quieres coger un objeto?",
"eggHatching": "¿Y esto?",
"ivScannerUseQuestion": "¿Quieres usar el Escáner de IVs en {{pokemonName}}?"
} as const; } as const;

View File

@ -1185,7 +1185,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
} }
if (this.player) { if (this.player) {
this.scene.ui.showText(i18next.t('menu:playerGo', {pokemonName: this.getPokemon().name})); this.scene.ui.showText(i18next.t('menu:playerGo', { pokemonName: this.getPokemon().name }));
if (this.player) if (this.player)
this.scene.pbTray.hide(); this.scene.pbTray.hide();
this.scene.trainer.setTexture(`trainer_${this.scene.gameData.gender === PlayerGender.FEMALE ? 'f' : 'm'}_back_pb`); this.scene.trainer.setTexture(`trainer_${this.scene.gameData.gender === PlayerGender.FEMALE ? 'f' : 'm'}_back_pb`);
@ -2335,7 +2335,7 @@ export class MovePhase extends BattlePhase {
} }
showFailedText(failedText: string = null): void { showFailedText(failedText: string = null): void {
this.scene.queueMessage(failedText || 'But it failed!'); this.scene.queueMessage(failedText || i18next.t('menu:attackFailed'));
} }
end() { end() {
@ -2398,7 +2398,7 @@ export class MoveEffectPhase extends PokemonPhase {
moveHistoryEntry.result = MoveResult.MISS; moveHistoryEntry.result = MoveResult.MISS;
applyMoveAttrs(MissEffectAttr, user, null, this.move.getMove()); applyMoveAttrs(MissEffectAttr, user, null, this.move.getMove());
} else { } else {
this.scene.queueMessage('But it failed!'); this.scene.queueMessage(i18next.t('menu:attackFailed'));
moveHistoryEntry.result = MoveResult.FAIL; moveHistoryEntry.result = MoveResult.FAIL;
} }
return this.end(); return this.end();
@ -2482,7 +2482,7 @@ export class MoveEffectPhase extends PokemonPhase {
else { else {
const hitsTotal = user.turnData.hitCount - Math.max(user.turnData.hitsLeft, 0); const hitsTotal = user.turnData.hitCount - Math.max(user.turnData.hitsLeft, 0);
if (hitsTotal > 1) if (hitsTotal > 1)
this.scene.queueMessage(`Hit ${hitsTotal} time(s)!`); this.scene.queueMessage(i18next.t('menu:attackHitsCount', { count: hitsTotal }));
this.scene.applyModifiers(HitHealModifier, this.player, user); this.scene.applyModifiers(HitHealModifier, this.player, user);
} }
} }
@ -3336,7 +3336,7 @@ export class TrainerVictoryPhase extends BattlePhase {
this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.VOUCHER)); this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.VOUCHER));
} }
this.scene.ui.showText(`You defeated\n${this.scene.currentBattle.trainer.getName(TrainerSlot.NONE, true)}!`, null, () => { this.scene.ui.showText(i18next.t('menu:trainerDefeated', { trainerName: this.scene.currentBattle.trainer.getName(TrainerSlot.NONE, true) }), null, () => {
const victoryMessages = this.scene.currentBattle.trainer.getVictoryMessages(); const victoryMessages = this.scene.currentBattle.trainer.getVictoryMessages();
const showMessage = () => { const showMessage = () => {
let message: string; let message: string;
@ -3603,7 +3603,7 @@ export class ExpPhase extends PlayerPartyMemberPokemonPhase {
let exp = new Utils.NumberHolder(this.expValue); let exp = new Utils.NumberHolder(this.expValue);
this.scene.applyModifiers(ExpBoosterModifier, true, exp); this.scene.applyModifiers(ExpBoosterModifier, true, exp);
exp.value = Math.floor(exp.value); exp.value = Math.floor(exp.value);
this.scene.ui.showText(`${pokemon.name} gained\n${exp.value} EXP. Points!`, null, () => { this.scene.ui.showText(i18next.t('menu:expGain', { pokemonName: pokemon.name, exp: exp.value }), null, () => {
const lastLevel = pokemon.level; const lastLevel = pokemon.level;
let newLevel: integer; let newLevel: integer;
pokemon.addExp(exp.value); pokemon.addExp(exp.value);
@ -3691,7 +3691,7 @@ export class LevelUpPhase extends PlayerPartyMemberPokemonPhase {
pokemon.calculateStats(); pokemon.calculateStats();
pokemon.updateInfo(); pokemon.updateInfo();
this.scene.playSound('level_up_fanfare'); this.scene.playSound('level_up_fanfare');
this.scene.ui.showText(`${this.getPokemon().name} grew to\nLv. ${this.level}!`, null, () => this.scene.ui.getMessageHandler().promptLevelUpStats(this.partyMemberIndex, prevStats, false).then(() => this.end()), null, true); this.scene.ui.showText(i18next.t('menu:levelUp', { pokemonName: this.getPokemon().name, level: this.level }), null, () => this.scene.ui.getMessageHandler().promptLevelUpStats(this.partyMemberIndex, prevStats, false).then(() => this.end()), null, true);
if (this.level <= 100) { if (this.level <= 100) {
const levelMoves = this.getPokemon().getLevelMoves(this.lastLevel + 1); const levelMoves = this.getPokemon().getLevelMoves(this.lastLevel + 1);
for (let lm of levelMoves) for (let lm of levelMoves)
@ -3740,7 +3740,7 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
.then(() => { .then(() => {
this.scene.ui.setMode(messageMode).then(() => { this.scene.ui.setMode(messageMode).then(() => {
this.scene.playSound('level_up_fanfare'); this.scene.playSound('level_up_fanfare');
this.scene.ui.showText(`${pokemon.name} learned\n${move.name}!`, null, () => { this.scene.ui.showText(i18next.t('menu:learnMove', { pokemonName: pokemon.name, moveName: move.name }), null, () => {
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true); this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true);
this.end(); this.end();
}, messageMode === Mode.EVOLUTION_SCENE ? 1000 : null, true); }, messageMode === Mode.EVOLUTION_SCENE ? 1000 : null, true);
@ -3749,15 +3749,15 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
}); });
} else { } else {
this.scene.ui.setMode(messageMode).then(() => { this.scene.ui.setMode(messageMode).then(() => {
this.scene.ui.showText(`${pokemon.name} wants to learn the\nmove ${move.name}.`, null, () => { this.scene.ui.showText(i18next.t('menu:learnMovePrompt', { pokemonName: pokemon.name, moveName: move.name }), null, () => {
this.scene.ui.showText(`However, ${pokemon.name} already\nknows four moves.`, null, () => { this.scene.ui.showText(i18next.t('menu:learnMoveLimitReached', { pokemonName: pokemon.name }), null, () => {
this.scene.ui.showText(`Should a move be deleted and\nreplaced with ${move.name}?`, null, () => { this.scene.ui.showText(i18next.t('menu:learnMoveReplaceQuestion', { moveName: move.name }), null, () => {
const noHandler = () => { const noHandler = () => {
this.scene.ui.setMode(messageMode).then(() => { this.scene.ui.setMode(messageMode).then(() => {
this.scene.ui.showText(`Stop trying to teach\n${move.name}?`, null, () => { this.scene.ui.showText(i18next.t('menu:learnMoveStopTeaching', { moveName: move.name }), null, () => {
this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => { this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => {
this.scene.ui.setMode(messageMode); this.scene.ui.setMode(messageMode);
this.scene.ui.showText(`${pokemon.name} did not learn the\nmove ${move.name}.`, null, () => this.end(), null, true); this.scene.ui.showText(i18next.t('menu:learnMoveNotLearned', { pokemonName: pokemon.name, moveName: move.name }), null, () => this.end(), null, true);
}, () => { }, () => {
this.scene.ui.setMode(messageMode); this.scene.ui.setMode(messageMode);
this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, this.moveId)); this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, this.moveId));
@ -3768,7 +3768,7 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
}; };
this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => { this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => {
this.scene.ui.setMode(messageMode); this.scene.ui.setMode(messageMode);
this.scene.ui.showText('Which move should be forgotten?', null, () => { this.scene.ui.showText(i18next.t('menu:learnMoveForgetQuestion'), null, () => {
this.scene.ui.setModeWithoutClear(Mode.SUMMARY, this.getPokemon(), SummaryUiMode.LEARN_MOVE, move, (moveIndex: integer) => { this.scene.ui.setModeWithoutClear(Mode.SUMMARY, this.getPokemon(), SummaryUiMode.LEARN_MOVE, move, (moveIndex: integer) => {
if (moveIndex === 4) { if (moveIndex === 4) {
noHandler(); noHandler();
@ -3776,7 +3776,7 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
} }
this.scene.ui.setMode(messageMode).then(() => { this.scene.ui.setMode(messageMode).then(() => {
this.scene.ui.showText('@d{32}1, @d{15}2, and@d{15}… @d{15}… @d{15}… @d{15}@s{pb_bounce_1}Poof!', null, () => { this.scene.ui.showText('@d{32}1, @d{15}2, and@d{15}… @d{15}… @d{15}… @d{15}@s{pb_bounce_1}Poof!', null, () => {
this.scene.ui.showText(`${pokemon.name} forgot how to\nuse ${pokemon.moveset[moveIndex].getName()}.`, null, () => { this.scene.ui.showText(i18next.t('menu:learnMoveForgetSuccess', { pokemonName: pokemon.name, moveName: pokemon.moveset[moveIndex].getName() }), null, () => {
this.scene.ui.showText('And…', null, () => { this.scene.ui.showText('And…', null, () => {
pokemon.setMove(moveIndex, Moves.NONE); pokemon.setMove(moveIndex, Moves.NONE);
this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, this.moveId)); this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, this.moveId));
@ -4091,7 +4091,7 @@ export class AttemptCapturePhase extends PokemonPhase {
this.scene.gameData.updateSpeciesDexIvs(pokemon.species.speciesId, pokemon.ivs); this.scene.gameData.updateSpeciesDexIvs(pokemon.species.speciesId, pokemon.ivs);
this.scene.ui.showText(`${pokemon.name} was caught!`, null, () => { this.scene.ui.showText(i18next.t('menu:pokemonCaught', { pokemonName: pokemon.name }), null, () => {
const end = () => { const end = () => {
this.scene.pokemonInfoContainer.hide(); this.scene.pokemonInfoContainer.hide();
this.removePb(); this.removePb();
@ -4177,7 +4177,7 @@ export class AttemptRunPhase extends PokemonPhase {
if (playerPokemon.randSeedInt(256) < escapeChance.value) { if (playerPokemon.randSeedInt(256) < escapeChance.value) {
this.scene.playSound('flee'); this.scene.playSound('flee');
this.scene.queueMessage('You got away safely!', null, true, 500); this.scene.queueMessage(i18next.t('menu:runAwaySuccess'), null, true, 500);
this.scene.tweens.add({ this.scene.tweens.add({
targets: [ this.scene.arenaEnemy, enemyField ].flat(), targets: [ this.scene.arenaEnemy, enemyField ].flat(),
@ -4198,7 +4198,7 @@ export class AttemptRunPhase extends PokemonPhase {
this.scene.pushPhase(new BattleEndPhase(this.scene)); this.scene.pushPhase(new BattleEndPhase(this.scene));
this.scene.pushPhase(new NewBattlePhase(this.scene)); this.scene.pushPhase(new NewBattlePhase(this.scene));
} else } else
this.scene.queueMessage('You can\'t escape!', null, true); this.scene.queueMessage(i18next.t('menu:runAwayCannotEscape'), null, true, 500);
this.end(); this.end();
} }
@ -4230,7 +4230,7 @@ export class SelectModifierPhase extends BattlePhase {
const modifierSelectCallback = (rowCursor: integer, cursor: integer) => { const modifierSelectCallback = (rowCursor: integer, cursor: integer) => {
if (rowCursor < 0 || cursor < 0) { if (rowCursor < 0 || cursor < 0) {
this.scene.ui.showText(`Are you sure you want to skip taking an item?`, null, () => { this.scene.ui.showText(i18next.t('menu:skipItemQuestion'), null, () => {
this.scene.ui.setOverlayMode(Mode.CONFIRM, () => { this.scene.ui.setOverlayMode(Mode.CONFIRM, () => {
this.scene.ui.revertMode(); this.scene.ui.revertMode();
this.scene.ui.setMode(Mode.MESSAGE); this.scene.ui.setMode(Mode.MESSAGE);
@ -4408,7 +4408,7 @@ export class EggLapsePhase extends Phase {
}); });
if (eggsToHatch.length) { if (eggsToHatch.length) {
this.scene.queueMessage('Oh?'); this.scene.queueMessage(i18next.t('menu:eggHatching'));
for (let egg of eggsToHatch) for (let egg of eggsToHatch)
this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg)); this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg));
@ -4502,7 +4502,7 @@ export class ScanIvsPhase extends PokemonPhase {
const pokemon = this.getPokemon(); const pokemon = this.getPokemon();
this.scene.ui.showText(`Use IV Scanner on ${pokemon.name}?`, null, () => { this.scene.ui.showText(i18next.t('menu:ivScannerUseQuestion', { pokemonName: pokemon.name }), null, () => {
this.scene.ui.setMode(Mode.CONFIRM, () => { this.scene.ui.setMode(Mode.CONFIRM, () => {
this.scene.ui.setMode(Mode.MESSAGE); this.scene.ui.setMode(Mode.MESSAGE);
this.scene.ui.clearText(); this.scene.ui.clearText();