Page MenuHomePhabricator

Language names in wbqc-violation-message-label-lacking aren't translated to the language of the user interface
Closed, ResolvedPublicBUG REPORT

Description

The constraint message that is displayed when a required language couldn't be found in the labels of an entity has languages names written in the same language that is required instead of in the language of the user interface. When this is a language I don't understand I'm unable to know which language is the one missing. I can't fix the problem without understanding the language, but it would be nice knowing at least which one the missing language is.

Example:

image.png (198×571 px, 20 KB)

https://www.wikidata.org/wiki/Q100257812#P4529

What happens?:
Language names in wbqc-violation-message-label-lacking message are displayed written in that language.

What should have happened instead?:
Language names of the message should be displayed written in the language of the user interface.

Event Timeline

Should be relatively easy to change – pass the user language from ViolationMessageRendererFactory::getViolationMessageRenderer() into ViolationMessageRenderer, then adjust ViolationMessageRenderer::renderLanguage() to pass the user language code into Language::fetchLanguageName(). Violation messages are rendered per request – the cache contains the unrendered, serialized message – so there should be no issues about wrong language names being shown to other users due to bad caching.

It would be nice, but not required, to also refactor the code at this time, to inject a LanguageNameUtils service instance into ViolationMessageRenderer and its factory, instead of using the deprecated Language::fetchLanguageName() method.

This could potentially be a good first task, but needs a product decision first IMHO, on whether we want to make this change or not.

Do you have an example where this is happening so I can have a closer look?

Do you have an example where this is happening so I can have a closer look?

Here is an example: https://www.wikidata.org/wiki/Q100257812#P4529

Thank you! That makes sense. And I'd agree that changing it to show the language in the interface language makes sense.

Change 864798 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseQualityConstraints@master] Simplify MultilingualTextViolationMessageRenderer

https://gerrit.wikimedia.org/r/864798

Change 864799 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseQualityConstraints@master] Inject LanguageNameUtils into ViolationMessageRenderer(Factory)

https://gerrit.wikimedia.org/r/864799

Change 864800 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseQualityConstraints@master] Add strict types to ViolationMessageRenderer

https://gerrit.wikimedia.org/r/864800

Change 864801 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseQualityConstraints@master] Move MessageLocalizer in ViolationMessageRendererFactory

https://gerrit.wikimedia.org/r/864801

Change 864802 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseQualityConstraints@master] Move ViolationMessageRendererFactory to service container

https://gerrit.wikimedia.org/r/864802

Change 864803 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessageRendererFactory in SpecialConstraintReport

https://gerrit.wikimedia.org/r/864803

Change 864804 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseQualityConstraints@master] Format language constraint parameters in user language

https://gerrit.wikimedia.org/r/864804

Change 864804 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseQualityConstraints@master] Format language constraint parameters in user language

https://gerrit.wikimedia.org/r/864804

This change actually implements the task, the rest of the changes are preparation and related cleanup.

Change 864798 merged by jenkins-bot:

[mediawiki/extensions/WikibaseQualityConstraints@master] Simplify MultilingualTextViolationMessageRenderer

https://gerrit.wikimedia.org/r/864798

Change 864799 merged by jenkins-bot:

[mediawiki/extensions/WikibaseQualityConstraints@master] Inject LanguageNameUtils into ViolationMessageRenderer(Factory)

https://gerrit.wikimedia.org/r/864799

Change 864800 merged by jenkins-bot:

[mediawiki/extensions/WikibaseQualityConstraints@master] Add strict types to ViolationMessageRenderer

https://gerrit.wikimedia.org/r/864800

Change 864801 merged by jenkins-bot:

[mediawiki/extensions/WikibaseQualityConstraints@master] Move MessageLocalizer in ViolationMessageRendererFactory

https://gerrit.wikimedia.org/r/864801

Change 864802 merged by jenkins-bot:

[mediawiki/extensions/WikibaseQualityConstraints@master] Move ViolationMessageRendererFactory to service container

https://gerrit.wikimedia.org/r/864802

Change 864803 merged by jenkins-bot:

[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessageRendererFactory in SpecialConstraintReport

https://gerrit.wikimedia.org/r/864803

Change 864804 merged by jenkins-bot:

[mediawiki/extensions/WikibaseQualityConstraints@master] Format language constraint parameters in user language

https://gerrit.wikimedia.org/r/864804

Thanks Lucas :)

All looks good from my end

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy