diff --git a/packages/nc-gui/components/account/Profile.vue b/packages/nc-gui/components/account/Profile.vue
index db959d808a..b31d238b51 100644
--- a/packages/nc-gui/components/account/Profile.vue
+++ b/packages/nc-gui/components/account/Profile.vue
@@ -15,9 +15,9 @@ const formValidator = ref()
const formRules = {
title: [
- { required: true, message: t('error.nameRequired') },
- { min: 2, message: t('error.nameMinLength') },
- { max: 60, message: t('error.nameMaxLength') },
+ { required: true, message: t('msg.error.nameRequired') },
+ { min: 2, message: t('msg.error.nameMinLength') },
+ { max: 60, message: t('msg.error.nameMaxLength') },
],
}
diff --git a/packages/nc-gui/components/api-client/Headers.vue b/packages/nc-gui/components/api-client/Headers.vue
index ad4f826526..9b58046552 100644
--- a/packages/nc-gui/components/api-client/Headers.vue
+++ b/packages/nc-gui/components/api-client/Headers.vue
@@ -66,10 +66,10 @@ const filterOption = (input: string, option: Option) => option.value.toUpperCase
|
- Header Name
+ {{ $t('labels.headerName') }}
|
- Value
+ {{ $t('placeholder.value') }}
|
|
@@ -87,9 +87,9 @@ const filterOption = (input: string, option: Option) => option.value.toUpperCase
@@ -97,7 +97,11 @@ const filterOption = (input: string, option: Option) => option.value.toUpperCase
-
+
|
@@ -120,7 +124,7 @@ const filterOption = (input: string, option: Option) => option.value.toUpperCase
- Add Header
+ {{ $t('labels.addHeader') }}
diff --git a/packages/nc-gui/components/api-client/Params.vue b/packages/nc-gui/components/api-client/Params.vue
index 61aa3f1f2c..66a2e79336 100644
--- a/packages/nc-gui/components/api-client/Params.vue
+++ b/packages/nc-gui/components/api-client/Params.vue
@@ -24,11 +24,11 @@ const deleteParamRow = (i: number) => {
- Parameter Name
+ {{ $t('title.parameterName') }}
|
- Value
+ {{ $t('placeholder.value') }}
|
@@ -41,13 +41,13 @@ const deleteParamRow = (i: number) => {
|
-
+
|
-
+
|
@@ -69,7 +69,7 @@ const deleteParamRow = (i: number) => {
- Add Parameter
+ {{ $t('activity.addParameter') }}
diff --git a/packages/nc-gui/components/cell/Currency.vue b/packages/nc-gui/components/cell/Currency.vue
index fc67d9274a..1b5d363969 100644
--- a/packages/nc-gui/components/cell/Currency.vue
+++ b/packages/nc-gui/components/cell/Currency.vue
@@ -79,7 +79,7 @@ onMounted(() => {
v-model="vModel"
type="number"
class="w-full h-full text-sm border-none rounded-md outline-none"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="submitCurrency"
@keydown.down.stop
@keydown.left.stop
@@ -93,7 +93,7 @@ onMounted(() => {
@contextmenu.stop
/>
- NULL
+ {{ $t('general.null') }}
{{ currency }}
diff --git a/packages/nc-gui/components/cell/DatePicker.vue b/packages/nc-gui/components/cell/DatePicker.vue
index 991fa52903..e1f2f79433 100644
--- a/packages/nc-gui/components/cell/DatePicker.vue
+++ b/packages/nc-gui/components/cell/DatePicker.vue
@@ -25,6 +25,8 @@ const { modelValue, isPk } = defineProps()
const emit = defineEmits(['update:modelValue'])
+const { t } = useI18n()
+
const { showNull } = useGlobal()
const columnMeta = inject(ColumnInj, null)!
@@ -84,11 +86,11 @@ watch(
const placeholder = computed(() => {
if (isEditColumn.value && (modelValue === '' || modelValue === null)) {
- return '(Optional)'
+ return t('labels.optional')
} else if (modelValue === null && showNull.value) {
- return 'NULL'
+ return t('general.null')
} else if (isDateInvalid.value) {
- return 'Invalid date'
+ return t('msg.invalidDate')
} else {
return ''
}
diff --git a/packages/nc-gui/components/cell/DateTimePicker.vue b/packages/nc-gui/components/cell/DateTimePicker.vue
index c0a3960d23..2b371829dd 100644
--- a/packages/nc-gui/components/cell/DateTimePicker.vue
+++ b/packages/nc-gui/components/cell/DateTimePicker.vue
@@ -40,6 +40,8 @@ const editable = inject(EditModeInj, ref(false))
const isLockedMode = inject(IsLockedInj, ref(false))
+const { t } = useI18n()
+
const isEditColumn = inject(EditColumnInj, ref(false))
const column = inject(ColumnInj)!
@@ -137,11 +139,11 @@ watch(
const placeholder = computed(() => {
if (isEditColumn.value && (modelValue === '' || modelValue === null)) {
- return '(Optional)'
+ return t('labels.optional')
} else if (modelValue === null && showNull.value) {
- return 'NULL'
+ return t('general.null')
} else if (isDateInvalid.value) {
- return 'Invalid date'
+ return t('msg.invalidDate')
} else {
return ''
}
diff --git a/packages/nc-gui/components/cell/Decimal.vue b/packages/nc-gui/components/cell/Decimal.vue
index 547f14a227..80a7e9fc01 100644
--- a/packages/nc-gui/components/cell/Decimal.vue
+++ b/packages/nc-gui/components/cell/Decimal.vue
@@ -97,7 +97,7 @@ watch(isExpandedFormOpen, () => {
class="outline-none !py-2 !px-1 border-none rounded-md w-full h-full !text-sm"
type="number"
:step="precision"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
style="letter-spacing: 0.06rem"
@blur="editEnabled = false"
@keydown.down.stop="onKeyDown"
@@ -110,7 +110,7 @@ watch(isExpandedFormOpen, () => {
@selectstart.capture.stop
@mousedown.stop
/>
- NULL
+ {{ $t('general.null') }}
{{ displayValue }}
diff --git a/packages/nc-gui/components/cell/Duration.vue b/packages/nc-gui/components/cell/Duration.vue
index 34cc923bf1..c3bc7bb3ea 100644
--- a/packages/nc-gui/components/cell/Duration.vue
+++ b/packages/nc-gui/components/cell/Duration.vue
@@ -23,6 +23,8 @@ const { modelValue, showValidationError = true } = defineProps()
const emit = defineEmits(['update:modelValue'])
+const { t } = useI18n()
+
const { showNull } = useGlobal()
const column = inject(ColumnInj)
@@ -39,7 +41,9 @@ const isEditColumn = inject(EditColumnInj, ref(false))
const durationType = computed(() => parseProp(column?.value?.meta)?.duration || 0)
-const durationPlaceholder = computed(() => (isEditColumn.value ? '(Optional)' : durationOptions[durationType.value].title))
+const durationPlaceholder = computed(() =>
+ isEditColumn.value ? `(${t('labels.optional')})` : durationOptions[durationType.value].title,
+)
const localState = computed({
get: () => convertMS2Duration(modelValue, durationType.value),
@@ -105,13 +109,12 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value
@mousedown.stop
/>
- NULL
+ {{ $t('general.null') }}
{{ localState }}
-
- Please enter a number
+ {{ $t('msg.plsEnterANumber') }}
diff --git a/packages/nc-gui/components/cell/Email.vue b/packages/nc-gui/components/cell/Email.vue
index 434dd0a1fc..385fecb852 100644
--- a/packages/nc-gui/components/cell/Email.vue
+++ b/packages/nc-gui/components/cell/Email.vue
@@ -71,7 +71,7 @@ watch(
:ref="focus"
v-model="vModel"
class="w-full outline-none text-sm px-1 py-2"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="editEnabled = false"
@keydown.down.stop
@keydown.left.stop
@@ -84,7 +84,7 @@ watch(
@mousedown.stop
/>
- NULL
+ {{ $t('general.null') }}
!isExpandedFormOpen.value && !isEditColumn.value
class="outline-none px-1 border-none w-full h-full text-sm"
type="number"
step="0.1"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="editEnabled = false"
@keydown.down.stop
@keydown.left.stop
@@ -63,7 +63,7 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value
@selectstart.capture.stop
@mousedown.stop
/>
- NULL
+ {{ $t('general.null') }}
{{ vModel }}
diff --git a/packages/nc-gui/components/cell/Integer.vue b/packages/nc-gui/components/cell/Integer.vue
index 477232670a..16a2597c32 100644
--- a/packages/nc-gui/components/cell/Integer.vue
+++ b/packages/nc-gui/components/cell/Integer.vue
@@ -88,7 +88,7 @@ function onKeyDown(e: any) {
class="outline-none py-2 px-1 border-none w-full h-full text-sm"
type="number"
style="letter-spacing: 0.06rem"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="editEnabled = false"
@keydown="onKeyDown"
@keydown.down.stop
@@ -99,7 +99,7 @@ function onKeyDown(e: any) {
@selectstart.capture.stop
@mousedown.stop
/>
- NULL
+ {{ $t('general.null') }}
{{ displayValue }}
diff --git a/packages/nc-gui/components/cell/Json.vue b/packages/nc-gui/components/cell/Json.vue
index 21307ad536..fa28ad10a0 100644
--- a/packages/nc-gui/components/cell/Json.vue
+++ b/packages/nc-gui/components/cell/Json.vue
@@ -150,10 +150,12 @@ useSelectedCellKeyupListener(active, (e) => {
- Cancel
+ {{ $t('general.cancel') }}
- Save
+ {{ $t('general.save') }}
@@ -172,7 +174,7 @@ useSelectedCellKeyupListener(active, (e) => {
- NULL
+ {{ $t('general.null') }}
{{ vModel }}
diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue
index ae68ab7aad..eafeca7270 100644
--- a/packages/nc-gui/components/cell/MultiSelect.vue
+++ b/packages/nc-gui/components/cell/MultiSelect.vue
@@ -378,7 +378,7 @@ const selectedOpts = computed(() => {
v-model:value="vModel"
mode="multiple"
class="w-full overflow-hidden"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
:bordered="false"
clear-icon
show-search
@@ -421,7 +421,7 @@ const selectedOpts = computed(() => {
- Create new option named {{ searchVal }}
+ {{ $t('msg.selectOption.createNewOptionNamed') }} {{ searchVal }}
diff --git a/packages/nc-gui/components/cell/Percent.vue b/packages/nc-gui/components/cell/Percent.vue
index 5fec5b0412..55b6188e56 100644
--- a/packages/nc-gui/components/cell/Percent.vue
+++ b/packages/nc-gui/components/cell/Percent.vue
@@ -42,7 +42,7 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value
class="w-full !text-sm !border-none !outline-none focus:ring-0 text-base p-1"
:class="{ '!px-2': editEnabled }"
type="number"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="editEnabled = false"
@keydown.down.stop
@keydown.left.stop
@@ -54,6 +54,6 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value
@selectstart.capture.stop
@mousedown.stop
/>
- NULL
+ {{ $t('general.null') }}
{{ vModel }}
diff --git a/packages/nc-gui/components/cell/PhoneNumber.vue b/packages/nc-gui/components/cell/PhoneNumber.vue
index 42f2f37f25..24c3c8ef36 100644
--- a/packages/nc-gui/components/cell/PhoneNumber.vue
+++ b/packages/nc-gui/components/cell/PhoneNumber.vue
@@ -15,6 +15,8 @@ const rowHeight = inject(RowHeightInj, ref(undefined))
const { showNull } = useGlobal()
+const { t } = useI18n()
+
const editEnabled = inject(EditModeInj)!
const isEditColumn = inject(EditColumnInj, ref(false))
@@ -46,7 +48,7 @@ watch(
() => editEnabled.value,
() => {
if (parseProp(column.value.meta)?.validate && !editEnabled.value && localState.value && !isMobilePhone(localState.value)) {
- message.error('Invalid Phone Number')
+ message.error(t('msg.invalidPhoneNumber'))
localState.value = undefined
return
}
@@ -61,7 +63,7 @@ watch(
:ref="focus"
v-model="vModel"
class="w-full outline-none text-sm px-1 py-2"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="editEnabled = false"
@keydown.down.stop
@keydown.left.stop
@@ -74,7 +76,7 @@ watch(
@mousedown.stop
/>
- NULL
+ {{ $t('general.null') }}
diff --git a/packages/nc-gui/components/cell/SingleSelect.vue b/packages/nc-gui/components/cell/SingleSelect.vue
index 4e357d1cb2..5c0475addf 100644
--- a/packages/nc-gui/components/cell/SingleSelect.vue
+++ b/packages/nc-gui/components/cell/SingleSelect.vue
@@ -286,7 +286,7 @@ const selectedOpt = computed(() => {
v-model:value="vModel"
class="w-full overflow-hidden"
:class="{ 'caret-transparent': !hasEditRoles }"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
:allow-clear="!column.rqd && editAllowed"
:bordered="false"
:open="isOpen && editAllowed"
@@ -324,7 +324,7 @@ const selectedOpt = computed(() => {
- Create new option named {{ searchVal }}
+ {{ $t('msg.selectOption.createNewOptionNamed') }} {{ searchVal }}
diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue
index 9fc0b9209e..cd7b6efaf8 100644
--- a/packages/nc-gui/components/cell/Text.vue
+++ b/packages/nc-gui/components/cell/Text.vue
@@ -33,7 +33,7 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value
:ref="focus"
v-model="vModel"
class="h-full w-full outline-none p-2 bg-transparent"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="editEnabled = false"
@keydown.down.stop
@keydown.left.stop
@@ -46,7 +46,7 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value
@mousedown.stop
/>
- NULL
+ {{ $t('general.null') }}
diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue
index 0ebd53ae86..e387dbe90e 100644
--- a/packages/nc-gui/components/cell/TextArea.vue
+++ b/packages/nc-gui/components/cell/TextArea.vue
@@ -84,7 +84,7 @@ onClickOutside(inputWrapperRef, (e) => {
:style="{
minHeight: `${height}px`,
}"
- :placeholder="isEditColumn ? '(Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="editEnabled = false"
@keydown.alt.enter.stop
@keydown.shift.enter.stop
@@ -99,7 +99,7 @@ onClickOutside(inputWrapperRef, (e) => {
@mousedown.stop
/>
- NULL
+ {{ $t('general.null') }}
@@ -113,7 +113,7 @@ onClickOutside(inputWrapperRef, (e) => {
@click.stop="isVisible = !isVisible"
>
- Expand
+ {{ $t('title.expand') }}
{
{
if (isEditColumn.value && (modelValue === '' || modelValue === null)) {
- return '(Optional)'
+ return t('labels.optional')
} else if (modelValue === null && showNull.value) {
- return 'NULL'
+ return t('general.null')
} else if (isTimeInvalid.value) {
- return 'Invalid time'
+ return t('msg.invalidTime')
} else {
return ''
}
diff --git a/packages/nc-gui/components/cell/Url.vue b/packages/nc-gui/components/cell/Url.vue
index 6243e473bf..cd6d15077e 100644
--- a/packages/nc-gui/components/cell/Url.vue
+++ b/packages/nc-gui/components/cell/Url.vue
@@ -91,7 +91,7 @@ watch(
v-if="editEnabled"
:ref="focus"
v-model="vModel"
- :placeholder="isEditColumn ? 'Enter default URL (Optional)' : ''"
+ :placeholder="isEditColumn ? $t('labels.enterDefaultUrlOptional') : ''"
class="outline-none text-sm w-full px-2 py-2 bg-transparent h-full"
@blur="editEnabled = false"
@keydown.down.stop
@@ -105,7 +105,7 @@ watch(
@mousedown.stop
/>
- NULL
+ $t('general.null')
{
if (isEditColumn.value && (modelValue === '' || modelValue === null)) {
- return '(Optional)'
+ return t('labels.optional')
} else if (modelValue === null && showNull.value) {
- return 'NULL'
+ return t('general.null')
} else if (isYearInvalid.value) {
- return 'Invalid year'
+ return t('msg.invalidTime')
} else {
return ''
}
diff --git a/packages/nc-gui/components/shared-view/AskPassword.vue b/packages/nc-gui/components/shared-view/AskPassword.vue
index e695823186..5c3abcfedf 100644
--- a/packages/nc-gui/components/shared-view/AskPassword.vue
+++ b/packages/nc-gui/components/shared-view/AskPassword.vue
@@ -35,27 +35,27 @@ const focus: VNodeRef = (el: typeof InputPassword) => el?.$el?.querySelector('in
- This shared view is protected
+ {{ $t('msg.thisSharedViewIsProtected') }}
-
+
Unlock
- Verifying Password
+ >{{ $t('general.unlock') }}
+ {{ $t('msg.verifyingPassword') }}
diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue
index 6b33c990b7..84d5806d4d 100644
--- a/packages/nc-gui/components/smartsheet/Form.vue
+++ b/packages/nc-gui/components/smartsheet/Form.vue
@@ -389,8 +389,10 @@ watch(view, (nextView) => {
- Available in Desktop
- Form View is currently not supported on mobile.
+
+ {{ $t('general.available') }} {{ $t('title.inDesktop') }}
+
+ {{ $t('msg.formViewNotSupportedOnMobile') }}
@@ -399,16 +401,20 @@ watch(view, (nextView) => {
- {{ formViewData.success_msg || 'Successfully submitted form data' }}
+ {{ formViewData.success_msg || $t('msg.successfullySubmittedFormData') }}
- New form will be loaded after {{ secondsRemain }} seconds
+ {{
+ $t('msg.newFormWillBeLoaded', {
+ seconds: secondsRemain,
+ })
+ }}
- Submit Another Form
+ {{ $t('activity.submitAnotherForm') }}
@@ -773,7 +779,7 @@ watch(view, (nextView) => {
v-if="!localColumns.length"
class="mt-4 border-dashed border-2 border-gray-400 py-3 text-gray-400 text-center"
>
- Drag and drop fields here to add
+ {{ $t('activity.dragAndDropFieldsHereToAdd') }}
diff --git a/packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue b/packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue
index 743de8b473..6eff937686 100644
--- a/packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue
+++ b/packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue
@@ -22,6 +22,8 @@ const vModel = useVModel(props, 'modelValue', emit)
const { setAdditionalValidations, validateInfos, column } = useColumnCreateStoreOrThrow()
+const { t } = useI18n()
+
const columnsAllowedAsBarcodeValue = computed(() => {
return fields.value
?.filter(
@@ -67,8 +69,8 @@ watch(columnsAllowedAsBarcodeValue, (newColumnsAllowedAsBarcodeValue) => {
})
setAdditionalValidations({
- fk_barcode_value_column_id: [{ required: true, message: 'Required' }],
- barcode_format: [{ required: true, message: 'Required' }],
+ fk_barcode_value_column_id: [{ required: true, message: t('general.required') }],
+ barcode_format: [{ required: true, message: t('general.required') }],
})
const showBarcodeValueColumnInfoIcon = computed(() => !columnsAllowedAsBarcodeValue.value?.length)
@@ -86,16 +88,15 @@ const showBarcodeValueColumnInfoIcon = computed(() => !columnsAllowedAsBarcodeVa
- The valid Column Types for a Barcode Column are: Number, Single Line Text, Long Text, Phone Number, URL, Email,
- Decimal. Please create one first.
+ {{ $t('msg.validColumnsForBarCode') }}
@@ -111,7 +112,7 @@ const showBarcodeValueColumnInfoIcon = computed(() => !columnsAllowedAsBarcodeVa
diff --git a/packages/nc-gui/components/smartsheet/column/CurrencyOptions.vue b/packages/nc-gui/components/smartsheet/column/CurrencyOptions.vue
index 63ce4816bd..f19d110c5e 100644
--- a/packages/nc-gui/components/smartsheet/column/CurrencyOptions.vue
+++ b/packages/nc-gui/components/smartsheet/column/CurrencyOptions.vue
@@ -12,6 +12,8 @@ const props = defineProps<{
const emit = defineEmits(['update:value'])
+const { t } = useI18n()
+
const vModel = useVModel(props, 'value', emit)
const validators = {
@@ -20,7 +22,7 @@ const validators = {
validator: (_: any, locale: any) => {
return new Promise((resolve, reject) => {
if (!validateCurrencyLocale(locale)) {
- return reject(new Error('Invalid locale'))
+ return reject(new Error(t('msg.invalidLocale')))
}
resolve()
})
@@ -32,7 +34,7 @@ const validators = {
validator: (_: any, currencyCode: any) => {
return new Promise((resolve, reject) => {
if (!validateCurrencyCode(currencyCode)) {
- return reject(new Error('Invalid Currency Code'))
+ return reject(new Error(t('msg.invalidCurrencyCode')))
}
resolve()
})
@@ -54,7 +56,7 @@ const currencyLocaleList = ref<{ text: string; value: string }[]>([])
const isMoney = computed(() => vModel.value.dt === 'money')
const message = computed(() => {
- if (isMoney.value && isPg.value) return "PostgreSQL 'money' type has own currency settings"
+ if (isMoney.value && isPg.value) return t('msg.postgresHasItsOwnCurrencySettings')
return ''
})
@@ -77,7 +79,7 @@ currencyLocales().then((locales) => {
-
+
{
-
+
-
+
diff --git a/packages/nc-gui/components/smartsheet/column/DateTimeOptions.vue b/packages/nc-gui/components/smartsheet/column/DateTimeOptions.vue
index 152b504fd4..90386141d3 100644
--- a/packages/nc-gui/components/smartsheet/column/DateTimeOptions.vue
+++ b/packages/nc-gui/components/smartsheet/column/DateTimeOptions.vue
@@ -21,14 +21,14 @@ if (!vModel.value.meta?.time_format) {
-
+
{{ format }}
-
+
{{ format }}
diff --git a/packages/nc-gui/components/smartsheet/column/DecimalOptions.vue b/packages/nc-gui/components/smartsheet/column/DecimalOptions.vue
index 38b16f533e..3e7406fe42 100644
--- a/packages/nc-gui/components/smartsheet/column/DecimalOptions.vue
+++ b/packages/nc-gui/components/smartsheet/column/DecimalOptions.vue
@@ -9,15 +9,17 @@ const emit = defineEmits(['update:value'])
const precisionFormats = [1, 2, 3, 4, 5, 6, 7, 8]
+const { t } = useI18n()
+
const precisionFormatsDisplay = {
- 1: '1.0',
- 2: '1.00',
- 3: '1.000',
- 4: '1.0000',
- 5: '1.00000',
- 6: '1.000000',
- 7: '1.0000000',
- 8: '1.00000000',
+ 1: t('placeholder.decimal1'),
+ 2: t('placeholder.decimal2'),
+ 3: t('placeholder.decimal3'),
+ 4: t('placeholder.decimal4'),
+ 5: t('placeholder.decimal5'),
+ 6: t('placeholder.decimal6'),
+ 7: t('placeholder.decimal7'),
+ 8: t('placeholder.decimal8'),
}
const vModel = useVModel(props, 'value', emit)
@@ -31,7 +33,7 @@ onMounted(() => {
-
+
diff --git a/packages/nc-gui/components/smartsheet/column/DefaultValue.vue b/packages/nc-gui/components/smartsheet/column/DefaultValue.vue
index 6c205f86f1..cc266a4063 100644
--- a/packages/nc-gui/components/smartsheet/column/DefaultValue.vue
+++ b/packages/nc-gui/components/smartsheet/column/DefaultValue.vue
@@ -46,7 +46,7 @@ useProvideSmartsheetRowStore(vModel, rowRef)
- Default Value
+ {{ $t('placeholder.defaultValue') }}
diff --git a/packages/nc-gui/components/smartsheet/column/DurationOptions.vue b/packages/nc-gui/components/smartsheet/column/DurationOptions.vue
index 688c19c685..d6d844f0a2 100644
--- a/packages/nc-gui/components/smartsheet/column/DurationOptions.vue
+++ b/packages/nc-gui/components/smartsheet/column/DurationOptions.vue
@@ -26,11 +26,11 @@ vModel.value.meta = {
- A duration of time in minutes or seconds (e.g. 1:23).
+ {{ $t('labels.durationInfo') }}
-
+
{{ duration.title }}
diff --git a/packages/nc-gui/components/smartsheet/column/FormulaOptions.vue b/packages/nc-gui/components/smartsheet/column/FormulaOptions.vue
index 92a7ea3e3d..cd13e92ce1 100644
--- a/packages/nc-gui/components/smartsheet/column/FormulaOptions.vue
+++ b/packages/nc-gui/components/smartsheet/column/FormulaOptions.vue
@@ -34,6 +34,8 @@ const vModel = useVModel(props, 'value', emit)
const { formState, setAdditionalValidations, validateInfos, sqlUi, column } = useColumnCreateStoreOrThrow()
+const { t } = useI18n()
+
const { loadMagic, predictFunction: _predictFunction } = useNocoEe()
enum JSEPNode {
@@ -155,17 +157,17 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
const calleeName = parsedTree.callee.name.toUpperCase()
// validate function name
if (!availableFunctions.includes(calleeName)) {
- errors.add(`'${calleeName}' function is not available`)
+ errors.add(t('msg.formula.functionNotAvailable', { function: calleeName }))
}
// validate arguments
const validation = formulas[calleeName] && formulas[calleeName].validation
if (validation && validation.args) {
if (validation.args.rqd !== undefined && validation.args.rqd !== parsedTree.arguments.length) {
- errors.add(`'${calleeName}' required ${validation.args.rqd} arguments`)
+ errors.add(t('msg.formula.requiredArgumentsFormula', { requiredArguments: validation.args.rqd, calleeName }))
} else if (validation.args.min !== undefined && validation.args.min > parsedTree.arguments.length) {
- errors.add(`'${calleeName}' required minimum ${validation.args.min} arguments`)
+ errors.add(t('msg.formula.minRequiredArgumentsFormula', { minRequiredArguments: validation.args.min, calleeName }))
} else if (validation.args.max !== undefined && validation.args.max < parsedTree.arguments.length) {
- errors.add(`'${calleeName}' required maximum ${validation.args.max} arguments`)
+ errors.add(t('msg.formula.maxRequiredArgumentsFormula', { maxRequiredArguments: validation.args.max, calleeName }))
}
}
parsedTree.arguments.map((arg: Record) => validateAgainstMeta(arg, errors))
@@ -181,7 +183,7 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
formulaTypes.DATE,
(v: any) => {
if (!validateDateWithUnknownFormat(v)) {
- typeErrors.add('The first parameter of WEEKDAY() should have date value')
+ typeErrors.add(t('msg.formula.firstParamWeekDayHaveDate'))
}
},
typeErrors,
@@ -195,9 +197,7 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
typeof v !== 'string' ||
!['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'].includes(v.toLowerCase())
) {
- typeErrors.add(
- 'The second parameter of WEEKDAY() should have the value either "sunday", "monday", "tuesday", "wednesday", "thursday", "friday" or "saturday"',
- )
+ typeErrors.add(t('msg.formula.secondParamWeekDayHaveDate'))
}
},
typeErrors,
@@ -213,7 +213,7 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
formulaTypes.DATE,
(v: any) => {
if (!validateDateWithUnknownFormat(v)) {
- typeErrors.add('The first parameter of DATEADD() should have date value')
+ typeErrors.add(t('msg.formula.firstParamDateAddHaveDate'))
}
},
typeErrors,
@@ -224,7 +224,7 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
formulaTypes.NUMERIC,
(v: any) => {
if (typeof v !== 'number') {
- typeErrors.add('The second parameter of DATEADD() should have numeric value')
+ typeErrors.add(t('msg.formula.secondParamDateAddHaveNumber'))
}
},
typeErrors,
@@ -235,7 +235,7 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
formulaTypes.STRING,
(v: any) => {
if (!['day', 'week', 'month', 'year'].includes(v)) {
- typeErrors.add('The third parameter of DATEADD() should have the value either "day", "week", "month" or "year"')
+ typeErrors.add(typeErrors.add(t('msg.formula.thirdParamDateAddHaveDate')))
}
},
typeErrors,
@@ -247,7 +247,7 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
formulaTypes.DATE,
(v: any) => {
if (!validateDateWithUnknownFormat(v)) {
- typeErrors.add('The first parameter of DATETIME_DIFF() should have date value')
+ typeErrors.add(t('msg.formula.firstParamDateDiffHaveDate'))
}
},
typeErrors,
@@ -258,7 +258,7 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
formulaTypes.DATE,
(v: any) => {
if (!validateDateWithUnknownFormat(v)) {
- typeErrors.add('The second parameter of DATETIME_DIFF() should have date value')
+ typeErrors.add(t('msg.formula.secondParamDateDiffHaveDate'))
}
},
typeErrors,
@@ -290,9 +290,7 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
'y',
].includes(v)
) {
- typeErrors.add(
- 'The third parameter of DATETIME_DIFF() should have value either "milliseconds", "ms", "seconds", "s", "minutes", "m", "hours", "h", "days", "d", "weeks", "w", "months", "M", "quarters", "Q", "years", or "y"',
- )
+ typeErrors.add(t('msg.formula.thirdParamDateDiffHaveDate'))
}
},
typeErrors,
@@ -304,7 +302,11 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
errors = new Set([...errors, ...typeErrors])
} else if (parsedTree.type === JSEPNode.IDENTIFIER) {
if (supportedColumns.value.filter((c) => !column || column.value?.id !== c.id).every((c) => c.title !== parsedTree.name)) {
- errors.add(`Column '${parsedTree.name}' is not available`)
+ errors.add(
+ t('msg.formula.columnNotAvailable', {
+ columnName: parsedTree.name,
+ }),
+ )
}
// check circular reference
@@ -388,12 +390,12 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
}
// vertices not same as visited = cycle found
if (vertices !== visited) {
- errors.add('Can’t save field because it causes a circular reference')
+ errors.add(t('msg.formula.cantSaveCircularReference'))
}
}
} else if (parsedTree.type === JSEPNode.BINARY_EXP) {
if (!availableBinOps.includes(parsedTree.operator)) {
- errors.add(`'${parsedTree.operator}' operation is not available`)
+ errors.add(t('msg.formula.operationNotAvailable', { operation: parsedTree.operator }))
}
validateAgainstMeta(parsedTree.left, errors)
validateAgainstMeta(parsedTree.right, errors)
@@ -401,10 +403,10 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
// do nothing
} else if (parsedTree.type === JSEPNode.COMPOUND) {
if (parsedTree.body.length) {
- errors.add('Can’t save field because the formula is invalid')
+ errors.add(t('msg.formula.cantSaveFieldFormulaInvalid'))
}
} else {
- errors.add('Can’t save field because the formula is invalid')
+ errors.add(t('msg.formula.cantSaveFieldFormulaInvalid'))
}
return errors
}
@@ -418,11 +420,11 @@ function validateAgainstType(parsedTree: any, expectedType: string, func: any, t
func(parsedTree.value)
} else if (expectedType === formulaTypes.NUMERIC) {
if (typeof parsedTree.value !== 'number') {
- typeErrors.add('Numeric type is expected')
+ typeErrors.add(t('msg.formula.numericTypeIsExpected'))
}
} else if (expectedType === formulaTypes.STRING) {
if (typeof parsedTree.value !== 'string') {
- typeErrors.add('string type is expected')
+ typeErrors.add(t('msg.formula.stringTypeIsExpected'))
}
}
} else if (parsedTree.type === JSEPNode.IDENTIFIER) {
@@ -435,9 +437,14 @@ function validateAgainstType(parsedTree: any, expectedType: string, func: any, t
if (col.uidt === UITypes.Formula) {
const foundType = getRootDataType(jsep((col as any).formula_raw))
if (foundType === 'N/A') {
- typeErrors.add(`Not supported to reference column ${col.title}`)
+ typeErrors.add(t('msg.formula.notSupportedToReferenceColumn', { columnName: col.title }))
} else if (expectedType !== foundType) {
- typeErrors.add(`Type ${expectedType} is expected but found Type ${foundType}`)
+ typeErrors.add(
+ t('msg.formula.typeIsExpectedButFound', {
+ type: expectedType,
+ found: foundType,
+ }),
+ )
}
} else {
switch (col.uidt) {
@@ -451,7 +458,11 @@ function validateAgainstType(parsedTree: any, expectedType: string, func: any, t
case UITypes.URL:
if (expectedType !== formulaTypes.STRING) {
typeErrors.add(
- `Column '${parsedTree.name}' with ${formulaTypes.STRING} type is found but ${expectedType} type is expected`,
+ t('msg.formula.columnWithTypeFoundButExpected', {
+ columnName: parsedTree.name,
+ columnType: formulaTypes.STRING,
+ expectedType,
+ }),
)
}
break
@@ -466,7 +477,11 @@ function validateAgainstType(parsedTree: any, expectedType: string, func: any, t
case UITypes.Currency:
if (expectedType !== formulaTypes.NUMERIC) {
typeErrors.add(
- `Column '${parsedTree.name}' with ${formulaTypes.NUMERIC} type is found but ${expectedType} type is expected`,
+ t('msg.formula.columnWithTypeFoundButExpected', {
+ columnName: parsedTree.name,
+ columnType: formulaTypes.NUMERIC,
+ expectedType,
+ }),
)
}
break
@@ -478,7 +493,11 @@ function validateAgainstType(parsedTree: any, expectedType: string, func: any, t
case UITypes.LastModifiedTime:
if (expectedType !== formulaTypes.DATE) {
typeErrors.add(
- `Column '${parsedTree.name}' with ${formulaTypes.DATE} type is found but ${expectedType} type is expected`,
+ t('msg.formula.columnWithTypeFoundButExpected', {
+ columnName: parsedTree.name,
+ columnType: formulaTypes.DATE,
+ expectedType,
+ }),
)
}
break
@@ -498,19 +517,29 @@ function validateAgainstType(parsedTree: any, expectedType: string, func: any, t
case UITypes.Collaborator:
case UITypes.QrCode:
default:
- typeErrors.add(`Not supported to reference column '${parsedTree.name}'`)
+ typeErrors.add(t('msg.formula.notSupportedToReferenceColumn', { columnName: parsedTree.name }))
break
}
}
} else if (parsedTree.type === JSEPNode.UNARY_EXP || parsedTree.type === JSEPNode.BINARY_EXP) {
if (expectedType !== formulaTypes.NUMERIC) {
// parsedTree.name won't be available here
- typeErrors.add(`${formulaTypes.NUMERIC} type is found but ${expectedType} type is expected`)
+ typeErrors.add(
+ t('msg.formula.typeIsExpectedButFound', {
+ type: formulaTypes.NUMERIC,
+ found: expectedType,
+ }),
+ )
}
} else if (parsedTree.type === JSEPNode.CALL_EXP) {
const calleeName = parsedTree.callee.name.toUpperCase()
if (formulas[calleeName]?.type && expectedType !== formulas[calleeName].type) {
- typeErrors.add(`${expectedType} not matched with ${formulas[calleeName].type}`)
+ typeErrors.add(
+ t('msg.formula.typeIsExpectedButFound', {
+ type: expectedType,
+ found: formulas[calleeName].type,
+ }),
+ )
}
}
return typeErrors
@@ -692,7 +721,7 @@ const predictFunction = async () => {
| |