Skip to content
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

Fixed #27418 -- Fixed occasional missing plural forms in JavaScriptCatalog. #7460

Closed
wants to merge 1 commit into from

Conversation

wkornewald
Copy link
Contributor

@wkornewald wkornewald commented Nov 1, 2016

This bug occurs when you have a missing translation in a language with more than two plural forms. In this case, you have a fallback to English and depending on the order in which the catalog is traversed in the for-loop you might end up with an msgid of a fallback English two-plural translation. When that happens, all translations will be reduced to two plural forms.

https://code.djangoproject.com/ticket/27418

This bug occurs when you have a missing translation in a language with more than two plural forms. In this case, you have a fallback to English and depending on the order in which the catalog is traversed in the for-loop you might end up with an msgid of a fallback English two-plural translation. When that happens, all translations will be reduced to two plural forms.
@timgraham
Copy link
Member

Thanks for the patch. All bug fixes require a Trac ticket and a regression test is also needed.

@wkornewald
Copy link
Contributor Author

The problem is that I can only reproduce this bug about 10% of the time because it depends on random factors (e.g. the ordering of a dict's keys) and these factors seem to only vary between python process invocations. Only about one in ten runs produces this bug. I'm not sure how I can write a reliable unit test for this and is it really necessary to invest the time into a five character change?

@timgraham timgraham changed the title Fixed occasional missing plural forms in JS Fixed #27418 -- Fixed occasional missing plural forms in JavaScriptCatalog. Nov 2, 2016
@timgraham
Copy link
Member

We try our best to write tests for all changes no matter how trivial. This increases the coverage of the test suite and prevents regressions.

@timgraham
Copy link
Member

Are you able to try to add a test? Even if it only fails occasionally, I think that's fine.

@timgraham
Copy link
Member

Closing due to inactivity.

@timgraham timgraham closed this Dec 7, 2016
@wkornewald
Copy link
Contributor Author

Could you please reopen this pull request? It's still a critical bug, but I don't know how to write a unit test that would reliably reproduce the issue. Really, this is extremely random and rare. Can you please make an exception here?

@timgraham
Copy link
Member

If it's a critical bug, then all the more important to have a test, I'd think. Maybe you want to write to the django-developers mailing list to ask for help about how to write a test or to find a consensus that a test isn't needed.

@wkornewald
Copy link
Contributor Author

I've created a new pull request with a unit test that fails 50% of the time: #7671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants