Fix password input types for languages other than english
parent
adc383a8f9
commit
4ea67976b9
|
@ -5,6 +5,7 @@ import { TextStyle, addTextInputObject, addTextObject } from "./text";
|
||||||
import { WindowVariant, addWindow } from "./ui-theme";
|
import { WindowVariant, addWindow } from "./ui-theme";
|
||||||
import InputText from "phaser3-rex-plugins/plugins/inputtext";
|
import InputText from "phaser3-rex-plugins/plugins/inputtext";
|
||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
|
import i18next from '../plugins/i18n';
|
||||||
|
|
||||||
export interface FormModalConfig extends ModalConfig {
|
export interface FormModalConfig extends ModalConfig {
|
||||||
errorMessage?: string;
|
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 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 });
|
const input = addTextInputObject(this.scene, 4, -2, 440, 116, TextStyle.TOOLTIP_CONTENT, { type: isPassword ? 'password' : 'text', maxLength: isPassword ? 64 : 16 });
|
||||||
input.setOrigin(0, 0);
|
input.setOrigin(0, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue