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:
Juan-LucasandFlashfyre authored and GitHub committed 2024-04-24 00:36:07 -04:00
1 parent ea40bd18f5
commit 1b1578d266
6 files changed
+1136 -6

No files matched your search

+8 -2
View File
@@ -4,6 +4,7 @@ import { addTextObject, TextStyle } from "./text";
import PartyUiHandler, { PartyUiMode } from "./party-ui-handler";
import { Mode } from "./ui";
import UiHandler from "./ui-handler";
import i18next from '../plugins/i18n';
export enum Command {
FIGHT = 0,
@@ -25,7 +26,12 @@ export default class CommandUiHandler extends UiHandler {
setup() {
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.setVisible(false);
@@ -55,7 +61,7 @@ export default class CommandUiHandler extends UiHandler {
messageHandler.commandWindow.setVisible(true);
messageHandler.movesWindowContainer.setVisible(false);
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());
return true;