Browse Source

fix: i18n for Date

pull/6519/head
Muhammed Mustafa 12 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 emit = defineEmits(['update:modelValue'])
const { t } = useI18n()
const { showNull } = useGlobal() const { showNull } = useGlobal()
const columnMeta = inject(ColumnInj, null)! const columnMeta = inject(ColumnInj, null)!
@ -84,11 +86,11 @@ watch(
const placeholder = computed(() => { const placeholder = computed(() => {
if (isEditColumn.value && (modelValue === '' || modelValue === null)) { if (isEditColumn.value && (modelValue === '' || modelValue === null)) {
return '(Optional)' return t('labels.optional')
} else if (modelValue === null && showNull.value) { } else if (modelValue === null && showNull.value) {
return 'NULL' return t('general.null')
} else if (isDateInvalid.value) { } else if (isDateInvalid.value) {
return 'Invalid date' return t('msg.invalidDate')
} else { } else {
return '' return ''
} }

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

@ -16,7 +16,7 @@ if (!vModel.value.meta?.date_format) {
</script> </script>
<template> <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 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"> <a-select-option v-for="(format, i) of dateFormats" :key="i" :value="format">
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">

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

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

Loading…
Cancel
Save