From 8c1b55f5db40b846c1d5929f6a438616160d5a3c Mon Sep 17 00:00:00 2001 From: _Bastler <_Bastler@bstly.de> Date: Thu, 27 Jan 2022 15:53:53 +0100 Subject: [PATCH] i18n trigger message --- front/src/Phaser/Game/GameMapPropertiesListener.ts | 5 +++-- front/src/Phaser/Game/GameScene.ts | 4 ++-- front/src/i18n/de-DE/index.ts | 2 ++ front/src/i18n/de-DE/message.ts | 9 +++++++++ front/src/i18n/en-US/index.ts | 2 ++ front/src/i18n/en-US/message.ts | 9 +++++++++ 6 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 front/src/i18n/de-DE/message.ts create mode 100644 front/src/i18n/en-US/message.ts diff --git a/front/src/Phaser/Game/GameMapPropertiesListener.ts b/front/src/Phaser/Game/GameMapPropertiesListener.ts index 22a426d5..f27a7b9f 100644 --- a/front/src/Phaser/Game/GameMapPropertiesListener.ts +++ b/front/src/Phaser/Game/GameMapPropertiesListener.ts @@ -11,6 +11,7 @@ import type { ITiledMapLayer } from "../Map/ITiledMap"; import { GameMapProperties } from "./GameMapProperties"; import { iframeListener } from "../../Api/IframeListener"; import type { Subscription } from "rxjs"; +import { LL } from "../../i18n/i18n-svelte"; enum OpenCoWebsiteState { LOADING, @@ -42,7 +43,7 @@ export class GameMapPropertiesListener { if (forceTrigger || openWebsiteTriggerValue === ON_ACTION_TRIGGER_BUTTON) { let message = allProps.get(GameMapProperties.OPEN_WEBSITE_TRIGGER_MESSAGE); if (message === undefined) { - message = "Press SPACE or touch here to open web site in new tab"; + message = get(LL).message.openWebsiteTabTrigger(); } layoutManagerActionStore.addAction({ uuid: "openTab", @@ -144,7 +145,7 @@ export class GameMapPropertiesListener { const createWebsiteTrigger = () => { if (!websiteTriggerMessageProperty) { - websiteTriggerMessageProperty = "Press SPACE or touch here to open web site"; + websiteTriggerMessageProperty = get(LL).message.openWebsiteTrigger(); } this.coWebsitesOpenByLayer.set(layer, { diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 71cce312..3e253348 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -91,7 +91,7 @@ import { MapStore } from "../../Stores/Utils/MapStore"; import { followUsersColorStore } from "../../Stores/FollowStore"; import Camera = Phaser.Cameras.Scene2D.Camera; import { GameSceneUserInputHandler } from "../UserInput/GameSceneUserInputHandler"; -import { locale } from "../../i18n/i18n-svelte"; +import { locale, LL } from "../../i18n/i18n-svelte"; import { i18nJson } from "../../i18n/locales"; export interface GameSceneInitInterface { @@ -1001,7 +1001,7 @@ export class GameScene extends DirtyScene { if (forceTrigger || jitsiTriggerValue === ON_ACTION_TRIGGER_BUTTON) { let message = allProps.get(GameMapProperties.JITSI_TRIGGER_MESSAGE); if (message === undefined) { - message = "Press SPACE or touch here to enter Jitsi Meet room"; + message = get(LL).message.openJitsiTrigger(); } layoutManagerActionStore.addAction({ uuid: "jitsi", diff --git a/front/src/i18n/de-DE/index.ts b/front/src/i18n/de-DE/index.ts index 624013ab..c81b08de 100644 --- a/front/src/i18n/de-DE/index.ts +++ b/front/src/i18n/de-DE/index.ts @@ -8,6 +8,7 @@ import error from "./error"; import follow from "./follow"; import login from "./login"; import menu from "./menu"; +import message from "./message"; import report from "./report"; import warning from "./warning"; import woka from "./woka"; @@ -29,6 +30,7 @@ const de_DE: Translation = { report, warning, emoji, + message, }; export default de_DE; diff --git a/front/src/i18n/de-DE/message.ts b/front/src/i18n/de-DE/message.ts new file mode 100644 index 00000000..58e86a74 --- /dev/null +++ b/front/src/i18n/de-DE/message.ts @@ -0,0 +1,9 @@ +import type { Translation } from "../i18n-types"; + +const message: NonNullable = { + openWebsiteTrigger: "Drücke LEERTASTE oder tippe hier um die Webseite zu öffnen", + openWebsiteTabTrigger: "Drücke LEERTASTE oder tippe hier um die Webseite in einem neuen Tab zu öffnen", + openJitsiTrigger: "Drücke LEERTASTE oder tippe hier um dem Jitsi Meet Raum beizutreten", +}; + +export default message; diff --git a/front/src/i18n/en-US/index.ts b/front/src/i18n/en-US/index.ts index 2d3ac74a..0d71f56f 100644 --- a/front/src/i18n/en-US/index.ts +++ b/front/src/i18n/en-US/index.ts @@ -11,6 +11,7 @@ import menu from "./menu"; import report from "./report"; import warning from "./warning"; import emoji from "./emoji"; +import message from "./message"; const en_US: BaseTranslation = { language: "English", @@ -27,6 +28,7 @@ const en_US: BaseTranslation = { report, warning, emoji, + message, }; export default en_US; diff --git a/front/src/i18n/en-US/message.ts b/front/src/i18n/en-US/message.ts new file mode 100644 index 00000000..e4f657f0 --- /dev/null +++ b/front/src/i18n/en-US/message.ts @@ -0,0 +1,9 @@ +import type { BaseTranslation } from "../i18n-types"; + +const message: BaseTranslation = { + openWebsiteTrigger: "Press SPACE or touch here to open web site", + openWebsiteTabTrigger: "Press SPACE or touch here to open web site in new tab", + openJitsiTrigger: "Press SPACE or touch here to enter Jitsi Meet room", +}; + +export default message;