Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for adding other languages support #86

Open
akaibukai opened this issue Sep 6, 2020 · 1 comment
Open

Suggestion for adding other languages support #86

akaibukai opened this issue Sep 6, 2020 · 1 comment

Comments

@akaibukai
Copy link

Hi,

I'm interested to contribute in order to offer some sort of localization of the inflexions.
Before going to add a particular language.
I wanted to discuss for the "architecture" of handling the configuration of the locale setting.

I see three ways to do it internally with both a global default and an option to do it per function.
But in any case, this needs to have all the inflexions mechanisms (I mean all the string manipulation and matching functions) separated from all the language related rules and data.

  1. Using the Elixir Config module and setting a locale config value (eg. "en", "fr", etc.)
  2. Using an optional key-value parameter (eg. locale: "fr") in each function
  3. Using a dedicated function that can be invoked at any time to set the locale from that moment on (not fan of that, but it's a possibility)

Another option could be to handle the localization setting itself outside with for example ex_cldr. This needs an extra dependency, but it's possible to add it for those already using a package already using it (like ex_money).
But in this case all the language related rules and data should still be done internally.

Again it's necessary in any case to separate the string manipulation mechanisms with the language data rules themselves.
In this situation, it can be even possible to separate all the data as a separate package (or not).

What do you think?

@nurugger07
Copy link
Owner

i really like the idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants