From e53a42a2311e5646f96f6af89388f274f4b85001 Mon Sep 17 00:00:00 2001 From: m1k1o Date: Mon, 6 Apr 2020 11:55:08 +0200 Subject: [PATCH 1/7] language minor bugs --- client/src/neko/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/neko/index.ts b/client/src/neko/index.ts index 571ab1cf..f2fca887 100644 --- a/client/src/neko/index.ts +++ b/client/src/neko/index.ts @@ -54,7 +54,7 @@ export class NekoClient extends BaseClient implements EventEmitter { this.disconnect() this.cleanup() this.$vue.$swal({ - title: this.$vue.$t('notifications.logged_out', { name: 'You' }), + title: this.$vue.$t('notifications.logged_out', { name: this.$vue.$t('you') }), icon: 'info', confirmButtonText: this.$vue.$t('ok') as string, }) @@ -207,7 +207,7 @@ export class NekoClient extends BaseClient implements EventEmitter { this.$accessor.chat.newMessage({ id: member.id, - content: this.$vue.$t('notifications.controls_released') as string, + content: this.$vue.$t('notifications.controls_released', { name: '' }) as string, type: 'event', created: new Date(), }) From 96ea219340d7858c3217823e2c734912ab5131d5 Mon Sep 17 00:00:00 2001 From: m1k1o Date: Mon, 6 Apr 2020 12:22:36 +0200 Subject: [PATCH 2/7] context added translations for modals --- client/src/components/context.vue | 28 ++++++++++++++++------------ client/src/locale/en-us.ts | 12 ++++++++++++ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/client/src/components/context.vue b/client/src/components/context.vue index af4a4476..11cf348f 100644 --- a/client/src/components/context.vue +++ b/client/src/components/context.vue @@ -165,11 +165,12 @@ kick(member: Member) { this.$swal({ - title: `Kick ${member.displayname}?`, - text: `Are you sure you want to kick ${member.displayname}?`, + title: this.$t('context.confirm.kick_title', { name: member.displayname }), + text: this.$t('context.confirm.kick_text', { name: member.displayname }), icon: 'warning', showCancelButton: true, - confirmButtonText: 'Yes', + confirmButtonText: this.$t('context.confirm.button_yes'), + cancelButtonText: this.$t('context.confirm.button_cancel'), }).then(({ value }) => { if (value) { this.$accessor.user.kick(member) @@ -179,11 +180,12 @@ ban(member: Member) { this.$swal({ - title: `Ban ${member.displayname}?`, - text: `Are you sure you want to ban ${member.displayname}? You will need to restart the server to undo this.`, + title: this.$t('context.confirm.ban_title', { name: member.displayname }), + text: this.$t('context.confirm.ban_text', { name: member.displayname }), icon: 'warning', showCancelButton: true, - confirmButtonText: 'Yes', + confirmButtonText: this.$t('context.confirm.button_yes'), + cancelButtonText: this.$t('context.confirm.button_cancel'), }).then(({ value }) => { if (value) { this.$accessor.user.ban(member) @@ -193,11 +195,12 @@ mute(member: Member) { this.$swal({ - title: `Mute ${member.displayname}?`, - text: `Are you sure you want to mute ${member.displayname}?`, + title: this.$t('context.confirm.mute_title', { name: member.displayname }), + text: this.$t('context.confirm.mute_text', { name: member.displayname }), icon: 'warning', showCancelButton: true, - confirmButtonText: 'Yes', + confirmButtonText: this.$t('context.confirm.button_yes'), + cancelButtonText: this.$t('context.confirm.button_cancel'), }).then(({ value }) => { if (value) { this.$accessor.user.mute(member) @@ -207,11 +210,12 @@ unmute(member: Member) { this.$swal({ - title: `Unmute ${member.displayname}?`, - text: `Are you sure you want to unmute ${member.displayname}?`, + title: this.$t('context.confirm.unmute_title', { name: member.displayname }), + text: this.$t('context.confirm.unmute_text', { name: member.displayname }), icon: 'warning', showCancelButton: true, - confirmButtonText: 'Yes', + confirmButtonText: this.$t('context.confirm.button_yes'), + cancelButtonText: this.$t('context.confirm.button_cancel'), }).then(({ value }) => { if (value) { this.$accessor.user.unmute(member) diff --git a/client/src/locale/en-us.ts b/client/src/locale/en-us.ts index 8fd05a6d..cc171491 100644 --- a/client/src/locale/en-us.ts +++ b/client/src/locale/en-us.ts @@ -25,6 +25,18 @@ export const context = { give: 'Give Controls', kick: 'Kick', ban: 'Ban IP', + confirm: { + kick_title: 'Kick {name}?', + kick_text: 'Are you sure you want to kick {name}?', + ban_title: 'Ban {name}?', + ban_text: 'Are you sure you want to ban {name}? You will need to restart the server to undo this.', + mute_title: 'Mute {name}?', + mute_text: 'Are you sure you want to mute {name}?', + unmute_title: 'Unmute {name}?', + unmute_text: 'Are you sure you want to unmute {name}?', + button_yes: 'Yes', + button_cancel: 'Cancel', + } } export const controls = { From 180bfc250f868da870c1ca8f9de6bc5c879625cd Mon Sep 17 00:00:00 2001 From: m1k1o Date: Mon, 6 Apr 2020 12:25:07 +0200 Subject: [PATCH 3/7] send_a_message translate --- client/src/components/chat.vue | 2 +- client/src/locale/en-us.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/components/chat.vue b/client/src/components/chat.vue index 0b4e8ebb..619909af 100644 --- a/client/src/components/chat.vue +++ b/client/src/components/chat.vue @@ -35,7 +35,7 @@
-