Browse Source

fix: i18n for DateTime

pull/6519/head
Muhammed Mustafa 1 year ago
parent
commit
9da0677280
  1. 8
      packages/nc-gui/components/cell/DateTimePicker.vue
  2. 4
      packages/nc-gui/components/smartsheet/column/DateTimeOptions.vue
  3. 1
      packages/nc-gui/lang/en.json

8
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 ''
}

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

@ -21,14 +21,14 @@ if (!vModel.value.meta?.time_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" class="nc-date-select" dropdown-class-name="nc-dropdown-date-format">
<a-select-option v-for="(format, i) of dateFormats" :key="i" :value="format">
{{ format }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="Time Format">
<a-form-item :label="$t('labels.timeFormat')">
<a-select v-model:value="vModel.meta.time_format" class="nc-time-select" dropdown-class-name="nc-dropdown-time-format">
<a-select-option v-for="(format, i) of timeFormats" :key="i" :value="format">
{{ format }}

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

@ -350,6 +350,7 @@
},
"labels": {
"dateFormat": "Date Format",
"timeFormat": "Time Format",
"singularLabel": "Singular Label",
"pluralLabel": "Plural Label",
"optional": "Optional",

Loading…
Cancel
Save