From 4ea67976b940b9da75794730ddf621346fbd5237 Mon Sep 17 00:00:00 2001 From: Edralo Date: Wed, 24 Apr 2024 13:45:44 +0200 Subject: [PATCH] Fix password input types for languages other than english --- src/ui/form-modal-ui-handler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/form-modal-ui-handler.ts b/src/ui/form-modal-ui-handler.ts index 3e326322c..ec5f4147c 100644 --- a/src/ui/form-modal-ui-handler.ts +++ b/src/ui/form-modal-ui-handler.ts @@ -5,6 +5,7 @@ import { TextStyle, addTextInputObject, addTextObject } from "./text"; import { WindowVariant, addWindow } from "./ui-theme"; import InputText from "phaser3-rex-plugins/plugins/inputtext"; import * as Utils from "../utils"; +import i18next from '../plugins/i18n'; export interface FormModalConfig extends ModalConfig { errorMessage?: string; @@ -55,7 +56,7 @@ export abstract class FormModalUiHandler extends ModalUiHandler { const inputBg = addWindow(this.scene, 0, 0, 80, 16, false, false, 0, 0, WindowVariant.XTHIN); - const isPassword = field.includes('Password'); + const isPassword = field.includes(i18next.t("menu:password")) || field.includes(i18next.t("menu:confirmPassword")); const input = addTextInputObject(this.scene, 4, -2, 440, 116, TextStyle.TOOLTIP_CONTENT, { type: isPassword ? 'password' : 'text', maxLength: isPassword ? 64 : 16 }); input.setOrigin(0, 0);