From 6892c75c31dd4be554d5978078061974e030cd90 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Sun, 30 Jan 2022 00:15:21 +0530 Subject: [PATCH] refactor: i18n re-org phase-1 Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../nc-gui/components/ProjectTreeView.vue | 24 +- packages/nc-gui/components/authTab.vue | 6 +- .../nc-gui/components/createOrEditProject.vue | 110 +-- packages/nc-gui/components/notification.vue | 4 +- .../components/project/settings/xcMeta.vue | 22 +- .../project/spreadsheet/components/extras.vue | 16 +- .../components/spreadsheetNavDrawer.vue | 52 +- packages/nc-gui/lang/da.json | 399 ++++------ packages/nc-gui/lang/de.json | 399 ++++------ packages/nc-gui/lang/en.json | 719 ++++++++++++------ packages/nc-gui/lang/es.json | 399 ++++------ packages/nc-gui/lang/fi.json | 399 ++++------ packages/nc-gui/lang/fr.json | 399 ++++------ packages/nc-gui/lang/hr.json | 399 ++++------ packages/nc-gui/lang/id.json | 399 ++++------ packages/nc-gui/lang/it_IT.json | 399 ++++------ packages/nc-gui/lang/iw.json | 399 ++++------ packages/nc-gui/lang/ja.json | 399 ++++------ packages/nc-gui/lang/ko.json | 399 ++++------ packages/nc-gui/lang/nl.json | 399 ++++------ packages/nc-gui/lang/no.json | 399 ++++------ packages/nc-gui/lang/pl.json | 399 ++++------ packages/nc-gui/lang/pt.json | 399 ++++------ packages/nc-gui/lang/pt_BR.json | 399 ++++------ packages/nc-gui/lang/ru.json | 399 ++++------ packages/nc-gui/lang/sl.json | 399 ++++------ packages/nc-gui/lang/sv.json | 399 ++++------ packages/nc-gui/lang/th.json | 399 ++++------ packages/nc-gui/lang/uk.json | 399 ++++------ packages/nc-gui/lang/vi.json | 399 ++++------ packages/nc-gui/lang/zh_CN.json | 399 ++++------ packages/nc-gui/lang/zh_HK.json | 399 ++++------ packages/nc-gui/lang/zh_TW.json | 399 ++++------ packages/nc-gui/pages/projects/index.vue | 64 +- .../pages/user/authentication/signin.vue | 30 +- .../user/authentication/signup/_token.vue | 12 +- .../user/authentication/signup/index.vue | 10 +- .../nc-gui/pages/user/password/forgot.vue | 10 +- .../common/6d_language_validation.js | 110 +-- 39 files changed, 4798 insertions(+), 6366 deletions(-) diff --git a/packages/nc-gui/components/ProjectTreeView.vue b/packages/nc-gui/components/ProjectTreeView.vue index 3c1d6040ad..f0ca6bc702 100644 --- a/packages/nc-gui/components/ProjectTreeView.vue +++ b/packages/nc-gui/components/ProjectTreeView.vue @@ -397,7 +397,7 @@ - {{ $t('treeview.settings.title') }} + {{ $t('activity.settings') }} - {{ $t('treeview.settings.tooltip') }} + {{ $t('msg.info.onlyCreator') }} @@ -430,13 +430,13 @@ {{ - $t('treeview.app_store') + $t('title.appStore') }} - {{ $t('treeview.app_store') }} + {{ $t('title.appStore') }} @@ -450,13 +450,13 @@ {{ - $t('treeview.team_n_auth.title') + $t('title.team&auth') }} - {{ $t('treeview.team_n_auth.tooltip') }} + {{ $t('title.rolesUserMgmt') }} - {{ $t('treeview.project_metadata.tooltip') }} + {{ $t('title.metaMgmt') }} @@ -489,13 +489,13 @@ {{ - $t('treeview.audit.title') + $t('title.audit') }} - {{ $t('treeview.audit.tooltip') }} + {{ $t('title.auditLogs') }} @@ -554,7 +554,7 @@ - {{ $t('treeview.preview_as') }} + {{ $t('activity.previewAs') }} mdi-drama-masks @@ -597,7 +597,7 @@ mdi-close - {{ $t('treeview.reset_review') }} + {{ $t('activity.resetReview') }} diff --git a/packages/nc-gui/components/authTab.vue b/packages/nc-gui/components/authTab.vue index bc1a4bb4ae..ea140f02ff 100644 --- a/packages/nc-gui/components/authTab.vue +++ b/packages/nc-gui/components/authTab.vue @@ -5,7 +5,7 @@ - {{ $t('management.tabs.user') }} + {{ $t('title.userMgmt') }} @@ -16,7 +16,7 @@ - {{ $t('management.tabs.api') }} + {{ $t('title.apiTokenMgmt') }} @@ -26,7 +26,7 @@ - {{ $t('management.tabs.roles') }} + {{ $t('title.rolesMgmt') }} diff --git a/packages/nc-gui/components/createOrEditProject.vue b/packages/nc-gui/components/createOrEditProject.vue index f491e19ac2..48104735a5 100644 --- a/packages/nc-gui/components/createOrEditProject.vue +++ b/packages/nc-gui/components/createOrEditProject.vue @@ -35,20 +35,20 @@ > - {{ $t('projects.ext_db.title.edit') }} + {{ $t('activity.editProject') }} - {{ $t('projects.ext_db.title.create') }} + {{ $t('activity.createProject') }} - {{ $t('projects.ext_db.button.cancel') }} + {{ $t('general.cancel') }} - {{ $t('projects.ext_db.button.update_and_restart') }} + {{ $t('tooltip.updateRestart') }} - {{ $t('projects.ext_db.button.save_project') }} + {{ $t('activity.saveProject') }} @@ -169,7 +169,7 @@ - + - {{ $t('projects.ext_db.credentials.title') }} + {{ $t('title.dbCredentials') }}

