maz-ui icon indicating copy to clipboard operation
maz-ui copied to clipboard

[FEATURE] Allow dropdown countries list translation

Open seyfer opened this issue 3 years ago • 1 comments

Currently, if the locale set to de countries list still in en.

Screenshot 2021-04-23 at 15 58 05

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',
...
        },
}"

seyfer avatar Apr 23 '21 14:04 seyfer

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?

roselily8 avatar May 06 '21 02:05 roselily8

Hey @seyfer,

It's available ! See documentation: https://louismazel.github.io/maz-ui-3/components/maz-phone-number-input.html#countries-list

Enjoy :)

LouisMazel avatar Dec 06 '22 18:12 LouisMazel

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>

LouisMazel avatar Dec 06 '22 19:12 LouisMazel