Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

sipa-echo-zaoa
Copy link

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
Author

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

@mbi
Copy link
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