Browse Source

refactor: i18n translations

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/1353/head
Raju Udava 3 years ago
parent
commit
bf8942a61c
  1. 8
      packages/nc-gui/components/ProjectTreeView.vue
  2. 17
      packages/nc-gui/components/auth/apiTokens.vue
  3. 5
      packages/nc-gui/components/auth/roles.vue
  4. 33
      packages/nc-gui/components/import/excelImport.vue
  5. 2
      packages/nc-gui/components/project/appStore.vue
  6. 14
      packages/nc-gui/components/project/auditTab.vue
  7. 15
      packages/nc-gui/components/project/auditTab/audit.vue
  8. 16
      packages/nc-gui/components/project/spreadsheet/components/editColumn.vue
  9. 2
      packages/nc-gui/components/project/spreadsheet/components/editVirtualColumn.vue
  10. 10
      packages/nc-gui/components/templates/editor.vue
  11. 5
      packages/nc-gui/components/utils/language.vue

8
packages/nc-gui/components/ProjectTreeView.vue

@ -943,7 +943,7 @@ export default {
this.changeActiveTab(tabIndex); this.changeActiveTab(tabIndex);
} else { } else {
console.log('add app store tab'); 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 = {env: '_noco'};
item._nodes.type = 'appStore'; item._nodes.type = 'appStore';
this.$store.dispatch('tabs/ActAddTab', item); this.$store.dispatch('tabs/ActAddTab', item);
@ -979,7 +979,7 @@ export default {
this.changeActiveTab(tabIndex); this.changeActiveTab(tabIndex);
} else { } else {
console.log('add roles tab'); 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 = {env: '_noco'};
item._nodes.type = 'roles'; item._nodes.type = 'roles';
this.$store.dispatch('tabs/ActAddTab', item); this.$store.dispatch('tabs/ActAddTab', item);
@ -991,7 +991,7 @@ export default {
this.changeActiveTab(tabIndex); this.changeActiveTab(tabIndex);
} else { } else {
console.log('add acl tab'); 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 = {env: '_noco'};
item._nodes.type = 'disableOrEnableModel'; item._nodes.type = 'disableOrEnableModel';
this.$store.dispatch('tabs/ActAddTab', item); this.$store.dispatch('tabs/ActAddTab', item);
@ -1002,7 +1002,7 @@ export default {
this.changeActiveTab(tabIndex); this.changeActiveTab(tabIndex);
} else { } else {
console.log('add audit tab'); console.log('add audit tab');
let item = {name: 'Audit', key: `migrationsDir`}; let item = {name: `${this.$t('title.audit')}`, key: `migrationsDir`};
item._nodes = { item._nodes = {
env: '_noco', env: '_noco',
dbAlias: 'db' dbAlias: 'db'

17
packages/nc-gui/components/auth/apiTokens.vue

@ -32,7 +32,8 @@
<v-icon small left> <v-icon small left>
mdi-plus mdi-plus
</v-icon> </v-icon>
New Token <!--New Token-->
{{ $t('activity.newToken') }}
</x-btn> </x-btn>
</v-toolbar> </v-toolbar>
@ -41,13 +42,16 @@
<thead> <thead>
<tr class=""> <tr class="">
<th class="caption text-center"> <th class="caption text-center">
Description <!--Description-->
{{ $t('labels.description') }}
</th> </th>
<th class="caption text-center"> <th class="caption text-center">
Token <!--Token-->
{{ $t('labels.token') }}
</th> </th>
<th class="caption text-center"> <th class="caption text-center">
Actions <!--Actions-->
{{ $t('labels.action') }}
</th> </th>
</tr> </tr>
</thead> </thead>
@ -90,7 +94,8 @@
<td colspan="3" class="text-center"> <td colspan="3" class="text-center">
<x-btn tooltip="Generate new api token" outlined x-small color="primary" @click="newTokenDialog = true"> <x-btn tooltip="Generate new api token" outlined x-small color="primary" @click="newTokenDialog = true">
<v-icon>mdi-plus</v-icon> <v-icon>mdi-plus</v-icon>
Add New Token <!--Add New Token-->
{{ $t('activity.newToken') }}
</x-btn> </x-btn>
</td> </td>
</tr> </tr>
@ -110,7 +115,7 @@
v-model="tokenObj.description" v-model="tokenObj.description"
filled filled
dense dense
label="Description" :label="$t('labels.description')"
/> />
</v-col> </v-col>
</v-row> </v-row>

5
packages/nc-gui/components/auth/roles.vue

@ -36,7 +36,7 @@
<v-icon small left> <v-icon small left>
refresh refresh
</v-icon> </v-icon>
{{ $t('general.reload')}} {{ $t('general.reload') }}
</x-btn> </x-btn>
<x-btn <x-btn
v-ge="['roles','add new']" v-ge="['roles','add new']"
@ -51,7 +51,8 @@
<v-icon small left> <v-icon small left>
mdi-plus mdi-plus
</v-icon> </v-icon>
New Role <!--New Role-->
{{ $t('activity.newRole') }}
</x-btn> </x-btn>
<x-btn <x-btn
v-ge="['rows','save']" v-ge="['rows','save']"

33
packages/nc-gui/components/import/excelImport.vue

@ -35,14 +35,17 @@
mdi-file-plus-outline mdi-file-plus-outline
</x-icon> </x-icon>
<p class="title mb-1 mt-2"> <p class="title mb-1 mt-2">
Select File to Upload <!-- Select File to Upload-->
{{ $t('msg.info.upload') }}
</p> </p>
<p class="grey--text mb-1"> <p class="grey--text mb-1">
or drag and drop file <!-- or drag and drop file-->
{{ $t('msg.info.upload_sub') }}
</p> </p>
<p class="caption grey--text"> <p class="caption grey--text">
Supported: .xls, .xlsx, .xlsm, .ods, .ots <!-- Supported: .xls, .xlsx, .xlsm, .ods, .ots-->
{{ $t('msg.info.excelSupport') }}
</p> </p>
</div> </div>
</div> </div>
@ -52,18 +55,20 @@
<div class="pa-4 d-100 h-100"> <div class="pa-4 d-100 h-100">
<v-form ref="form" v-model="valid"> <v-form ref="form" v-model="valid">
<div class="d-flex"> <div class="d-flex">
<!--label="Enter excel file url"-->
<v-text-field <v-text-field
v-model="url" v-model="url"
hide-details="auto" hide-details="auto"
type="url" type="url"
label="Enter excel file url" :label="$t('msg.info.excelURL')"
class="caption" class="caption"
outlined outlined
dense dense
:rules="[v => !!v || 'Required']" :rules="[v => !!v || $t('general.required') ]"
/> />
<v-btn class="ml-3" color="primary" @click="loadUrl"> <v-btn class="ml-3" color="primary" @click="loadUrl">
Load <!--Load-->
{{ $t('general.load') }}
</v-btn> </v-btn>
</div> </div>
</v-form> </v-form>
@ -75,20 +80,21 @@
<div class="px-4 pb-2"> <div class="px-4 pb-2">
<div class="d-flex"> <div class="d-flex">
<v-spacer /> <v-spacer />
<span class="caption pointer grey--text" @click="showMore = !showMore">{{ showMore ? 'Hide' : 'Show' }} more <span class="caption pointer grey--text" @click="showMore = !showMore">
{{ showMore ? $t('general.hideAll') : $t('general.showMore') }}
<v-icon small color="grey lighten-1">mdi-menu-{{ showMore ? 'up' : 'down' }}</v-icon> <v-icon small color="grey lighten-1">mdi-menu-{{ showMore ? 'up' : 'down' }}</v-icon>
</span> </span>
</div> </div>
<div class="mb-2 pt-2 nc-excel-import-options" :style="{ maxHeight: showMore ? '100px' : '0'}"> <div class="mb-2 pt-2 nc-excel-import-options" :style="{ maxHeight: showMore ? '100px' : '0'}">
<p /> <p />
<!--hint="# of rows to parse to infer data type"-->
<v-text-field <v-text-field
v-model="parserConfig.maxRowsToParse" v-model="parserConfig.maxRowsToParse"
style="max-width: 250px" style="max-width: 250px"
class="caption mx-auto" class="caption mx-auto"
dense dense
persistent-hint persistent-hint
hint="# of rows to parse to infer data type" :hint="$t('msg.info.footMsg')"
outlined outlined
type="number" type="number"
/> />
@ -118,7 +124,8 @@
<v-icon small class="mr-1"> <v-icon small class="mr-1">
mdi-file-excel-outline mdi-file-excel-outline
</v-icon> </v-icon>
Import <!--Import-->
{{ $t('activity.import') }}
</v-btn> </v-btn>
</template> </template>
<span class="caption">Create template from Excel</span> <span class="caption">Create template from Excel</span>
@ -128,8 +135,9 @@
<v-card class="pa-6" min-width="500"> <v-card class="pa-6" min-width="500">
<template-editor :project-template.sync="templateData" excel-import> <template-editor :project-template.sync="templateData" excel-import>
<template #toolbar="{valid}"> <template #toolbar="{valid}">
<!--Importing-->
<h3 class="mt-2 grey--text"> <h3 class="mt-2 grey--text">
Importing : {{ filename }} {{ $t('activity.importExcel') }} : {{ filename }}
</h3> </h3>
<!-- <span class="grey&#45;&#45;text">Importing 2 sheets</span>--> <!-- <span class="grey&#45;&#45;text">Importing 2 sheets</span>-->
@ -145,7 +153,8 @@
create-rest-text="Import as REST Project" create-rest-text="Import as REST Project"
@success="$emit('success'),templateEditorModal = false" @success="$emit('success'),templateEditorModal = false"
> >
Import Excel <!--Import Excel-->
{{ $t('activity.importExcel') }}
</create-project-from-template-btn> </create-project-from-template-btn>
</template> </template>
</template-editor> </template-editor>

2
packages/nc-gui/components/project/appStore.vue

@ -133,7 +133,7 @@
v-model="query" v-model="query"
dense dense
hide-details hide-details
placeholder="Search apps" :placeholder="$t('placeholder.searchApps')"
color="primary" color="primary"
class="search-field caption" class="search-field caption"
> >

14
packages/nc-gui/components/project/auditTab.vue

@ -1,11 +1,21 @@
<template> <template>
<v-tabs class="h-100" color="x-active"> <v-tabs class="h-100" color="x-active">
<v-tab><span class="caption text-capitalize">Audit Logs</span></v-tab> <v-tab>
<span class="caption text-capitalize">
<!--Audit Logs-->
{{ $t('title.auditLogs') }}
</span>
</v-tab>
<v-tab-item class="h-100"> <v-tab-item class="h-100">
<audit :nodes="nodes" /> <audit :nodes="nodes" />
</v-tab-item> </v-tab-item>
<v-tab><span class="caption text-capitalize">SQL Migrations</span></v-tab> <v-tab>
<span class="caption text-capitalize">
<!--SQL Migrations-->
{{ $t('title.sqlMigrations') }}
</span>
</v-tab>
<v-tab-item> <v-tab-item>
<sql-log-and-output> <sql-log-and-output>
<db :nodes="nodes" /> <db :nodes="nodes" />

15
packages/nc-gui/components/project/auditTab/audit.vue

@ -20,20 +20,25 @@
<thead> <thead>
<tr> <tr>
<th class="caption"> <th class="caption">
Operation Type <!--Operation Type-->
{{ $t('labels.operationType') }}
</th> </th>
<th class="caption"> <th class="caption">
Operation Sub Type <!---->
{{ $t('labels.operationSubType') }}
</th> </th>
<th class="caption"> <th class="caption">
Description <!--Description-->
{{ $t('labels.description') }}
</th> </th>
<th class="caption"> <th class="caption">
User <!--User-->
{{ $t('objects.user') }}
</th> </th>
<!-- <th class="caption">Ip</th>--> <!-- <th class="caption">Ip</th>-->
<th class="caption"> <th class="caption">
Created <!--Created-->
{{ $t('labels.created') }}
</th> </th>
</tr> </tr>
</thead> </thead>

16
packages/nc-gui/components/project/spreadsheet/components/editColumn.vue

@ -10,6 +10,7 @@
<v-container fluid @click.stop.prevent> <v-container fluid @click.stop.prevent>
<v-row> <v-row>
<v-col cols="12" class="mt-2"> <v-col cols="12" class="mt-2">
<!--label: Column Name-->
<v-text-field <v-text-field
ref="column" ref="column"
v-model="newColumn.cn" v-model="newColumn.cn"
@ -21,7 +22,7 @@
validateColumnName validateColumnName
]" ]"
class="caption nc-column-name-input" class="caption nc-column-name-input"
label="Column name" :label="$t('labels.columnName')"
dense dense
outlined outlined
@input="newColumn.altered = newColumn.altered || 8" @input="newColumn.altered = newColumn.altered || 8"
@ -59,6 +60,7 @@
</v-col> </v-col>
<template v-else> <template v-else>
<v-col cols="12"> <v-col cols="12">
<!--label: Column Type-->
<v-autocomplete <v-autocomplete
v-model="newColumn.uidt" v-model="newColumn.uidt"
hide-details hide-details
@ -66,7 +68,7 @@
item-text="name" item-text="name"
class="caption ui-type nc-ui-dt-dropdown" class="caption ui-type nc-ui-dt-dropdown"
:class="{'primary lighten-5' : newColumn.uidt }" :class="{'primary lighten-5' : newColumn.uidt }"
label="Column type" :label="$t('labels.columnType')"
dense dense
outlined outlined
:items="uiTypes" :items="uiTypes"
@ -118,7 +120,7 @@
class="pointer grey--text text-right caption nc-more-options" class="pointer grey--text text-right caption nc-more-options"
@click="advanceOptions = !advanceOptions" @click="advanceOptions = !advanceOptions"
> >
{{ advanceOptions ? 'Hide' : 'Show more' }} options {{ advanceOptions ? $t('general.hideAll') : $t('general.showMore') }}
<v-icon x-small color="grey"> <v-icon x-small color="grey">
mdi-{{ advanceOptions ? 'minus' : 'plus' }}-circle-outline mdi-{{ advanceOptions ? 'minus' : 'plus' }}-circle-outline
</v-icon> </v-icon>
@ -301,11 +303,12 @@
</div> </div>
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<!--label="Type in Database"-->
<v-autocomplete <v-autocomplete
v-model="newColumn.dt" v-model="newColumn.dt"
hide-details hide-details
class="caption data-type" class="caption data-type"
label="Type in Database" :label="$t('labels.databaseType')"
dense dense
outlined outlined
:items="dataTypes" :items="dataTypes"
@ -314,13 +317,14 @@
</v-col> </v-col>
<v-col :cols="sqlUi.showScale(newColumn) && !isSelect ? 6 : 12"> <v-col :cols="sqlUi.showScale(newColumn) && !isSelect ? 6 : 12">
<!--label="Length / Values"-->
<v-text-field <v-text-field
v-if="!isSelect" v-if="!isSelect"
v-model="newColumn.dtxp" v-model="newColumn.dtxp"
dense dense
:disabled="sqlUi.getDefaultLengthIsDisabled(newColumn.dt) || !sqlUi.columnEditable(newColumn)" :disabled="sqlUi.getDefaultLengthIsDisabled(newColumn.dt) || !sqlUi.columnEditable(newColumn)"
class="caption" class="caption"
label="Length / Values" :label="$t('labels.lengthValue')"
outlined outlined
hide-details hide-details
@input="newColumn.altered = newColumn.altered || 2" @input="newColumn.altered = newColumn.altered || 2"
@ -342,7 +346,7 @@
<v-col cols="12"> <v-col cols="12">
<v-textarea <v-textarea
v-model="newColumn.cdf" v-model="newColumn.cdf"
label="Default value" :label="$t('placeholder.defaultValue')"
:hint="sqlUi.getDefaultValueForDatatype(newColumn.dt)" :hint="sqlUi.getDefaultValueForDatatype(newColumn.dt)"
persistent-hint persistent-hint
rows="3" rows="3"

2
packages/nc-gui/components/project/spreadsheet/components/editVirtualColumn.vue

@ -16,7 +16,7 @@
hide-details="auto" hide-details="auto"
color="primary" color="primary"
class="caption nc-column-name-input" class="caption nc-column-name-input"
label="Column name" :label="$t('labels.columnName')"
:rules="[ :rules="[
v => !!v || 'Required', v => !!v || 'Required',
v => !meta || !meta.columns || !column ||meta.columns.every(c => v !== c.cn ) && meta.v.every(c => column && c._cn === column._cn || v !== c._cn ) || 'Duplicate column name', v => !meta || !meta.columns || !column ||meta.columns.every(c => v !== c.cn ) && meta.v.every(c => column && c._cn === column._cn || v !== c._cn ) || 'Duplicate column name',

10
packages/nc-gui/components/templates/editor.vue

@ -112,7 +112,7 @@
</div> </div>
<p v-if="project.tables" class="caption grey--text mt-4"> <p v-if="project.tables" class="caption grey--text mt-4">
{{ 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
</p> </p>
<v-expansion-panels <v-expansion-panels
@ -168,10 +168,12 @@
<thead> <thead>
<tr> <tr>
<th class="caption text-left pa-1"> <th class="caption text-left pa-1">
Column Name <!--Column Name-->
{{ $t('labels.columnName') }}
</th> </th>
<th class="caption text-left pa-1" colspan="4"> <th class="caption text-left pa-1" colspan="4">
Column Type <!--Column Type-->
{{ $t('labels.columnType') }}
</th> </th>
<th /> <th />
<!-- <th class='text-center'>Related Table</th>--> <!-- <th class='text-center'>Related Table</th>-->
@ -193,7 +195,7 @@
outlined outlined
dense dense
class="caption" class="caption"
placeholder="Column name" :placeholder="$t('labels.columnName')"
hide-details="auto" hide-details="auto"
:rules="[ :rules="[
v => !!v || 'Column name required', v => !!v || 'Column name required',

5
packages/nc-gui/components/utils/language.vue

@ -25,7 +25,10 @@
</v-list-item-group> </v-list-item-group>
<v-divider /> <v-divider />
<v-list-item> <v-list-item>
<a href="https://github.com/nocodb/nocodb/tree/master/packages/nc-gui/lang" target="_blank" class="caption">Help translate</a> <a href="https://github.com/nocodb/nocodb/tree/master/packages/nc-gui/lang" target="_blank" class="caption">
<!--Help translate-->
{{ $t('activity.translate') }}
</a>
</v-list-item> </v-list-item>
</v-list> </v-list>
</v-menu> </v-menu>

Loading…
Cancel
Save