mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-29 18:26:09 +00:00
command-ui: add i18n for command ui handler and add i18n for fr (#258)
* command-ui: add i18n for command ui handler and add i18n for fr * Add missing Spanish file * Add additional missing localization references --------- Co-authored-by: Flashfyre <flashfireex@gmail.com>
This commit is contained in:
parent
ea40bd18f5
commit
1b1578d266
9
src/locales/en/command-ui-handler.ts
Normal file
9
src/locales/en/command-ui-handler.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const commandUiHandler: SimpleTranslationEntries = {
|
||||||
|
"fight": "Fight",
|
||||||
|
"ball": "Ball",
|
||||||
|
"pokemon": "Pokémon",
|
||||||
|
"run": "Run",
|
||||||
|
"actionMessage": "What will\n{{pokemonName}} do?",
|
||||||
|
} as const;
|
9
src/locales/es/command-ui-handler.ts
Normal file
9
src/locales/es/command-ui-handler.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const commandUiHandler: SimpleTranslationEntries = {
|
||||||
|
"fight": "Fight",
|
||||||
|
"ball": "Ball",
|
||||||
|
"pokemon": "Pokémon",
|
||||||
|
"run": "Run",
|
||||||
|
"actionMessage": "What will\n{{pokemonName}} do?",
|
||||||
|
} as const;
|
1086
src/locales/es/pokemon.ts
Normal file
1086
src/locales/es/pokemon.ts
Normal file
File diff suppressed because it is too large
Load Diff
9
src/locales/fr/command-ui-handler.ts
Normal file
9
src/locales/fr/command-ui-handler.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const commandUiHandler: SimpleTranslationEntries = {
|
||||||
|
"fight": "Attaque",
|
||||||
|
"ball": "Ball",
|
||||||
|
"pokemon": "Pokémon",
|
||||||
|
"run": "Fuite",
|
||||||
|
"actionMessage": "Que doit faire\n{{pokemonName}}?",
|
||||||
|
} as const;
|
@ -13,12 +13,18 @@ import { pokeball as esPokeball } from '../locales/es/pokeball';
|
|||||||
import { pokeball as frPokeball } from '../locales/fr/pokeball';
|
import { pokeball as frPokeball } from '../locales/fr/pokeball';
|
||||||
|
|
||||||
import { pokemon as enPokemon } from '../locales/en/pokemon';
|
import { pokemon as enPokemon } from '../locales/en/pokemon';
|
||||||
|
import { pokemon as esPokemon } from '../locales/es/pokemon';
|
||||||
import { pokemon as frPokemon } from '../locales/fr/pokemon';
|
import { pokemon as frPokemon } from '../locales/fr/pokemon';
|
||||||
|
|
||||||
|
import { commandUiHandler as enCommandUiHandler } from '../locales/en/command-ui-handler';
|
||||||
|
import { commandUiHandler as esCommandUiHandler } from '../locales/es/command-ui-handler';
|
||||||
|
import { commandUiHandler as frCommandUiHandler } from '../locales/fr/command-ui-handler';
|
||||||
|
|
||||||
export interface SimpleTranslationEntries {
|
export interface SimpleTranslationEntries {
|
||||||
[key: string]: string
|
[key: string]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface MoveTranslationEntry {
|
export interface MoveTranslationEntry {
|
||||||
name: string,
|
name: string,
|
||||||
effect: string
|
effect: string
|
||||||
@ -65,21 +71,25 @@ export function initI18n(): void {
|
|||||||
move: enMove,
|
move: enMove,
|
||||||
pokeball: enPokeball,
|
pokeball: enPokeball,
|
||||||
pokemon: enPokemon,
|
pokemon: enPokemon,
|
||||||
|
commandUiHandler: enCommandUiHandler,
|
||||||
},
|
},
|
||||||
es: {
|
es: {
|
||||||
menu: esMenu,
|
menu: esMenu,
|
||||||
move: esMove,
|
move: esMove,
|
||||||
pokeball: esPokeball,
|
pokeball: esPokeball,
|
||||||
},
|
pokemon: esPokemon,
|
||||||
it: {
|
commandUiHandler: esCommandUiHandler,
|
||||||
menu: itMenu,
|
|
||||||
},
|
},
|
||||||
fr: {
|
fr: {
|
||||||
menu: frMenu,
|
menu: frMenu,
|
||||||
move: frMove,
|
move: frMove,
|
||||||
pokeball: frPokeball,
|
pokeball: frPokeball,
|
||||||
pokemon: frPokemon,
|
pokemon: frPokemon,
|
||||||
}
|
commandUiHandler: frCommandUiHandler,
|
||||||
|
},
|
||||||
|
it: {
|
||||||
|
menu: itMenu,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -92,6 +102,7 @@ declare module 'i18next' {
|
|||||||
move: typeof enMove;
|
move: typeof enMove;
|
||||||
pokeball: typeof enPokeball;
|
pokeball: typeof enPokeball;
|
||||||
pokemon: typeof enPokemon;
|
pokemon: typeof enPokemon;
|
||||||
|
commandUiHandler: typeof enCommandUiHandler;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import { addTextObject, TextStyle } from "./text";
|
|||||||
import PartyUiHandler, { PartyUiMode } from "./party-ui-handler";
|
import PartyUiHandler, { PartyUiMode } from "./party-ui-handler";
|
||||||
import { Mode } from "./ui";
|
import { Mode } from "./ui";
|
||||||
import UiHandler from "./ui-handler";
|
import UiHandler from "./ui-handler";
|
||||||
|
import i18next from '../plugins/i18n';
|
||||||
|
|
||||||
export enum Command {
|
export enum Command {
|
||||||
FIGHT = 0,
|
FIGHT = 0,
|
||||||
@ -25,7 +26,12 @@ export default class CommandUiHandler extends UiHandler {
|
|||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
const commands = [ 'Fight', 'Ball', 'Pokémon', 'Run' ];
|
const commands = [
|
||||||
|
i18next.t('commandUiHandler:fight'),
|
||||||
|
i18next.t('commandUiHandler:ball'),
|
||||||
|
i18next.t('commandUiHandler:pokemon'),
|
||||||
|
i18next.t('commandUiHandler:run')
|
||||||
|
];
|
||||||
|
|
||||||
this.commandsContainer = this.scene.add.container(216, -38.7);
|
this.commandsContainer = this.scene.add.container(216, -38.7);
|
||||||
this.commandsContainer.setVisible(false);
|
this.commandsContainer.setVisible(false);
|
||||||
@ -55,7 +61,7 @@ export default class CommandUiHandler extends UiHandler {
|
|||||||
messageHandler.commandWindow.setVisible(true);
|
messageHandler.commandWindow.setVisible(true);
|
||||||
messageHandler.movesWindowContainer.setVisible(false);
|
messageHandler.movesWindowContainer.setVisible(false);
|
||||||
messageHandler.message.setWordWrapWidth(1110);
|
messageHandler.message.setWordWrapWidth(1110);
|
||||||
messageHandler.showText(`What will\n${commandPhase.getPokemon().name} do?`, 0);
|
messageHandler.showText(i18next.t('commandUiHandler:actionMessage', {pokemonName: commandPhase.getPokemon().name}), 0);
|
||||||
this.setCursor(this.getCursor());
|
this.setCursor(this.getCursor());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user