django-rosetta
django-rosetta copied to clipboard
Fix reflang regex pattern to include language code with more than 2 characters
This pr fixes the following issue: #182
All Submissions:
- [x] Are tests passing? (From the root-level of the repository please run
pip install tox && tox) - [x] I have added or updated a test to cover the changes proposed in this Pull Request
- [x] I have updated the documentation to cover the changes proposed in this Pull Request
Hi @mbi, Have you had some time to check this PR?
Hi @sipa-echo-zaoa
sorry for sitting on this. My problem with this PR is that the reflang language selector uses the actual locale name as defined in the filesystem, e.g. bs-Cyrl-BA (which might possibly be badly formatted)
But passing it through to_locale (https://github.com/mbi/django-rosetta/pull/306/files#diff-6ac919d4cfd18d52aaad20f3e04086a7df5c558fe9bd0940a342ca9e7dfaf553R589) "un-breaks" this discovery and makes the reflang unloadble. (bs-Cyrl-BA -> bs_Cyrl-ba)