maz-ui
maz-ui copied to clipboard
[FEATURE] Allow dropdown countries list translation
Currently, if the locale set to de
countries list still in en
.
Current:
:translations="{
countrySelectorLabel: 'Code pays',
countrySelectorError: 'Choisir un pays',
phoneNumberLabel: 'Numéro de téléphone',
example: 'Exemple :'
}"
Expected:
:translations="{
countrySelectorLabel: 'Code pays',
countrySelectorError: 'Choisir un pays',
phoneNumberLabel: 'Numéro de téléphone',
example: 'Exemple :'
countries: {
en: {
'ru': 'Russia',
'de: 'Germany'
...
},
de: {
'ru': 'Russland',
'de': 'Deutschland',
...
},
}"
It would be even better if the component can take a locale like "fr_ca" and translate it to the corresponding regional language. Can we add this feature please?
Hey @seyfer,
It's available ! See documentation: https://louismazel.github.io/maz-ui-3/components/maz-phone-number-input.html#countries-list
Enjoy :)
You can override countries names with the prop custom-countries-list
<template>
<MazPhoneNumberInput
:custom-countries-list="{
FR: 'France',
BE: 'Belgique',
DE: 'Allemagne',
US: 'Etats-Unis',
}"
/>
</template>