Browse Source

fix: i18n for Barcode

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

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

@ -46,7 +46,7 @@ useProvideSmartsheetRowStore(vModel, rowRef)
</script> </script>
<template> <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="flex flex-row gap-2">
<div class="border-1 flex items-center w-full px-3 my-[-4px] border-gray-300 rounded-md"> <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" /> <LazySmartsheetCell :column="vModel" :model-value="cdfValue" :edit-enabled="true" />

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

@ -737,6 +737,9 @@
"clientCA": "Select CA file" "clientCA": "Select CA file"
}, },
"placeholder": { "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", "projName": "Enter Project Name",
"selectGroupField": "Select a Grouping Field", "selectGroupField": "Select a Grouping Field",
"selectGroupFieldNotFound" : "No Single Select Field can be found. Please create one first.", "selectGroupFieldNotFound" : "No Single Select Field can be found. Please create one first.",
@ -761,6 +764,7 @@
"selectField": "Select field" "selectField": "Select field"
}, },
"msg": { "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": { "hm": {
"title": "Has Many Relation", "title": "Has Many Relation",
"icon": "HasManyIcon", "icon": "HasManyIcon",

Loading…
Cancel
Save