From f62b8db662d567d05524563972eb2c0c6c4e2522 Mon Sep 17 00:00:00 2001 From: Settel Date: Mon, 29 Aug 2022 15:15:25 +0200 Subject: [PATCH] feat: add i18n support and translations --- client/src/components/GameControls.vue | 19 +++++++++++----- client/src/components/Lobby.vue | 8 ++++++- client/src/components/LoginBox.vue | 8 +++++-- client/src/components/TopBar.vue | 7 +++++- client/src/composables/useI18n.ts | 30 ++++++++++++++++++++++++++ client/src/pages/index.vue | 9 ++++++-- client/src/pages/play.vue | 11 ++++++++-- 7 files changed, 79 insertions(+), 13 deletions(-) create mode 100644 client/src/composables/useI18n.ts diff --git a/client/src/components/GameControls.vue b/client/src/components/GameControls.vue index 4f6f1b5..11cddfe 100644 --- a/client/src/components/GameControls.vue +++ b/client/src/components/GameControls.vue @@ -1,18 +1,27 @@ diff --git a/client/src/components/LoginBox.vue b/client/src/components/LoginBox.vue index f7683ab..31b4115 100644 --- a/client/src/components/LoginBox.vue +++ b/client/src/components/LoginBox.vue @@ -3,7 +3,7 @@
- +
@@ -13,6 +13,11 @@ import { useRouter } from '#app' import { ref, Ref } from 'vue' import useAuth from '@/composables/useAuth'; +import useI18n from '@/composables/useI18n'; + +const { $t } = useI18n({ + 'login': { en: 'log in', de: 'login'}, +}) const vFocus = { mounted: (el: HTMLElement) => el.focus() } @@ -36,7 +41,6 @@ const login = (): void => { .login-box { &__container-outer { display: flex; - width: 240px; } &__container-inner { diff --git a/client/src/components/TopBar.vue b/client/src/components/TopBar.vue index 43f9d5f..344333e 100644 --- a/client/src/components/TopBar.vue +++ b/client/src/components/TopBar.vue @@ -17,7 +17,7 @@
- +
@@ -25,9 +25,14 @@