Skip to content
This repository has been archived by the owner. 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

commented Aug 18, 2016

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.

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 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

This comment has been minimized.

Copy link
Owner

commented Aug 18, 2016

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

vcarreira added some commits Aug 18, 2016

@vcarreira

This comment has been minimized.

Copy link
Contributor Author

commented Aug 18, 2016

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

@dimsav

This comment has been minimized.

Copy link
Owner

commented Aug 18, 2016

Awesome work, thanks a bunch!

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

2 checks passed

continuous-integration/styleci/pr The StyleCI analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dimsav

This comment has been minimized.

Copy link
Owner

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.
Projects
None yet
2 participants
You can’t perform that action at this time.