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">
<component :is="opt.icon" class="text-gray-700 mx-1" />
{{ 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>
</a-select-option>
</a-select>
@ -297,7 +297,7 @@ if (props.fromTableExplorer) {
class="ml-1 mb-1"
>
<span class="text-[10px] text-gray-600">
{{ `Accept only valid ${formState.uidt}` }}
{{ `${$t('msg.acceptOnlyValid')} ${formState.uidt}` }}
</span>
</a-checkbox>
<div class="!my-3">

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

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

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

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

Loading…
Cancel
Save