Browse Source

fix: i18n for Edit/Add column and its validation

pull/6512/head
Muhammed Mustafa 1 year ago
parent
commit
9795f074bb
  1. 4
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  2. 6
      packages/nc-gui/composables/useColumnCreateStore.ts
  3. 6
      packages/nc-gui/lang/en.json

4
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -258,7 +258,7 @@ if (props.fromTableExplorer) {
<div class="flex gap-1 items-center"> <div class="flex gap-1 items-center">
<component :is="opt.icon" class="text-gray-700 mx-1" /> <component :is="opt.icon" class="text-gray-700 mx-1" />
{{ opt.name }} {{ opt.name }}
<span v-if="opt.deprecated" class="!text-xs !text-gray-300">(Deprecated)</span> <span v-if="opt.deprecated" class="!text-xs !text-gray-300">({{ $t('general.deprecated') }})</span>
</div> </div>
</a-select-option> </a-select-option>
</a-select> </a-select>
@ -297,7 +297,7 @@ if (props.fromTableExplorer) {
class="ml-1 mb-1" class="ml-1 mb-1"
> >
<span class="text-[10px] text-gray-600"> <span class="text-[10px] text-gray-600">
{{ `Accept only valid ${formState.uidt}` }} {{ `${$t('msg.acceptOnlyValid')} ${formState.uidt}` }}
</span> </span>
</a-checkbox> </a-checkbox>
<div class="!my-3"> <div class="!my-3">

6
packages/nc-gui/composables/useColumnCreateStore.ts

@ -103,7 +103,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
title: [ title: [
{ {
required: true, required: true,
message: 'Column name is required', message: t('msg.error.columnNameRequired'),
}, },
// validation for unique column name // validation for unique column name
{ {
@ -118,7 +118,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
(value || '').toLowerCase() === (c.title || '').toLowerCase()), (value || '').toLowerCase() === (c.title || '').toLowerCase()),
) )
) { ) {
return reject(new Error('Duplicate column name')) return reject(new Error(t('msg.error.duplicateColumnName')))
} }
resolve() resolve()
}) })
@ -129,7 +129,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
uidt: [ uidt: [
{ {
required: true, required: true,
message: 'UI Datatype is required', message: t('msg.error.uiDataTypeRequired'),
}, },
], ],
...(additionalValidations?.value || {}), ...(additionalValidations?.value || {}),

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

@ -81,6 +81,7 @@
"access": "Access", "access": "Access",
"visibility": "Visibility", "visibility": "Visibility",
"hide": "Hide", "hide": "Hide",
"deprecated": "Deprecated",
"showAll": "Show all", "showAll": "Show all",
"hideAll": "Hide all", "hideAll": "Hide all",
"showMore": "Show more", "showMore": "Show more",
@ -327,11 +328,13 @@
"tokens": "Tokens", "tokens": "Tokens",
"userManagement": "User Management", "userManagement": "User Management",
"licence": "Licence", "licence": "Licence",
"allowAllMimeTypes": "Allow All Mime Types",
"defaultView": "Default View", "defaultView": "Default View",
"relations": "Relations", "relations": "Relations",
"switchLanguage": "Switch Language" "switchLanguage": "Switch Language"
}, },
"labels": { "labels": {
"optional": "Optional",
"clickToMake": "Click to make", "clickToMake": "Click to make",
"visibleForRole": "visible for role:", "visibleForRole": "visible for role:",
"inUI": "in UI Dashboard", "inUI": "in UI Dashboard",
@ -735,6 +738,7 @@
"selectField": "Select field" "selectField": "Select field"
}, },
"msg": { "msg": {
"acceptOnlyValid": "Accepts only",
"apiTokenCreate": "Create personal API tokens to use in automation or external apps.", "apiTokenCreate": "Create personal API tokens to use in automation or external apps.",
"selectFieldToSort": "Select Field to Sort", "selectFieldToSort": "Select Field to Sort",
"createWebhookMsg1": "Get started with web-hooks!", "createWebhookMsg1": "Get started with web-hooks!",
@ -961,6 +965,8 @@
"nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _",
"followingCharactersAreNotAllowed": "Following characters are not allowed", "followingCharactersAreNotAllowed": "Following characters are not allowed",
"columnNameRequired": "Column name is required", "columnNameRequired": "Column name is required",
"duplicateColumnName": "Duplicate column name",
"uiDataTypeRequired": "UI data type is required",
"columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters",
"projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters",
"projectNameCannotStartWithSpace": "Project name cannot start with space", "projectNameCannotStartWithSpace": "Project name cannot start with space",

Loading…
Cancel
Save