@@ -454,7 +454,7 @@ v-ge="['project', 'env-db-host']" class="body-2" :rules="form.requiredRule" - :label="$t('projects.ext_db.credentials.host_address')" + :label="$t('labels.hostAddress')" /> @@ -463,7 +463,7 @@ v-model="db.connection.port" v-ge="['project', 'env-db-port']" class="body-2" - :label="$t('projects.ext_db.credentials.port')" + :label="$t('labels.port')" :rules="form.portValidationRule" /> @@ -474,7 +474,7 @@ v-ge="['project', 'env-db-user']" class="body-2" :rules="form.requiredRule" - :label="$t('projects.ext_db.credentials.username')" + :label="$t('labels.username')" /> @@ -489,7 +489,7 @@ ? 'text' : 'password' " - :label="$t('projects.ext_db.credentials.password')" + :label="$t('labels.password')" @dblclick="enableDbEdit++" > - {{ $t('nav_drawer.virtual_views.grid.create') }} + {{ $t('msg.info.addView.grid') }} - {{ $t('nav_drawer.virtual_views.gallery.create') }} + {{ $t('msg.info.addView.gallery') }} - {{ $t('nav_drawer.virtual_views.form.title') }} + {{ $t('objects.viewType.form') }} @@ -299,7 +299,7 @@ - {{ $t('nav_drawer.virtual_views.form.create') }} + {{ $t('msg.info.addView.form') }} @@ -360,7 +360,7 @@ <!– Only visible to Creator –> - {{ $t('nav_drawer.virtual_views.caption') }} + {{ $t('msg.info.onlyCreator') }} @@ -385,7 +385,7 @@ <!– Share View –> - {{ $t('nav_drawer.advanced.title1') }} + {{ $t('activity.shareView') }} @@ -399,7 +399,7 @@ <!– Views List –> - {{ $t('nav_drawer.advanced.views_list') }} + {{ $t('activity.ListView') }} @@ -414,11 +414,11 @@ <!– mdi-content-copy–> <!– –> <!– <!– Copy API URL –>–> - <!– {{ $t('nav_drawer.advanced.views_list') }}–> + <!– {{ $t('activity.ListView') }}–> <!– –> <!– –> <!– <!– Copy API URL –>–> - <!– {{ $t('nav_drawer.advanced.views_list') }}–> + <!– {{ $t('activity.ListView') }}–> <!– –> {{ - $t('projects.create_new_project_button.subtext_2_tooltip') + $t('tooltip.extDB') }} @@ -219,7 +219,7 @@ @@ -239,7 +239,7 @@ @@ -256,7 +256,7 @@ @click="onCreateProject('xcdb')" > - {{ $t('projects.create_new_project_button.text') }} + {{ $t('title.newProj') }} @@ -313,8 +313,8 @@ small :tooltip=" props.item.projectType === 'graphql' - ? $t('projects.project_api_type_tooltip_graphql') - : $t('projects.project_api_type_tooltip_rest') + ? $t('tooltip.apiGQL') + : $t('tooltip.apiRest') " icon.class="mr-2" :color=" @@ -360,7 +360,7 @@ {{ - $t('projects.import_metadata') + $t('activity.importMetadata') }} @@ -453,7 +453,7 @@ {{ - $t('projects.export_metadata') + $t('activity.exportMetadata') }} @@ -469,7 +469,7 @@ {{ - $t('projects.clear_metadata') + $t('activity.clearMetadata') }} @@ -488,7 +488,7 @@ color="error" icon="warning" > - {{ $t('projects.search.your_search_found_no_results', {search}) }} + {{ $t('msg.error.searchProject', {search}) }} @@ -511,7 +511,7 @@ icon="mdi-information-outline" > - {{ $t('projects.project_empty_message') }} + {{ $t('msg.info.projectEmptyMessage') }} @@ -538,7 +538,7 @@ " > - +

  - {{ $t('projects.create_new_project_button.text') }} + {{ $t('title.newProj') }} @@ -609,12 +609,12 @@ - {{ $t('projects.show_community_star') }} + {{ $t('labels.community.starUs1') }} mdi-star-outline - {{ $t('projects.show_community_us_on_Github') }} + {{ $t('labels.community.starUs2') }} {{ - $t('projects.show_community_book_a_free_demo') + $t('labels.community.bookDemo') }} @@ -651,7 +651,7 @@ {{ - $t('projects.show_community_get_your_questions_answered') + $t('labels.community.getAnswered') }} @@ -670,7 +670,7 @@ {{ - $t('projects.show_community_follow_nocodb') + $t('labels.community.followNocodb') }} @@ -714,7 +714,7 @@ Built with Vue JS - + diff --git a/packages/nc-gui/pages/user/authentication/signin.vue b/packages/nc-gui/pages/user/authentication/signin.vue index 79f28f45ff..c6013faeb2 100644 --- a/packages/nc-gui/pages/user/authentication/signin.vue +++ b/packages/nc-gui/pages/user/authentication/signin.vue @@ -25,7 +25,7 @@

