Browse Source

fix: i18n for Decimal

pull/6519/head
Muhammed Mustafa 12 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" class="outline-none !py-2 !px-1 border-none rounded-md w-full h-full !text-sm"
type="number" type="number"
:step="precision" :step="precision"
:placeholder="isEditColumn ? '(Optional)' : ''" :placeholder="isEditColumn ? $t('labels.optional') : ''"
style="letter-spacing: 0.06rem" style="letter-spacing: 0.06rem"
@blur="editEnabled = false" @blur="editEnabled = false"
@keydown.down.stop="onKeyDown" @keydown.down.stop="onKeyDown"
@ -110,7 +110,7 @@ watch(isExpandedFormOpen, () => {
@selectstart.capture.stop @selectstart.capture.stop
@mousedown.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> <span v-else class="text-sm">{{ displayValue }}</span>
</template> </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 precisionFormats = [1, 2, 3, 4, 5, 6, 7, 8]
const { t } = useI18n()
const precisionFormatsDisplay = { const precisionFormatsDisplay = {
1: '1.0', 1: t('placeholder.decimal1'),
2: '1.00', 2: t('placeholder.decimal2'),
3: '1.000', 3: t('placeholder.decimal3'),
4: '1.0000', 4: t('placeholder.decimal4'),
5: '1.00000', 5: t('placeholder.decimal5'),
6: '1.000000', 6: t('placeholder.decimal6'),
7: '1.0000000', 7: t('placeholder.decimal7'),
8: '1.00000000', 8: t('placeholder.decimal8'),
} }
const vModel = useVModel(props, 'value', emit) const vModel = useVModel(props, 'value', emit)
@ -31,7 +33,7 @@ onMounted(() => {
</script> </script>
<template> <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 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"> <a-select-option v-for="(format, i) of precisionFormats" :key="i" :value="format">
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">

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

@ -765,7 +765,16 @@
"defaultValue": "Default value", "defaultValue": "Default value",
"filterByEmail": "Filter by E-mail", "filterByEmail": "Filter by E-mail",
"filterQuery": "Filter query", "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": { "msg": {
"invalidDate": "Invalid date", "invalidDate": "Invalid date",

Loading…
Cancel
Save