Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Fix issue when trying to fetch a translation with a country based locale #264

Merged
merged 3 commits into from
Aug 18, 2016

Conversation

vcarreira
Copy link
Contributor

Fix issue when trying to fetch a translation with a country based (e.g. 'pt-PT') and the only translation available is for the fallback locale.

Cover the scenario where the configured fallback locale is 'en', you are trying to fetch a translation for 'pt-PT' but the model only has a translation to 'en'. As it was before the code would attempt to fetch a translation for 'pt' twice instead of trying 'pt' first and then use the configured fallback locale.

…g. 'pt-PT') and the only translation available is for the fallback locale.

Cover the scenario where the configured fallback locale is 'en', you are trying to fetch a translation for 'pt-PT'
but the model only have a translation to 'en'. As it was before the code would attempt to fetch a translation for 'pt' twice instead of trying 'pt' first and then the configured fallback locale.
@dimsav
Copy link
Owner

dimsav commented Aug 18, 2016

Hi @vcarreira and thanks for your contribution! Can you please write a test that your change fixes?

@vcarreira
Copy link
Contributor Author

Hi @dimsav I added the requested test and thanks for this amazing package. Glad to be able to make a very small contribution.

@dimsav
Copy link
Owner

dimsav commented Aug 18, 2016

Awesome work, thanks a bunch!

@dimsav dimsav merged commit 1fe72c4 into dimsav:master Aug 18, 2016
@dimsav
Copy link
Owner

dimsav commented Aug 19, 2016

Fix was released in v6.0.1!

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

Successfully merging this pull request may close these issues.

None yet

2 participants