Merge refactor/i18n into develop

This commit is contained in:
Methapon Metanipat 2024-08-26 16:24:08 +07:00
parent 3da5bf9079
commit c681b19e39
99 changed files with 2192 additions and 2987 deletions

View file

@ -164,7 +164,7 @@ watch(districtId, fetchSubDistrict);
style="background-color: var(--surface-3)"
/>
{{ title || $t('formDialogTitlePersonnelAddress') }}
{{ (title && $t(title)) || $t('form.field.address') }}
<div
v-if="employee"
@ -181,7 +181,7 @@ watch(districtId, fetchSubDistrict);
}"
@click="readonly ? '' : (sameWithEmployer = true)"
>
{{ $t('formDialogToggleSameAddress') }}
{{ $t('customerEmployee.form.addressSame') }}
</span>
<span
:id="`${prefixId}-custom`"
@ -193,7 +193,7 @@ watch(districtId, fetchSubDistrict);
}"
@click="readonly ? '' : (sameWithEmployer = false)"
>
{{ $t('formDialogToggleCustomAddress') }}
{{ $t('customerEmployee.form.addressCustom') }}
</span>
</div>
</div>
@ -201,7 +201,7 @@ watch(districtId, fetchSubDistrict);
<div class="col-12 row q-col-gutter-y-md">
<div class="col-12 app-text-muted-2">
<q-icon size="xs" class="q-mr-xs" name="mdi-map-marker-outline" />
{{ addressTitle || $t('formDialogTitleAddressPure') }}
{{ addressTitle || $t('form.address') }}
</div>
<div class="col-12 row q-col-gutter-sm">
<div class="row col-12" v-if="useWorkPlace">
@ -220,8 +220,7 @@ watch(districtId, fetchSubDistrict);
? []
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputAddressValidate'),
(val && val.length > 0) || $t('form.error.required'),
]
"
/>
@ -234,17 +233,13 @@ watch(districtId, fetchSubDistrict);
v-model="address"
lazy-rules="ondemand"
:dense="dense"
:label="$t('address')"
:label="$t('form.address')"
:readonly="readonly || sameWithEmployer"
:for="`${prefixId}-${indexId !== undefined ? `input-address-${indexId}` : 'input-address'}`"
:rules="
disabledRule
? []
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputAddressValidate'),
]
: [(val) => (val && val.length > 0) || $t('form.error.required')]
"
/>
<q-select
@ -264,7 +259,7 @@ watch(districtId, fetchSubDistrict);
lazy-rules="ondemand"
class="col-md-3 col-6"
:dense="dense"
:label="$t('province')"
:label="$t('form.province')"
:options="provinceOptions"
:readonly="readonly || sameWithEmployer"
:hide-dropdown-icon="readonly || sameWithEmployer"
@ -275,7 +270,9 @@ watch(districtId, fetchSubDistrict);
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputProvinceValidate'),
$t('form.error.selectField', {
field: $t('form.province'),
}),
]
"
@filter="provinceFilter"
@ -284,7 +281,7 @@ watch(districtId, fetchSubDistrict);
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -307,7 +304,7 @@ watch(districtId, fetchSubDistrict);
lazy-rules="ondemand"
class="col-md-3 col-6"
:dense="dense"
:label="$t('district')"
:label="$t('form.district')"
:options="districtOptions"
:readonly="readonly || sameWithEmployer"
:hide-dropdown-icon="readonly || sameWithEmployer"
@ -318,7 +315,9 @@ watch(districtId, fetchSubDistrict);
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputDistrictValidate'),
$t('form.error.selectField', {
field: $t('form.district'),
}),
]
"
@filter="districtFilter"
@ -327,7 +326,7 @@ watch(districtId, fetchSubDistrict);
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -349,7 +348,7 @@ watch(districtId, fetchSubDistrict);
class="col-md-3 col-6"
v-model="subDistrictId"
:dense="dense"
:label="$t('subDistrict')"
:label="$t('form.subDistrict')"
:options="subDistrictOptions"
:readonly="readonly || sameWithEmployer"
:hide-dropdown-icon="readonly || sameWithEmployer"
@ -360,7 +359,9 @@ watch(districtId, fetchSubDistrict);
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputSubDistrictValidate'),
$t('form.error.selectField', {
field: $t('form.subDistrict'),
}),
]
"
@update:model-value="(v: string) => selectSubDistrict(v)"
@ -369,7 +370,7 @@ watch(districtId, fetchSubDistrict);
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -381,7 +382,7 @@ watch(districtId, fetchSubDistrict);
outlined
:disable="!readonly"
readonly
:label="$t('zipCode')"
:label="$t('form.zipCode')"
class="col-md-2 col-6"
:model-value="
addrOptions.subDistrictOps
@ -393,7 +394,7 @@ watch(districtId, fetchSubDistrict);
<div class="col-12 app-text-muted-2">
<q-icon size="xs" class="q-mr-xs" name="mdi-map-marker-outline" />
{{ addressTitleEN || $t('formDialogTitleAddressPureEN') }}
{{ addressTitleEN || $t('form.address', { suffix: '(EN)' }) }}
</div>
<div class="col-12 row q-col-gutter-sm">
<div class="row col-12" v-if="useWorkPlace">
@ -412,8 +413,7 @@ watch(districtId, fetchSubDistrict);
? []
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputAddressValidate'),
(val && val.length > 0) || $t('form.error.required'),
]
"
/>
@ -426,17 +426,13 @@ watch(districtId, fetchSubDistrict);
:readonly="readonly || sameWithEmployer"
outlined
hide-bottom-space
:label="$t('address')"
:label="$t('form.address', { suffix: '(EN)' })"
class="col-12"
v-model="addressEN"
:rules="
disabledRule
? []
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputAddressValidate'),
]
: [(val) => (val && val.length > 0) || $t('form.error.required')]
"
/>
<q-select
@ -456,7 +452,7 @@ watch(districtId, fetchSubDistrict);
option-label="nameEN"
class="col-md-3 col-6"
:dense="dense"
:label="$t('province')"
:label="$t('form.province')"
:options="provinceOptions"
:readonly="readonly || sameWithEmployer"
:hide-dropdown-icon="readonly || sameWithEmployer"
@ -467,7 +463,9 @@ watch(districtId, fetchSubDistrict);
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputProvinceValidate'),
$t('form.error.selectField', {
field: $t('form.province'),
}),
]
"
@update:model-value="districtId = subDistrictId = zipCode = null"
@ -476,7 +474,7 @@ watch(districtId, fetchSubDistrict);
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -498,7 +496,7 @@ watch(districtId, fetchSubDistrict);
option-label="nameEN"
class="col-md-3 col-6"
:dense="dense"
:label="$t('district')"
:label="$t('form.district')"
:options="districtOptions"
:readonly="readonly || sameWithEmployer"
:hide-dropdown-icon="readonly || sameWithEmployer"
@ -509,7 +507,9 @@ watch(districtId, fetchSubDistrict);
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputDistrictValidate'),
$t('form.error.selectField', {
field: $t('form.district'),
}),
]
"
@update:model-value="subDistrictId = zipCode = null"
@ -518,7 +518,7 @@ watch(districtId, fetchSubDistrict);
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -540,7 +540,7 @@ watch(districtId, fetchSubDistrict);
class="col-md-3 col-6"
v-model="subDistrictId"
:dense="dense"
:label="$t('subDistrict')"
:label="$t('form.subDistrict')"
:options="subDistrictOptions"
:readonly="readonly || sameWithEmployer"
:hide-dropdown-icon="readonly || sameWithEmployer"
@ -551,7 +551,9 @@ watch(districtId, fetchSubDistrict);
: [
(val) =>
(val && val.length > 0) ||
$t('formDialogInputSubDistrictValidate'),
$t('form.error.selectField', {
field: $t('form.subDistrict'),
}),
]
"
@update:model-value="(v: string) => selectSubDistrict(v)"
@ -560,7 +562,7 @@ watch(districtId, fetchSubDistrict);
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -574,7 +576,7 @@ watch(districtId, fetchSubDistrict);
readonly
:disable="!readonly"
zip="zip-en"
:label="$t('zipCode')"
:label="$t('form.zipCode')"
class="col-md-2 col-6"
:model-value="
addrOptions.subDistrictOps