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

When enforce_available_locales is enabled only set available locales #116

Merged
merged 1 commit into from
Jul 18, 2017
Merged

When enforce_available_locales is enabled only set available locales #116

merged 1 commit into from
Jul 18, 2017

Conversation

pacoguzman
Copy link
Contributor

This PR implements #14

When the enforce_available_locales flag is enabled, which is the default setting a locale that is not in the list of available locales an InvalidLocale exception is raised. With this changes we're going to set only available locales when is enabled, and any locale when it's not.

A slightly difference with the proposal code from the issue is that we're comparing the full language codes without fallback. So I'm not sure if this PR is too restricted in this way

@mpalmer
Copy link
Contributor

mpalmer commented Aug 7, 2015

Hi @pacoguzman, thanks for doing this work. Having this code in a PR will make it much easier to work with and get it merged. I'll review it over the next few days and get back to you with comments.

One thing I notice is that the CI runs are failing, on all of the "minimum versions" gemfiles. I'd appreciate it if you could fix that up (I expect a gem just needs a bump in minimum version, both in the test gemfile and also a corresponding change in the gemspec).

@pacoguzman
Copy link
Contributor Author

Oh sorry I didn't check that, I'll try to solve that failure.

@pacoguzman
Copy link
Contributor Author

I fixed the specs on I18n 0.4.0 that method is not defined, so I just check if i18n responds to that method

@mpalmer
Copy link
Contributor

mpalmer commented Aug 7, 2015

I'd prefer it if the behaviour of the middleware didn't depend on which version of a gem was installed, especially if that behaviour difference isn't very well-documented. Please determine which version of i18n introduced the method, and bump the dependencies to that version.

@pacoguzman
Copy link
Contributor Author

Hi Matt I bump the dependencies to the first one where that method is defined, please take a look

@zedtux
Copy link

zedtux commented Feb 18, 2017

@mpalmer can you please review this PR and merge it?

@mpalmer mpalmer merged commit 0f75e75 into rack:master Jul 18, 2017
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

Successfully merging this pull request may close these issues.

3 participants