hasura-auth icon indicating copy to clipboard operation
hasura-auth copied to clipboard

Allow locale with country in locale in users table

Open alveshelio opened this issue 2 years ago • 2 comments

Right now, the users table has a column locale which unfortunately only accepts the locale and not the locale plus country. Working with internationalization means that we need to take into account not only the locale but also the country since there's a lot of information that depends on the country.

We should be able to enter en-ca, fr-ca, pt-pt, pt-br, etc

alveshelio avatar Nov 21 '21 00:11 alveshelio

A possible solution discussed with @plmercereau:

Change the locale field to varchar(5) and allow en and en-gb. The behavior with email templates would be as follows:

  • if only en is used, try to match with a directory with the same name.
  • if en-gb is used, try to match with a directory with the same name.
    • if the directory doesn't exist, fallback to en

/cc @elitan @plmercereau @alveshelio

nunopato avatar May 16 '22 09:05 nunopato

@alveshelio What is the use case for you? My initial thinking with locale was to store language information only for for email templates using ISO 639-1 codes but do you plan to also use it for location/region too?

Would you have different email templates for pt-pt and pt-br?

For reference, docs from firebase: https://firebase.google.com/docs/auth/custom-email-handler#:~:text=an%20email%20action.-,lang,-This%20is%20the

Firebase uses lang instead of locale.

elitan avatar May 20 '22 19:05 elitan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 11 '23 15:05 stale[bot]