Browse Source

fix: i18n for Barcode

pull/6519/head
Muhammed Mustafa 11 months ago
parent
commit
a17d512e45
  1. 15
      packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue
  2. 2
      packages/nc-gui/components/smartsheet/column/DefaultValue.vue
  3. 4
      packages/nc-gui/lang/en.json

15
packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue

@ -22,6 +22,8 @@ const vModel = useVModel(props, 'modelValue', emit)
const { setAdditionalValidations, validateInfos, column } = useColumnCreateStoreOrThrow()
const { t } = useI18n()
const columnsAllowedAsBarcodeValue = computed<SelectProps['options']>(() => {
return fields.value
?.filter(
@ -67,8 +69,8 @@ watch(columnsAllowedAsBarcodeValue, (newColumnsAllowedAsBarcodeValue) => {
})
setAdditionalValidations({
fk_barcode_value_column_id: [{ required: true, message: 'Required' }],
barcode_format: [{ required: true, message: 'Required' }],
fk_barcode_value_column_id: [{ required: true, message: t('general.required') }],
barcode_format: [{ required: true, message: t('general.required') }],
})
const showBarcodeValueColumnInfoIcon = computed(() => !columnsAllowedAsBarcodeValue.value?.length)
@ -86,16 +88,15 @@ const showBarcodeValueColumnInfoIcon = computed(() => !columnsAllowedAsBarcodeVa
<a-select
v-model:value="vModel.fk_barcode_value_column_id"
:options="columnsAllowedAsBarcodeValue"
placeholder="Select a column for the Barcode value"
not-found-content="No valid Column Type can be found."
:placeholder="$t('placeholder.barcodeColumn')"
:not-found-content="$t('placeholder.notFoundContent')"
@click.stop
/>
<div v-if="showBarcodeValueColumnInfoIcon" class="pl-2">
<a-tooltip placement="bottom">
<template #title>
<span>
The valid Column Types for a Barcode Column are: Number, Single Line Text, Long Text, Phone Number, URL, Email,
Decimal. Please create one first.
{{ $t('msg.validColumnsForBarCode') }}
</span>
</template>
<component :is="iconMap.info" class="cursor-pointer" />
@ -111,7 +112,7 @@ const showBarcodeValueColumnInfoIcon = computed(() => !columnsAllowedAsBarcodeVa
<a-select
v-model:value="vModel.meta.barcodeFormat"
:options="supportedBarcodeFormats"
placeholder="Select a Barcode format"
:placeholder="$t('placeholder.selectBarcodeFormat')"
@click.stop
/>
</a-form-item>

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

@ -46,7 +46,7 @@ useProvideSmartsheetRowStore(vModel, rowRef)
</script>
<template>
<div class="!my-3 text-xs">Default Value</div>
<div class="!my-3 text-xs">{{ $t('placeholder.defaultValue') }}</div>
<div class="flex flex-row gap-2">
<div class="border-1 flex items-center w-full px-3 my-[-4px] border-gray-300 rounded-md">
<LazySmartsheetCell :column="vModel" :model-value="cdfValue" :edit-enabled="true" />

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

@ -737,6 +737,9 @@
"clientCA": "Select CA file"
},
"placeholder": {
"barcodeColumn": "Select a column for the Barcode value",
"notFoundContent": "No valid Column Type can be found.",
"selectBarcodeFormat": "Select a Barcode format",
"projName": "Enter Project Name",
"selectGroupField": "Select a Grouping Field",
"selectGroupFieldNotFound" : "No Single Select Field can be found. Please create one first.",
@ -761,6 +764,7 @@
"selectField": "Select field"
},
"msg": {
"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",
"icon": "HasManyIcon",

Loading…
Cancel
Save