Browse Source

fix: i18n for Date

pull/6519/head
Muhammed Mustafa 11 months ago
parent
commit
37312c5669
  1. 8
      packages/nc-gui/components/cell/DatePicker.vue
  2. 2
      packages/nc-gui/components/smartsheet/column/DateOptions.vue
  3. 2
      packages/nc-gui/lang/en.json

8
packages/nc-gui/components/cell/DatePicker.vue

@ -25,6 +25,8 @@ const { modelValue, isPk } = defineProps<Props>()
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 ''
}

2
packages/nc-gui/components/smartsheet/column/DateOptions.vue

@ -16,7 +16,7 @@ if (!vModel.value.meta?.date_format) {
</script>
<template>
<a-form-item label="Date Format">
<a-form-item :label="$t('labels.dateFormat')">
<a-select v-model:value="vModel.meta.date_format" dropdown-class-name="nc-dropdown-date-format">
<a-select-option v-for="(format, i) of dateFormats" :key="i" :value="format">
<div class="flex flex-row items-center">

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

@ -349,6 +349,7 @@
"renameFile": "Rename File"
},
"labels": {
"dateFormat": "Date Format",
"singularLabel": "Singular Label",
"pluralLabel": "Plural Label",
"optional": "Optional",
@ -766,6 +767,7 @@
"selectField": "Select field"
},
"msg": {
"invalidDate": "Invalid date",
"invalidLocale": "Invalid locale",
"invalidCurrencyCode": "Invalid Currency Code",
"postgresHasItsOwnCurrencySettings": "PostgreSQL 'money' type has own currency settings",

Loading…
Cancel
Save