Skip to content

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

Open
sipa-echo-zaoa wants to merge 2 commits intombi:developfrom
sipa-echo-zaoa:fix-reflang-for-langcode-longer-than-2-characters
Open

Fix reflang regex pattern to include language code with more than 2 characters#306
sipa-echo-zaoa wants to merge 2 commits intombi:developfrom
sipa-echo-zaoa:fix-reflang-for-langcode-longer-than-2-characters

Conversation

@sipa-echo-zaoa
Copy link
Copy Markdown

This pr fixes the following issue: #182

All Submissions:

  • Are tests passing? (From the root-level of the repository please run pip install tox && tox)
  • I have added or updated a test to cover the changes proposed in this Pull Request
  • I have updated the documentation to cover the changes proposed in this Pull Request

@sipa-echo-zaoa sipa-echo-zaoa force-pushed the fix-reflang-for-langcode-longer-than-2-characters branch from 773bd14 to 8d03076 Compare April 15, 2025 11:52
@sipa-echo-zaoa
Copy link
Copy Markdown
Author

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

@mbi
Copy link
Copy Markdown
Owner

mbi commented May 12, 2025

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)

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.

2 participants