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

allowed locales by country #128

Open
bonswouar opened this issue Nov 18, 2014 · 5 comments
Open

allowed locales by country #128

bonswouar opened this issue Nov 18, 2014 · 5 comments

Comments

@bonswouar
Copy link

I'm trying to use this bundle to identify a country (Belgium), which has lots of locales (fr_BE, wa_BE, nl_BE).

Instead of having to add all the allowed locales, isn't it possible to add only the country (BE) to match all of these ?

If I'm not mistaking, with non-strict mode, it works only the other way (nl to match nl_NL and nl_BE).

@lunetics
Copy link
Collaborator

Hi bonswouar,

that's not possible right now. Just write these locales into the config, not worth the hassle really :)

@bonswouar
Copy link
Author

Okay, that's fine for me, just wanted to be sure I wasn't missing something. :)

Though, I'm still not sure I'm using the Bundle properly..

I want the locale to be one of the Belgium one, or if none is matched to be the fr_FR one (also defined as default_locale in the framework settings).
But now I'm testing with the Quick Locale Switcher, to set my locale to en_US, and I get fr_BE (instead of the expected fr_FR).
Any idea what's wrong with my configuration (see bellow) ?

lunetics_locale:
  strict_mode: true
  allowed_locales:
    - fr_FR
    - wa_BE
    - nl_BE
    - fl_BE
    - fr_BE
  guessing_order:
    - session
    - cookie
    - browser
    - query
    - router

@bonswouar
Copy link
Author

Hmm I guess that was a cache problem, it works as expected now... So the question would more likely be : how to test this Bundle properly ? ;)

@bonswouar
Copy link
Author

@lunetics : Also, I'd like to do a custom guesser with Geocoder..
But apparently, for about the same reason than it's not possible to match a country, it's not possible to make this kind of guesser..
Don't you think it would be useful to be able to filter on the Country (with the IP in my example) ?

An implementation I'm thinking about would be for example to let the possibility for a guesser to filter the allowedLocales (remove the ones that are not in the country), except if there is only one possibility.

What do you think about it ?

@coudenysj
Copy link
Contributor

@lunetics I'm not sure this ticket can be handled through configuration only.

Next to different environments, I would be forced to introduce a new "country" ENV variable an start loading different configuration files.

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

3 participants