From bf8942a61c42b14c289fce11c6f858f8a25fb323 Mon Sep 17 00:00:00 2001
From: Raju Udava <86527202+dstala@users.noreply.github.com>
Date: Thu, 24 Feb 2022 16:28:42 +0530
Subject: [PATCH 1/2] refactor: i18n translations
Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
---
.../nc-gui/components/ProjectTreeView.vue | 8 ++---
packages/nc-gui/components/auth/apiTokens.vue | 17 ++++++----
packages/nc-gui/components/auth/roles.vue | 5 +--
.../nc-gui/components/import/excelImport.vue | 33 ++++++++++++-------
.../nc-gui/components/project/appStore.vue | 2 +-
.../nc-gui/components/project/auditTab.vue | 14 ++++++--
.../components/project/auditTab/audit.vue | 15 ++++++---
.../spreadsheet/components/editColumn.vue | 16 +++++----
.../components/editVirtualColumn.vue | 2 +-
.../nc-gui/components/templates/editor.vue | 10 +++---
packages/nc-gui/components/utils/language.vue | 5 ++-
11 files changed, 83 insertions(+), 44 deletions(-)
diff --git a/packages/nc-gui/components/ProjectTreeView.vue b/packages/nc-gui/components/ProjectTreeView.vue
index d207a8b22d..c4911cbbb5 100644
--- a/packages/nc-gui/components/ProjectTreeView.vue
+++ b/packages/nc-gui/components/ProjectTreeView.vue
@@ -943,7 +943,7 @@ export default {
this.changeActiveTab(tabIndex);
} else {
console.log('add app store tab');
- let item = {name: 'App Store', key: `appStore`};
+ let item = {name: `${this.$t('title.appStore')} `, key: `appStore`};
item._nodes = {env: '_noco'};
item._nodes.type = 'appStore';
this.$store.dispatch('tabs/ActAddTab', item);
@@ -979,7 +979,7 @@ export default {
this.changeActiveTab(tabIndex);
} else {
console.log('add roles tab');
- let item = {name: 'Team & Auth ', key: `roles`};
+ let item = {name: `${this.$t('title.team&auth')} `, key: `roles`};
item._nodes = {env: '_noco'};
item._nodes.type = 'roles';
this.$store.dispatch('tabs/ActAddTab', item);
@@ -991,7 +991,7 @@ export default {
this.changeActiveTab(tabIndex);
} else {
console.log('add acl tab');
- let item = {name: 'Meta Management', key: `disableOrEnableModel`};
+ let item = {name: `${this.$t('title.metaMgmt')}`, key: `disableOrEnableModel`};
item._nodes = {env: '_noco'};
item._nodes.type = 'disableOrEnableModel';
this.$store.dispatch('tabs/ActAddTab', item);
@@ -1002,7 +1002,7 @@ export default {
this.changeActiveTab(tabIndex);
} else {
console.log('add audit tab');
- let item = {name: 'Audit', key: `migrationsDir`};
+ let item = {name: `${this.$t('title.audit')}`, key: `migrationsDir`};
item._nodes = {
env: '_noco',
dbAlias: 'db'
diff --git a/packages/nc-gui/components/auth/apiTokens.vue b/packages/nc-gui/components/auth/apiTokens.vue
index 2dc1145fc6..acd04123da 100644
--- a/packages/nc-gui/components/auth/apiTokens.vue
+++ b/packages/nc-gui/components/auth/apiTokens.vue
@@ -32,7 +32,8 @@
mdi-plus
- New Token
+
+ {{ $t('activity.newToken') }}
@@ -41,13 +42,16 @@
- Description
+
+ {{ $t('labels.description') }}
|
- Token
+
+ {{ $t('labels.token') }}
|
- Actions
+
+ {{ $t('labels.action') }}
|
@@ -90,7 +94,8 @@
mdi-plus
- Add New Token
+
+ {{ $t('activity.newToken') }}
|
@@ -110,7 +115,7 @@
v-model="tokenObj.description"
filled
dense
- label="Description"
+ :label="$t('labels.description')"
/>
diff --git a/packages/nc-gui/components/auth/roles.vue b/packages/nc-gui/components/auth/roles.vue
index 21f49214b9..c2c7ed2394 100644
--- a/packages/nc-gui/components/auth/roles.vue
+++ b/packages/nc-gui/components/auth/roles.vue
@@ -36,7 +36,7 @@
refresh
- {{ $t('general.reload')}}
+ {{ $t('general.reload') }}
mdi-plus
- New Role
+
+ {{ $t('activity.newRole') }}
- Select File to Upload
+
+ {{ $t('msg.info.upload') }}
- or drag and drop file
+
+ {{ $t('msg.info.upload_sub') }}
- Supported: .xls, .xlsx, .xlsm, .ods, .ots
+
+ {{ $t('msg.info.excelSupport') }}
@@ -52,18 +55,20 @@
+
- Load
+
+ {{ $t('general.load') }}
@@ -75,20 +80,21 @@
- {{ showMore ? 'Hide' : 'Show' }} more
+
+ {{ showMore ? $t('general.hideAll') : $t('general.showMore') }}
mdi-menu-{{ showMore ? 'up' : 'down' }}
-
+
@@ -118,7 +124,8 @@
mdi-file-excel-outline
- Import
+
+ {{ $t('activity.import') }}
Create template from Excel
@@ -128,8 +135,9 @@
+
- Importing : {{ filename }}
+ {{ $t('activity.importExcel') }} : {{ filename }}
@@ -145,7 +153,8 @@
create-rest-text="Import as REST Project"
@success="$emit('success'),templateEditorModal = false"
>
- Import Excel
+
+ {{ $t('activity.importExcel') }}
diff --git a/packages/nc-gui/components/project/appStore.vue b/packages/nc-gui/components/project/appStore.vue
index e79d0a814f..ed9e70492e 100644
--- a/packages/nc-gui/components/project/appStore.vue
+++ b/packages/nc-gui/components/project/appStore.vue
@@ -133,7 +133,7 @@
v-model="query"
dense
hide-details
- placeholder="Search apps"
+ :placeholder="$t('placeholder.searchApps')"
color="primary"
class="search-field caption"
>
diff --git a/packages/nc-gui/components/project/auditTab.vue b/packages/nc-gui/components/project/auditTab.vue
index 72c30cc72f..0f60d7b0ee 100644
--- a/packages/nc-gui/components/project/auditTab.vue
+++ b/packages/nc-gui/components/project/auditTab.vue
@@ -1,11 +1,21 @@
- Audit Logs
+
+
+
+ {{ $t('title.auditLogs') }}
+
+
- SQL Migrations
+
+
+
+ {{ $t('title.sqlMigrations') }}
+
+
diff --git a/packages/nc-gui/components/project/auditTab/audit.vue b/packages/nc-gui/components/project/auditTab/audit.vue
index b49b6f72b0..35a748d271 100644
--- a/packages/nc-gui/components/project/auditTab/audit.vue
+++ b/packages/nc-gui/components/project/auditTab/audit.vue
@@ -20,20 +20,25 @@
- Operation Type
+
+ {{ $t('labels.operationType') }}
|
- Operation Sub Type
+
+ {{ $t('labels.operationSubType') }}
|
- Description
+
+ {{ $t('labels.description') }}
|
- User
+
+ {{ $t('objects.user') }}
|
- Created
+
+ {{ $t('labels.created') }}
|
diff --git a/packages/nc-gui/components/project/spreadsheet/components/editColumn.vue b/packages/nc-gui/components/project/spreadsheet/components/editColumn.vue
index 7cbc7253ae..2d01264cc4 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/editColumn.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/editColumn.vue
@@ -10,6 +10,7 @@
+
+
- {{ advanceOptions ? 'Hide' : 'Show more' }} options
+ {{ advanceOptions ? $t('general.hideAll') : $t('general.showMore') }}
mdi-{{ advanceOptions ? 'minus' : 'plus' }}-circle-outline
@@ -301,11 +303,12 @@
+
+
- {{ project.tables.length }} sheet{{ project.tables.length > 1 ? 's' :'' }} are available for import
+ {{ project.tables.length }} sheet{{ project.tables.length > 1 ? 's' :'' }} available for import
- Column Name
+
+ {{ $t('labels.columnName') }}
|
- Column Type
+
+ {{ $t('labels.columnType') }}
|
|
@@ -193,7 +195,7 @@
outlined
dense
class="caption"
- placeholder="Column name"
+ :placeholder="$t('labels.columnName')"
hide-details="auto"
:rules="[
v => !!v || 'Column name required',
diff --git a/packages/nc-gui/components/utils/language.vue b/packages/nc-gui/components/utils/language.vue
index 6592af64a9..e8b3eb35f2 100644
--- a/packages/nc-gui/components/utils/language.vue
+++ b/packages/nc-gui/components/utils/language.vue
@@ -25,7 +25,10 @@
- Help translate
+
+
+ {{ $t('activity.translate') }}
+
From 40ed4c36974df3d7d108303bc5031df54ae7e15c Mon Sep 17 00:00:00 2001
From: Raju Udava <86527202+dstala@users.noreply.github.com>
Date: Thu, 24 Feb 2022 17:10:47 +0530
Subject: [PATCH 2/2] test: cypress corrections for i18n changes
Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
---
.../integration/common/7a_create_project_from_excel.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/cypress/integration/common/7a_create_project_from_excel.js b/scripts/cypress/integration/common/7a_create_project_from_excel.js
index a3e9dbfa05..9e08ab5358 100644
--- a/scripts/cypress/integration/common/7a_create_project_from_excel.js
+++ b/scripts/cypress/integration/common/7a_create_project_from_excel.js
@@ -138,7 +138,7 @@ export const genTest = (apiType, dbType) => {
for (let j = 1; j < row.length; j++) {
// column name to match input in excel
cy.wrap(row[j])
- .find('[placeholder="Column name"]')
+ .find('[placeholder="Column Name"]')
.then((obj) => {
cy.log(obj[0].value);
expect(obj[0].value).to.equal(
@@ -269,7 +269,7 @@ export const genTest = (apiType, dbType) => {
) {
// column name to match input in excel
cy.wrap(row[j])
- .find('[placeholder="Column name"]')
+ .find('[placeholder="Column Name"]')
.then((obj) => {
cy.log(obj[0].value);
expect(obj[0].value).to.equal(