Browse Source

fix: i18n for PhoneNumber

pull/6519/head
Muhammed Mustafa 1 year ago
parent
commit
4e9adfeec8
  1. 8
      packages/nc-gui/components/cell/PhoneNumber.vue

8
packages/nc-gui/components/cell/PhoneNumber.vue

@ -15,6 +15,8 @@ const rowHeight = inject(RowHeightInj, ref(undefined))
const { showNull } = useGlobal() const { showNull } = useGlobal()
const { t } = useI18n()
const editEnabled = inject(EditModeInj)! const editEnabled = inject(EditModeInj)!
const isEditColumn = inject(EditColumnInj, ref(false)) const isEditColumn = inject(EditColumnInj, ref(false))
@ -46,7 +48,7 @@ watch(
() => editEnabled.value, () => editEnabled.value,
() => { () => {
if (parseProp(column.value.meta)?.validate && !editEnabled.value && localState.value && !isMobilePhone(localState.value)) { if (parseProp(column.value.meta)?.validate && !editEnabled.value && localState.value && !isMobilePhone(localState.value)) {
message.error('Invalid Phone Number') message.error(t('msg.invalidPhoneNumber'))
localState.value = undefined localState.value = undefined
return return
} }
@ -61,7 +63,7 @@ watch(
:ref="focus" :ref="focus"
v-model="vModel" v-model="vModel"
class="w-full outline-none text-sm px-1 py-2" class="w-full outline-none text-sm px-1 py-2"
:placeholder="isEditColumn ? '(Optional)' : ''" :placeholder="isEditColumn ? $t('labels.optional') : ''"
@blur="editEnabled = false" @blur="editEnabled = false"
@keydown.down.stop @keydown.down.stop
@keydown.left.stop @keydown.left.stop
@ -74,7 +76,7 @@ watch(
@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 uppercase">{{ $t('general.null') }}</span>
<a v-else-if="validEmail" class="text-sm underline hover:opacity-75" :href="`tel:${vModel}`" target="_blank"> <a v-else-if="validEmail" class="text-sm underline hover:opacity-75" :href="`tel:${vModel}`" target="_blank">
<LazyCellClampedText :value="vModel" :lines="rowHeight" /> <LazyCellClampedText :value="vModel" :lines="rowHeight" />

Loading…
Cancel
Save