Currently the sorting of month names in tables depends on the user interface language.
Expected result: The sorting of the month names in tables should depend on the page content language.
Test case:
{| class="sortable" |- ! number !! date |- | 1 || 1. Januar 2016 |- | 2 || 1. Februar 2016 |- | 3 || 1. März 2016 |- | 4 || 1. April 2016 |- | 5 || 1. Mai 2016 |}
Test languages de and de-at. The January is in de Januar and in de-at Jänner.
- de: https://www.mediawiki.org/wiki/Special:ExpandTemplates?wpInput={|+class%3D%22sortable%22%0D%0A|-%0D%0A!+number+!!+date%0D%0A|-%0D%0A|+1+||+1.+Januar+2016%0D%0A|-%0D%0A|+2+||+1.+Februar+2016%0D%0A|-%0D%0A|+3+||+1.+M%C3%A4rz+2016%0D%0A|-%0D%0A|+4+||+1.+April+2016%0D%0A|-%0D%0A|+5+||+1.+Mai+2016%0D%0A|}&title=Special%3AExpandTemplates&uselang=de
- de-at: https://www.mediawiki.org/wiki/Special:ExpandTemplates?wpInput={|+class%3D%22sortable%22%0D%0A|-%0D%0A!+number+!!+date%0D%0A|-%0D%0A|+1+||+1.+Januar+2016%0D%0A|-%0D%0A|+2+||+1.+Februar+2016%0D%0A|-%0D%0A|+3+||+1.+M%C3%A4rz+2016%0D%0A|-%0D%0A|+4+||+1.+April+2016%0D%0A|-%0D%0A|+5+||+1.+Mai+2016%0D%0A|}&title=Special%3AExpandTemplates&uselang=de-at
DetailsSubject Repo Branch Lines +/- Customize query in gerritRelated ObjectsEvent Timeline
Comment ActionsChange 270324 had a related patch set uploaded (by Gerrit Patch Uploader):
DO NOT MERGE. Use page content language for jquery.tablesorter
Comment ActionsChange 270324 abandoned by Nikerabbit:
[mediawiki/core@master] DO NOT MERGE. Use page content language for jquery.tablesorter
Reason:
I think this proof of concept has served it's purpose.
https://gerrit.wikimedia.org/g/mediawiki/extensions/Cite/+/97495c9bf18280305632d62096cca5307135f403/src/ResourceLoader/ContentLanguage.php
This solution works only with a project wide content language but not with a page content language per title by $wgPageLanguageUseDB = true.
A better solution would be to extend the ResourceLoader by an optional URL parameter contentlang for the content language next to the existing URL parameter lang for the user interface language. contentlang is only added when the page content language differs to the project content language. A new function getContentLanguage in MediaWiki\ResourceLoader\Context provides the value of this URL parameter and falls back to $wgLanguageCode if the URL parameter is missing. Modules like ext.cite.visualEditor or jquery.tablesorter can then use the page content language for language operations in the page content.
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Customize query in gerrit
Related Objects Event TimelineComment Actions Change 270324 had a related patch set uploaded (by Gerrit Patch Uploader): Comment Actions Change 270324 abandoned by Nikerabbit: [mediawiki/core@master] DO NOT MERGE. Use page content language for jquery.tablesorter Reason: I think this proof of concept has served it's purpose. https://gerrit.wikimedia.org/g/mediawiki/extensions/Cite/+/97495c9bf18280305632d62096cca5307135f403/src/ResourceLoader/ContentLanguage.php A better solution would be to extend the ResourceLoader by an optional URL parameter contentlang for the content language next to the existing URL parameter lang for the user interface language. contentlang is only added when the page content language differs to the project content language. A new function getContentLanguage in MediaWiki\ResourceLoader\Context provides the value of this URL parameter and falls back to $wgLanguageCode if the URL parameter is missing. Modules like ext.cite.visualEditor or jquery.tablesorter can then use the page content language for language operations in the page content. |