Browse Source

fix(nc-gui): i18n issues

pull/6614/head
reenphygeorge 1 year ago
parent
commit
5fb540d346
  1. 4
      packages/nc-gui/components/dlg/share-and-collaborate/View.vue
  2. 2
      packages/nc-gui/components/notification/Card.vue
  3. 14
      packages/nc-gui/components/workspace/CreateProjectDlg.vue
  4. 4
      packages/nc-gui/components/workspace/InviteCollabDlg.vue
  5. 12
      packages/nc-gui/lang/en.json
  6. 8
      packages/nc-gui/layouts/base.vue
  7. 10
      packages/nc-gui/layouts/new.vue
  8. 2
      packages/nocodb-sdk/src/lib/enums.ts

4
packages/nc-gui/components/dlg/share-and-collaborate/View.vue

@ -118,11 +118,11 @@ watch(showShareModal, (val) => {
> >
<div v-if="isInvitationLinkCopied" class="flex flex-row items-center gap-x-1"> <div v-if="isInvitationLinkCopied" class="flex flex-row items-center gap-x-1">
<MdiTick class="h-3.5" /> <MdiTick class="h-3.5" />
{{ $t('activity.copyInviteLink') }} {{ $t('activity.copiedInviteLink') }}
</div> </div>
<div v-else class="flex flex-row items-center gap-x-1"> <div v-else class="flex flex-row items-center gap-x-1">
<MdiContentCopy class="h-3.3" /> <MdiContentCopy class="h-3.3" />
{{ $t('activity.copiedInviteLink') }} {{ $t('activity.copyInviteLink') }}
</div> </div>
</a-button> </a-button>
</div> </div>

2
packages/nc-gui/components/notification/Card.vue

@ -33,7 +33,7 @@ const groupType = computed({
class="cursor-pointer text-xs text-gray-500 hover:text-primary" class="cursor-pointer text-xs text-gray-500 hover:text-primary"
@click.stop="notificationStore.markAllAsRead" @click.stop="notificationStore.markAllAsRead"
> >
{{ $t('activity.maskAllAsRead') }} {{ $t('activity.markAllAsRead') }}
</div> </div>
</div> </div>
</div> </div>

14
packages/nc-gui/components/workspace/CreateProjectDlg.vue

@ -3,7 +3,7 @@ import type { RuleObject } from 'ant-design-vue/es/form'
import type { Form, Input } from 'ant-design-vue' import type { Form, Input } from 'ant-design-vue'
import type { VNodeRef } from '@vue/runtime-core' import type { VNodeRef } from '@vue/runtime-core'
import { computed } from '@vue/reactivity' import { computed } from '@vue/reactivity'
import { NcProjectType, baseTitleValidator, extractSdkResponseErrorMsg, ref, useGlobal, useVModel, useI18n } from '#imports' import { NcProjectType, baseTitleValidator, extractSdkResponseErrorMsg, ref, useGlobal, useI18n, useVModel } from '#imports'
const props = defineProps<{ const props = defineProps<{
modelValue: boolean modelValue: boolean
@ -26,7 +26,7 @@ const { navigateToProject } = useGlobal()
const nameValidationRules = [ const nameValidationRules = [
{ {
required: true, required: true,
message: t('msg.dbNamerequired'), message: t('msg.dbNameRequired'),
}, },
baseTitleValidator, baseTitleValidator,
] as RuleObject[] ] as RuleObject[]
@ -97,7 +97,7 @@ const typeLabel = computed(() => {
<!-- Create A New Table --> <!-- Create A New Table -->
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">
<GeneralProjectIcon :type="baseType" class="mr-2.5 !text-lg !h-4" /> <GeneralProjectIcon :type="baseType" class="mr-2.5 !text-lg !h-4" />
{{ $t('general.create')+` ${typeLabel}` }} {{ `${$t('general.create')} ${typeLabel}` }}
</div> </div>
</template> </template>
<div class="mt-3"> <div class="mt-3">
@ -129,13 +129,13 @@ const typeLabel = computed(() => {
data-testid="docs-create-proj-dlg-create-btn" data-testid="docs-create-proj-dlg-create-btn"
:loading="creating" :loading="creating"
type="primary" type="primary"
:label="$t('general.create')+` ${typeLabel}`" :label="`${$t('general.create')} ${typeLabel}`"
:loading-label="`Creating ${typeLabel}`" :loading-label="`${$t('general.creating')} ${typeLabel}`"
@click="createProject" @click="createProject"
> >
{{ $t('general.create')+` ${typeLabel}` }} {{ `${$t('general.create')} ${typeLabel}` }}
<template #loading> <template #loading>
{{ $t('general.creating')+` ${typeLabel}` }} {{ `${$t('general.creating')} ${typeLabel}` }}
</template> </template>
</NcButton> </NcButton>
</div> </div>

4
packages/nc-gui/components/workspace/InviteCollabDlg.vue

@ -42,7 +42,7 @@ const validators = computed(() => {
{ {
validator: (rule: any, value: string, callback: (errMsg?: string) => void) => { validator: (rule: any, value: string, callback: (errMsg?: string) => void) => {
if (!value || value.length === 0) { if (!value || value.length === 0) {
callback(t('error.signUpRules.emailReqd')) callback(t('error.signUpRules.emailRequired'))
return return
} }
const invalidEmails = (value || '').split(/\s*,\s*/).filter((e: string) => !validateEmail(e)) const invalidEmails = (value || '').split(/\s*,\s*/).filter((e: string) => !validateEmail(e))
@ -51,7 +51,7 @@ const validators = computed(() => {
`${ `${
invalidEmails.length > 1 invalidEmails.length > 1
? `${t('error.signUpRules.invalidEmails')}: ` ? `${t('error.signUpRules.invalidEmails')}: `
: `${t('error.signUpRules.invalidEmails')}: ` : `${t('error.signUpRules.invalidEmail')}: `
} ${invalidEmails.join(', ')} `, } ${invalidEmails.join(', ')} `,
) )
} else { } else {

12
packages/nc-gui/lang/en.json

@ -182,7 +182,8 @@
"useSurveyMode": "Use Survey Mode", "useSurveyMode": "Use Survey Mode",
"shift": "Shift", "shift": "Shift",
"enter": "Enter", "enter": "Enter",
"seconds": "Seconds" "seconds": "Seconds",
"todo": "todo"
}, },
"objects": { "objects": {
"workspace": "Workspace", "workspace": "Workspace",
@ -224,7 +225,7 @@
"commenter": "Commenter", "commenter": "Commenter",
"viewer": "Viewer", "viewer": "Viewer",
"noaccess":"No Access", "noaccess":"No Access",
"super": "Super", "superAdmin": "Super Admin",
"orgLevelCreator": "Organization Level Creator", "orgLevelCreator": "Organization Level Creator",
"orgLevelViewer": "Organization Level Viewer" "orgLevelViewer": "Organization Level Viewer"
}, },
@ -388,6 +389,7 @@
"resetPasswordMenu": "Reset Password", "resetPasswordMenu": "Reset Password",
"tokens": "Tokens", "tokens": "Tokens",
"userManagement": "User Management", "userManagement": "User Management",
"accountManagement": "Account management",
"licence": "Licence", "licence": "Licence",
"allowAllMimeTypes": "Allow All Mime Types", "allowAllMimeTypes": "Allow All Mime Types",
"defaultView": "Default View", "defaultView": "Default View",
@ -787,7 +789,7 @@
"deleteRecord": "Delete Record", "deleteRecord": "Delete Record",
"fullWidth": "Full width", "fullWidth": "Full width",
"exitFullWidth": "Full width", "exitFullWidth": "Full width",
"maskAllAsRead": "Mark all as read", "markAllAsRead": "Mark all as read",
"column":{ "column":{
"delete": "Delete Column", "delete": "Delete Column",
"addNumber": "Add Number Column", "addNumber": "Add Number Column",
@ -1153,7 +1155,7 @@
"noMoreRecords": "No more records", "noMoreRecords": "No more records",
"tokenNameNotEmpty": "Token name should not be empty", "tokenNameNotEmpty": "Token name should not be empty",
"tokenNameMaxLength": "Token name should not be more than 255 characters", "tokenNameMaxLength": "Token name should not be more than 255 characters",
"dbNamerequired": "Database name is required", "dbNameRequired": "Database name is required",
"wsNameRequired":"Workspace name required", "wsNameRequired":"Workspace name required",
"wsNameMinLength":"Workspace name must be at least 3 characters long", "wsNameMinLength":"Workspace name must be at least 3 characters long",
"wsNameMaxLength":"Workspace name must be at most 50 characters long", "wsNameMaxLength":"Workspace name must be at most 50 characters long",
@ -1181,7 +1183,7 @@
"dbConnectionFailed": "Connection Failure:", "dbConnectionFailed": "Connection Failure:",
"nullFilterExists": "Null filter exists. Please remove them", "nullFilterExists": "Null filter exists. Please remove them",
"signUpRules": { "signUpRules": {
"emailReqd": "Email is required", "emailRequired": "Email is required",
"emailInvalid": "Email must be valid", "emailInvalid": "Email must be valid",
"passwdRequired": "Password is required", "passwdRequired": "Password is required",
"passwdLength": "You password must be atleast 8 characters", "passwdLength": "You password must be atleast 8 characters",

8
packages/nc-gui/layouts/base.vue

@ -97,8 +97,8 @@ hooks.hook('page:finish', () => {
</nuxt-link> </nuxt-link>
</a-menu-item> </a-menu-item>
<a-menu-divider class="!m-0" /> <!-- <a-menu-divider class="!m-0" />
<!-- <a-menu-item v-if="isUIAllowed('superAdminAppStore')" key="0" class="!rounded-t"> <a-menu-item v-if="isUIAllowed('superAdminAppStore')" key="0" class="!rounded-t">
<nuxt-link <nuxt-link
v-e="['c:settings:appstore', { page: true }]" v-e="['c:settings:appstore', { page: true }]"
class="nc-base-menu-item group !no-underline" class="nc-base-menu-item group !no-underline"
@ -106,8 +106,8 @@ hooks.hook('page:finish', () => {
> >
<MdiShieldAccountOutline class="mt-1 group-hover:text-accent" />&nbsp; <MdiShieldAccountOutline class="mt-1 group-hover:text-accent" />&nbsp;
&lt;!&ndash; &ndash;&gt; &lt;!&ndash; {{`${$t('general.todo')}: i18n`}} &ndash;&gt;
<span class="prose group-hover:text-primary">Account management</span> <span class="prose group-hover:text-primary">{{ $t('title.accountManagement') }}</span>
</nuxt-link> </nuxt-link>
</a-menu-item> </a-menu-item>

10
packages/nc-gui/layouts/new.vue

@ -58,7 +58,7 @@ export default {
<div v-if="$route.name === 'index-index'" class="flex gap-1"> <div v-if="$route.name === 'index-index'" class="flex gap-1">
<!-- <a-button class="!text-inherit" data-testid="nc-dash-nav-workspaces"> Projects</a-button --> <!-- <a-button class="!text-inherit" data-testid="nc-dash-nav-workspaces"> Projects</a-button -->
<!-- <a-button ghost !text-inherit" data-testid="nc-dash-nav-explore"> Template</a-button> <!-- <a-button ghost class="!text-inherit" data-testid="nc-dash-nav-explore"> Template</a-button>
<a-button ghost class="!text-inherit" data-testid="nc-dash-nav-help"> Help</a-button> --> <a-button ghost class="!text-inherit" data-testid="nc-dash-nav-help"> Help</a-button> -->
</div> </div>
<div class="flex-1 min-w-0 flex justify-end gap-2"> <div class="flex-1 min-w-0 flex justify-end gap-2">
@ -99,7 +99,7 @@ export default {
</a-menu-item> </a-menu-item>
<a-menu-divider class="!m-0" /> <a-menu-divider class="!m-0" />
<!-- <a-menu-item v-if="isUIAllowed('superAdminAppStore')" key="0" class="!rounded-t"> <a-menu-item v-if="isUIAllowed('superAdminAppStore')" key="0" class="!rounded-t">
<nuxt-link <nuxt-link
v-e="['c:settings:appstore', { page: true }]" v-e="['c:settings:appstore', { page: true }]"
class="nc-base-menu-item group !no-underline" class="nc-base-menu-item group !no-underline"
@ -107,12 +107,12 @@ export default {
> >
<MdiShieldAccountOutline class="mt-1 group-hover:text-accent" />&nbsp; <MdiShieldAccountOutline class="mt-1 group-hover:text-accent" />&nbsp;
&lt;!&ndash; &ndash;&gt; &lt;!&ndash; {{`${$t('general.todo')}: i18n`}} &ndash;&gt;
<span class="prose group-hover:text-primary">Account management</span> <span class="prose group-hover:text-primary">{{ $t('title.accountManagement') }}</span>
</nuxt-link> </nuxt-link>
</a-menu-item> </a-menu-item>
<a-menu-divider class="!m-0" /> --> <a-menu-divider class="!m-0" />
<a-menu-item key="1" class="!rounded-b group" data-testid="nc-menu-accounts__sign-out"> <a-menu-item key="1" class="!rounded-b group" data-testid="nc-menu-accounts__sign-out">
<div <div

2
packages/nocodb-sdk/src/lib/enums.ts

@ -172,7 +172,7 @@ export const RoleLabels = {
[ProjectRoles.COMMENTER]: 'commenter', [ProjectRoles.COMMENTER]: 'commenter',
[ProjectRoles.VIEWER]: 'viewer', [ProjectRoles.VIEWER]: 'viewer',
[ProjectRoles.NO_ACCESS]: 'noaccess', [ProjectRoles.NO_ACCESS]: 'noaccess',
[OrgUserRoles.SUPER_ADMIN]: 'super', [OrgUserRoles.SUPER_ADMIN]: 'superAdmin',
[OrgUserRoles.CREATOR]: 'creator', [OrgUserRoles.CREATOR]: 'creator',
[OrgUserRoles.VIEWER]: 'viewer', [OrgUserRoles.VIEWER]: 'viewer',
}; };

Loading…
Cancel
Save