Browse Source

fix: i18n for Currnecy

pull/6519/head
Muhammed Mustafa 11 months ago
parent
commit
e413a220dd
  1. 4
      packages/nc-gui/components/cell/Currency.vue
  2. 12
      packages/nc-gui/components/smartsheet/column/CurrencyOptions.vue
  3. 5
      packages/nc-gui/lang/en.json

4
packages/nc-gui/components/cell/Currency.vue

@ -79,7 +79,7 @@ onMounted(() => {
v-model="vModel"
type="number"
class="w-full h-full text-sm border-none rounded-md outline-none"
:placeholder="isEditColumn ? '(Optional)' : ''"
:placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="submitCurrency"
@keydown.down.stop
@keydown.left.stop
@ -93,7 +93,7 @@ onMounted(() => {
@contextmenu.stop
/>
<span v-else-if="vModel === null && showNull" class="nc-null">NULL</span>
<span v-else-if="vModel === null && showNull" class="nc-null">{{ $t('labels.null') }}</span>
<!-- only show the numeric value as previously string value was accepted -->
<span v-else-if="!isNaN(vModel)">{{ currency }}</span>

12
packages/nc-gui/components/smartsheet/column/CurrencyOptions.vue

@ -12,6 +12,8 @@ const props = defineProps<{
const emit = defineEmits(['update:value'])
const { t } = useI18n()
const vModel = useVModel(props, 'value', emit)
const validators = {
@ -20,7 +22,7 @@ const validators = {
validator: (_: any, locale: any) => {
return new Promise<void>((resolve, reject) => {
if (!validateCurrencyLocale(locale)) {
return reject(new Error('Invalid locale'))
return reject(new Error(t('msg.invalidLocale')))
}
resolve()
})
@ -32,7 +34,7 @@ const validators = {
validator: (_: any, currencyCode: any) => {
return new Promise<void>((resolve, reject) => {
if (!validateCurrencyCode(currencyCode)) {
return reject(new Error('Invalid Currency Code'))
return reject(new Error(t('msg.invalidCurrencyCode')))
}
resolve()
})
@ -54,7 +56,7 @@ const currencyLocaleList = ref<{ text: string; value: string }[]>([])
const isMoney = computed(() => vModel.value.dt === 'money')
const message = computed(() => {
if (isMoney.value && isPg.value) return "PostgreSQL 'money' type has own currency settings"
if (isMoney.value && isPg.value) return t('msg.postgresHasItsOwnCurrencySettings')
return ''
})
@ -77,7 +79,7 @@ currencyLocales().then((locales) => {
<template>
<a-row gutter="8">
<a-col :span="12">
<a-form-item v-bind="validateInfos['meta.currency_locale']" label="Currency Locale">
<a-form-item v-bind="validateInfos['meta.currency_locale']" :label="$t('title.currencyLocale')">
<a-select
v-model:value="vModel.meta.currency_locale"
class="w-52"
@ -94,7 +96,7 @@ currencyLocales().then((locales) => {
</a-col>
<a-col :span="12">
<a-form-item v-bind="validateInfos['meta.currency_code']" label="Currency Code">
<a-form-item v-bind="validateInfos['meta.currency_code']" :label="$t('title.currencyCode')">
<a-select
v-model:value="vModel.meta.currency_code"
class="w-52"

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

@ -258,6 +258,8 @@
"isNotNull": "is not null"
},
"title": {
"currencyLocale": "Currency Locale",
"currencyCode": "Currency Code",
"searchMembers": "Search Members",
"noMembersFound": "No members found",
"dateJoined": "Date Joined",
@ -764,6 +766,9 @@
"selectField": "Select field"
},
"msg": {
"invalidLocale": "Invalid locale",
"invalidCurrencyCode": "Invalid Currency Code",
"postgresHasItsOwnCurrencySettings": "PostgreSQL 'money' type has own currency settings",
"validColumnsForBarCode": "The valid Column Types for a Barcode Column are: Number, Single Line Text, Long Text, Phone Number, URL, Email, Decimal. Please create one first.",
"hm": {
"title": "Has Many Relation",

Loading…
Cancel
Save