Browse Source

fix: i18n for Decimal

pull/6519/head
Muhammed Mustafa 11 months ago
parent
commit
c52b281cb4
  1. 4
      packages/nc-gui/components/cell/Decimal.vue
  2. 20
      packages/nc-gui/components/smartsheet/column/DecimalOptions.vue
  3. 11
      packages/nc-gui/lang/en.json

4
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
/>
<span v-else-if="vModel === null && showNull" class="nc-null">NULL</span>
<span v-else-if="vModel === null && showNull" class="nc-null capitalize">{{ $t('general.null') }}</span>
<span v-else class="text-sm">{{ displayValue }}</span>
</template>

20
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(() => {
</script>
<template>
<a-form-item label="Precision">
<a-form-item :label="$t('placeholder.precision')">
<a-select v-model:value="vModel.meta.precision" dropdown-class-name="nc-dropdown-decimal-format">
<a-select-option v-for="(format, i) of precisionFormats" :key="i" :value="format">
<div class="flex flex-row items-center">

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

@ -765,7 +765,16 @@
"defaultValue": "Default value",
"filterByEmail": "Filter by E-mail",
"filterQuery": "Filter query",
"selectField": "Select field"
"selectField": "Select field",
"precision": "Precision",
"decimal1": "1.0",
"decimal2": "1.00",
"decimal3": "1.000",
"decimal4": "1.0000",
"decimal5": "1.00000",
"decimal6": "1.000000",
"decimal7": "1.0000000",
"decimal8": "1.00000000"
},
"msg": {
"invalidDate": "Invalid date",

Loading…
Cancel
Save