From 4a5d1c29ec4843ca42d4758cff40e05d203fde3b Mon Sep 17 00:00:00 2001 From: reenphygeorge Date: Mon, 9 Oct 2023 13:50:47 +0530 Subject: [PATCH] fix(nc-gui): fix i18n for surveys and dlgs --- .../components/workspace/InviteCollabDlg.vue | 12 ++++++---- .../components/workspace/MoveProjectDlg.vue | 3 +-- packages/nc-gui/lang/en.json | 17 ++++++++++---- packages/nc-gui/layouts/base.vue | 6 ++--- packages/nc-gui/layouts/new.vue | 6 ++--- .../pages/index/[typeOrId]/form/[viewId].vue | 3 +-- .../[typeOrId]/form/[viewId]/index/survey.vue | 23 ++++++++++--------- 7 files changed, 41 insertions(+), 29 deletions(-) diff --git a/packages/nc-gui/components/workspace/InviteCollabDlg.vue b/packages/nc-gui/components/workspace/InviteCollabDlg.vue index be0b23e1bb..ba90013749 100644 --- a/packages/nc-gui/components/workspace/InviteCollabDlg.vue +++ b/packages/nc-gui/components/workspace/InviteCollabDlg.vue @@ -42,12 +42,18 @@ const validators = computed(() => { { validator: (rule: any, value: string, callback: (errMsg?: string) => void) => { if (!value || value.length === 0) { - callback('Email is required') + callback(t('error.signUpRules.emailReqd')) return } const invalidEmails = (value || '').split(/\s*,\s*/).filter((e: string) => !validateEmail(e)) if (invalidEmails.length > 0) { - callback(`${invalidEmails.length > 1 ? ' Invalid emails:' : 'Invalid email:'} ${invalidEmails.join(', ')} `) + callback( + `${ + invalidEmails.length > 1 + ? `${t('error.signUpRules.invalidEmails')}: ` + : `${t('error.signUpRules.invalidEmails')}: ` + } ${invalidEmails.join(', ')} `, + ) } else { callback() } @@ -119,8 +125,6 @@ const emailInput = ref((el) => { wrap-class-name="nc-modal-invite-user" @cancel="emit('closed')" > - -
{{ $t('activity.inviteUser') }} diff --git a/packages/nc-gui/components/workspace/MoveProjectDlg.vue b/packages/nc-gui/components/workspace/MoveProjectDlg.vue index c4d2eea619..050aec3ef5 100644 --- a/packages/nc-gui/components/workspace/MoveProjectDlg.vue +++ b/packages/nc-gui/components/workspace/MoveProjectDlg.vue @@ -55,8 +55,7 @@ const ownedWorkspaces = computed(() => {
{{ $t('activity.moveProject') }}
- -
Workspace
+
{{ $t('objects.workspace') }}
{{ workspace.title }} diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index 2c9ce8fb74..41efc8dedc 100644 --- a/packages/nc-gui/lang/en.json +++ b/packages/nc-gui/lang/en.json @@ -179,7 +179,10 @@ "join": "Join", "options": "Options", "primaryValue": "Primary Value", - "useSurveyMode": "Use Survey Mode" + "useSurveyMode": "Use Survey Mode", + "shift": "Shift", + "enter": "Enter", + "seconds": "Seconds" }, "objects": { "workspace": "Workspace", @@ -602,8 +605,10 @@ "zoomInToViewColumns": "Zoom in to view columns", "embedInSite": "Embed this view in your site", "titleRequired": "title is required.", - "sourceNameRequired":"Source name is required", - "changeWsName":"Change Workspace Name" + "sourceNameRequired": "Source name is required", + "changeWsName": "Change Workspace Name", + "pressEnter": "Press Enter", + "newFormLoaded": "New form will be loaded after" }, "activity": { "onCondition": "On Condition", @@ -1152,7 +1157,11 @@ "wsNameMaxLength":"Workspace name must be at most 50 characters long", "wsDeleteDlg": "Delete this workspace and all it’s contents.", "userConfirmation": "I understand that this action is irreversible", - "pageNotFound":"Page Not Found" + "pageNotFound":"Page Not Found", + "makeLineBreak":"to make a line break", + "goToNext": "Go to next", + "thankyou":"Thank you!", + "submittedFormData": "You have successfully submitted the form data." }, "error": { "nameRequired": "Name Required", diff --git a/packages/nc-gui/layouts/base.vue b/packages/nc-gui/layouts/base.vue index 5e7503807b..01a59b354c 100644 --- a/packages/nc-gui/layouts/base.vue +++ b/packages/nc-gui/layouts/base.vue @@ -69,7 +69,7 @@ hooks.hook('page:finish', () => { - +
@@ -106,7 +106,7 @@ hooks.hook('page:finish', () => { >   - <!– todo: i18n –> + <!– –> Account management @@ -129,7 +129,7 @@ hooks.hook('page:finish', () => { - + diff --git a/packages/nc-gui/layouts/new.vue b/packages/nc-gui/layouts/new.vue index ad4b97efc4..acc8e557db 100644 --- a/packages/nc-gui/layouts/new.vue +++ b/packages/nc-gui/layouts/new.vue @@ -58,7 +58,7 @@ export default {
-
@@ -92,7 +92,7 @@ export default {  
-
Account
+
{{ $t('labels.account') }}
{{ email }}
@@ -107,7 +107,7 @@ export default { >   - <!– todo: i18n –> + <!– –> Account management diff --git a/packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue b/packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue index 876d7f4621..e3c6737584 100644 --- a/packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue +++ b/packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue @@ -12,12 +12,12 @@ import { provide, reactive, ref, + useI18n, useProvideSharedFormStore, useProvideSmartsheetStore, useRoute, useSidebar, watch, - useI18n } from '#imports' definePageMeta({ @@ -77,7 +77,6 @@ watch( @close="passwordDlg = false" >
-

{{ $t('msg.thisSharedViewIsProtected') }}

diff --git a/packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/survey.vue b/packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/survey.vue index 44a5fac20d..92a81f60ed 100644 --- a/packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/survey.vue +++ b/packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/survey.vue @@ -318,8 +318,8 @@ onMounted(() => {
- Shift + Enter - to make a line break + {{ $t('general.shift') }} + {{ $t('general.enter') }} + {{ $t('msg.makeLineBreak') }}
@@ -345,7 +345,9 @@ onMounted(() => {
@@ -361,7 +363,7 @@ onMounted(() => { @click="goNext()" > - Ok + {{ $t('general.ok') }} @@ -375,9 +377,8 @@ onMounted(() => { -
@@ -392,21 +393,21 @@ onMounted(() => {

- New form will be loaded after {{ secondsRemain }} seconds + {{ $t('labels.newFormLoaded') }} {{ secondsRemain }} {{ $t('general.seconds') }}

- Submit Another Form + {{ $t('activity.submitAnotherForm') }}
@@ -448,7 +449,7 @@ onMounted(() => {