HomePhabricator

Use ?uselang for dynamically rendered user interface

Tags
None
Referenced Files
None
Subscribers
None

Description

Use ?uselang for dynamically rendered user interface

This ensures that UI elements added via JavaScript are shown in the same
language as the rest of the page, including if ?uselang is used or if
the language preference was changed in another tab. To enable the JS
code to add the right ?uselang argument, add the language to the <html>
element as a data attribute – both the interface language code as seen
internally (which is a MediaWiki language code, and so potentially
different from the HTML lang= – try ?uselang=simple), and the one that
should be used for ?uselang (in case of ?uselang=qqx, the former will be
'en', due to the decision in the previous commit which I’m now starting
to question). The former is actually unused at the moment, but feels
reasonable to include anyway.

The /<language_code> path arguments of render_no_duplicate() and
render_advanced_partial_forms_hint() had actually been unused since
ad8e3b7066; introduce new URLs without them (while keeping the old ones
for compatibility). Note that get_duplicates_api() still has a
/<language_code> path argument, but the language code there is used for
the search, not for the user interface.

Details

Provenance
LucasWerkmeisterAuthored on Apr 26 2024, 7:01 PM
Parents
R2362:ceb6acb4b5c4: Add support for ?uselang=qqx
Branches
Unknown
Tags
Unknown
ChangeId
None