django-rosetta icon indicating copy to clipboard operation
django-rosetta copied to clipboard

Fix reflang regex pattern to include language code with more than 2 characters

Open sipa-echo-zaoa opened this issue 7 months ago • 2 comments

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

sipa-echo-zaoa avatar Apr 15 '25 10:04 sipa-echo-zaoa

Hi @mbi, Have you had some time to check this PR?

sipa-echo-zaoa avatar May 12 '25 07:05 sipa-echo-zaoa

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)

image

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)

mbi avatar May 12 '25 08:05 mbi