- {{ $t('signin.title') }} + {{ $t('general.signIn') }}

@@ -43,7 +43,7 @@ @@ -52,7 +52,7 @@ {{ - $t('signin.forget_password') + $t('msg.info.signUp.forgotPassword') }}

@@ -86,7 +86,7 @@ :disabled="false" @click="MtdOnSignin" > - {{ $t('signin.title') }} + {{ $t('general.signIn') }}
@@ -94,13 +94,13 @@

- {{ $t('signin.dont_ve_an_account') }} + {{ $t('msg.info.signUp.dontHaveAccount') }} - {{ $t('signin.sign_up') }} + {{ $t('general.signUp') }}

@@ -237,17 +237,17 @@ export default { formRules: { email: [ // E-mail is required - v => !!v || this.$t('signin.form.rules.email_is_reqd'), + v => !!v || this.$t('msg.error.signUpRules.emailReqd'), // E-mail must be valid v => isEmail(v) || - this.$t('signin.form.rules.email_must_be_valid') + this.$t('msg.error.signUpRules.emailInvalid') ], password: [ // Password is required - v => !!v || this.$t('signin.form.rules.passwd_required'), + v => !!v || this.$t('msg.error.signUpRules.passwdRequired'), // You password must be atleast 8 characters v => - (v && v.length >= 8) || this.$t('signin.form.rules.passwd_must_be_8_chars') + (v && v.length >= 8) || this.$t('msg.error.signUpRules.passwdLength') ] }, formUtil: { @@ -267,12 +267,12 @@ export default { }, head() { return { - title: this.$t('signin.head.title'), + title: this.$t('title.headLogin'), meta: [ { - hid: this.$t('signin.head.meta.hid'), - name: this.$t('signin.head.meta.name'), - content: this.$t('signin.head.meta.content') + hid: this.$t('msg.info.loginMsg'), + name: this.$t('msg.info.loginMsg'), + content: this.$t('msg.info.loginMsg') } ] } diff --git a/packages/nc-gui/pages/user/authentication/signup/_token.vue b/packages/nc-gui/pages/user/authentication/signup/_token.vue index 067101a8c5..51ca06612b 100644 --- a/packages/nc-gui/pages/user/authentication/signup/_token.vue +++ b/packages/nc-gui/pages/user/authentication/signup/_token.vue @@ -23,7 +23,7 @@

- {{ $t('signup.title') }} + {{ $t('general.signUp') }} {{ $route.query.redirect_to === '/referral' ? '& REFER' : '' }} {{ $route.query.redirect_to === '/pricing' ? '& BUY' : '' }}

@@ -39,7 +39,7 @@ @@ -47,7 +47,7 @@ -   {{ $t('signup.title') }}   +   {{ $t('general.signUp') }}   Subscribe to our weekly newsletter

- {{ $t('signup.already_ve_an_account') }} + {{ $t('msg.info.signUp.alreadyHaveAccount') }} - {{ $t('signin.title') }} + {{ $t('general.signIn') }}

diff --git a/packages/nc-gui/pages/user/authentication/signup/index.vue b/packages/nc-gui/pages/user/authentication/signup/index.vue index 59728a9641..10eef9be44 100644 --- a/packages/nc-gui/pages/user/authentication/signup/index.vue +++ b/packages/nc-gui/pages/user/authentication/signup/index.vue @@ -39,7 +39,7 @@ @@ -47,7 +47,7 @@ -   {{ $t('signup.title') }}   +   {{ $t('general.signUp') }}  
@@ -84,9 +84,9 @@

- {{ $t('signup.already_ve_an_account') }} + {{ $t('msg.info.signUp.alreadyHaveAccount') }} - {{ $t('signin.title') }} + {{ $t('general.signIn') }}

diff --git a/packages/nc-gui/pages/user/password/forgot.vue b/packages/nc-gui/pages/user/password/forgot.vue index b444ab43a7..a8e4f70608 100644 --- a/packages/nc-gui/pages/user/password/forgot.vue +++ b/packages/nc-gui/pages/user/password/forgot.vue @@ -5,17 +5,17 @@

- {{ $t('signin.password.recovery.success') }} + {{ $t('msg.info.passwordRecovery.success') }}

-

{{ $t('signin.password.recovery.title') }}

+

{{ $t('title.resetPassword') }}


-

{{ $t('signin.password.recovery.message_1') }}

-

{{ $t('signin.password.recovery.message_2') }}

+

{{ $t('msg.info.passwordRecovery.message_1') }}

+

{{ $t('msg.info.passwordRecovery.message_2') }}

@@ -42,7 +42,7 @@ :disabled="!valid" @click="resetPasswordHandle" > - {{ $t('signin.password.recovery.button') }} + {{ $t('activity.sendEmail') }} diff --git a/scripts/cypress/integration/common/6d_language_validation.js b/scripts/cypress/integration/common/6d_language_validation.js index 8fccfc78a6..9fd4d751f1 100644 --- a/scripts/cypress/integration/common/6d_language_validation.js +++ b/scripts/cypress/integration/common/6d_language_validation.js @@ -4,65 +4,65 @@ const { roles } = require("../../support/page_objects/projectConstants"); import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; export const genTest = (type, xcdb) => { - if (!isTestSuiteActive(type, xcdb)) return; - describe(`Language support`, () => { - before(() => { - //loginPage.signIn(roles.owner.credentials) - mainPage.toolBarTopLeft(mainPage.HOME).click(); - }); + if (!isTestSuiteActive(type, xcdb)) return; + describe(`Language support`, () => { + before(() => { + //loginPage.signIn(roles.owner.credentials) + mainPage.toolBarTopLeft(mainPage.HOME).click(); + }); - const langVerification = (idx, lang) => { - // pick json from the file specified - it(`Language verification: ${lang} > Projects page`, () => { - let json = require(`../../../../packages/nc-gui/lang/${lang}`); + const langVerification = (idx, lang) => { + // pick json from the file specified + it(`Language verification: ${lang} > Projects page`, () => { + let json = require(`../../../../packages/nc-gui/lang/${lang}`); - // toggle menu as per index - cy.get(".nc-menu-translate").click(); - cy.getActiveMenu().find(".v-list-item").eq(idx).click(); + // toggle menu as per index + cy.get(".nc-menu-translate").click(); + cy.getActiveMenu().find(".v-list-item").eq(idx).click(); - // basic validations - // 1. Page title: "My Projects" - // 2. Button: "New Project" - // 3. Search box palceholder text: "Search Projects" - // cy.get("b").contains(json.projects.my_projects).should("exist"); - cy.get(".nc-project-page-title") - .contains(json.projects.my_projects) - .should("exist"); - cy.get(".nc-new-project-menu") - .contains(json.projects.create_new_project_button.text) - .should("exist"); - cy.get(`[placeholder="${json.projects.search_project}"]`).should( - "exist" - ); - }); - }; + // basic validations + // 1. Page title: "My Projects" + // 2. Button: "New Project" + // 3. Search box palceholder text: "Search Projects" + // cy.get("b").contains(json.title.myProject).should("exist"); + cy.get(".nc-project-page-title") + .contains(json.title.myProject) + .should("exist"); + cy.get(".nc-new-project-menu") + .contains(json.title.newProj) + .should("exist"); + cy.get(`[placeholder="${json.activity.searchProject}"]`).should( + "exist" + ); + }); + }; - // Index is the order in which menu options appear - langVerification(0, "da.json"); - langVerification(1, "de.json"); - langVerification(2, "en.json"); - langVerification(3, "es.json"); - langVerification(4, "fi.json"); - langVerification(5, "fr.json"); - langVerification(6, "hr.json"); - langVerification(7, "id.json"); - langVerification(8, "it_IT.json"); - langVerification(9, "iw.json"); - langVerification(10, "ja.json"); - langVerification(11, "ko.json"); - langVerification(12, "nl.json"); - langVerification(13, "no.json"); - langVerification(14, "pt_BR.json"); - langVerification(15, "ru.json"); - langVerification(16, "sl.json"); - langVerification(17, "sv.json"); - langVerification(18, "th.json"); - langVerification(19, "uk.json"); - langVerification(20, "vi.json"); - langVerification(21, "zh_CN.json"); - langVerification(22, "zh_HK.json"); - langVerification(23, "zh_TW.json"); - }); + // Index is the order in which menu options appear + langVerification(0, "da.json"); + langVerification(1, "de.json"); + langVerification(2, "en.json"); + langVerification(3, "es.json"); + langVerification(4, "fi.json"); + langVerification(5, "fr.json"); + langVerification(6, "hr.json"); + langVerification(7, "id.json"); + langVerification(8, "it_IT.json"); + langVerification(9, "iw.json"); + langVerification(10, "ja.json"); + langVerification(11, "ko.json"); + langVerification(12, "nl.json"); + langVerification(13, "no.json"); + langVerification(14, "pt_BR.json"); + langVerification(15, "ru.json"); + langVerification(16, "sl.json"); + langVerification(17, "sv.json"); + langVerification(18, "th.json"); + langVerification(19, "uk.json"); + langVerification(20, "vi.json"); + langVerification(21, "zh_CN.json"); + langVerification(22, "zh_HK.json"); + langVerification(23, "zh_TW.json"); + }); }; /**