Commit Graph

21 Commits

Author SHA1 Message Date
Jon Robson
c00567ac4e Display the language button on pages without languages
This restores the language button on the user page and main page
for Vector 2022 for pages which have no languages

Bug: T315036
Change-Id: I65e638f05bf1fd6451fa33bd9d8fc660ee45b87e
2023-06-27 06:16:28 +00:00
Jon Robson
bcbe6fc705 Correct the logic for the ULS settings cog for Vector 2022
Bug: T315036
Change-Id: I9fe711cee57ee07dabba5c04f3c7faa5eb82a2c4
2023-06-22 08:44:18 +00:00
Ed Sanders
81cfb348cb Always use the strict equality flag when using in_array
Change-Id: I8ce7209c03bb054b2a9ad96c7d5897d081b4e27e
2023-06-06 13:36:56 +01:00
Winston Sung
a24e94265e UniversalLanguageSelector: Fix BCP 47 language code detection
Some browsers use formats like "zh-Hant-TW", the current detection
 cannot handle them correctly.

Bug: T337665
Change-Id: I0db11a20e219d4cf66832aeee67d59bf3ec41a62
2023-05-31 09:49:46 +00:00
Niklas Laxström
7d20f15b17 Remove ULSMobileWebfontsEnabled
To my knowledge never used since it was added in in 2013 with
commit fd885d9881.

Bug: T332837
Change-Id: Ia9ecb3e4dd47b8ce4dfaaa489a1ec5a71c378492
2023-04-05 06:21:40 +00:00
NikG
613276ca89 ULS: Display "Page contents not supported" body in missing and talk pages
Instead of displaying the empty state for all non-content pages, we
should check whether the page is missing or if it's a talk page instead.

Also use the term "subject page" to align with existing functions
of Title and NamespaceInfo.

Bug: T316559
Bug: T326788
Change-Id: I0f50898b6e9817aee2bcfba38e69c67ae041a14b
2023-01-16 12:29:18 +02:00
NikG
965ffc3b1a Add language settings button inside dropdown for non-content pages
NOTE: This patch is identical to patch with change-id:
Ifdf2a529b30e5a2df8867b606a525c9f7b3bdb6c

The above patch has been merged but reverted because of the usage
of '$skin->getTemplateDate()' method, which should be avoided. The
current patch replaces the usage of this method, with the usage of
the output page title ($out->getTitle()). All the rest of the code
has been kept the same.

Bug: T316559
Change-Id: Ibef9f6fd46d9055c3e0865905fb8aa8d031c1940
2023-01-11 18:05:29 +02:00
Jdlrobson
570a7d3b4e Revert "Add language settings button inside dropdown for non-content pages"
This reverts commit 5d576d05b4.

Reason for revert: Using Skin::getTemplateData method outside the
skin rendering layer is dangerous and likely a performance issue as
it means generating the rendering data twice and makes various hooks
execute multiple times.
It has caused T326538 and may be causing other issues.

Bug: T326538
Change-Id: Ie5d079deae414eb199d2a40b98d04b57439eaac4
2023-01-09 20:25:46 +00:00
NikG
5d576d05b4 Add language settings button inside dropdown for non-content pages
Bug: T316559
Change-Id: Ifdf2a529b30e5a2df8867b606a525c9f7b3bdb6c
2023-01-09 05:02:57 +00:00
Umherirrender
61256e25b7 Use LanguageNameUtils::AUTONYMS/SUPPORTED instead of hard coded value
Easier to spot the documentation what happen with this option

Change-Id: I977485c2cba0063b5bdee3724d9262b75341faec
2022-12-29 13:41:24 +01:00
Fomafix
e44e4c4c0c Remove phpcs exclude rules and update PHP code
Change-Id: Ie37deda368a4d163cf324988721033829ae8af77
2022-11-13 18:33:34 +00:00
NikG
8a55528772 Compact language list preference should be ignored for Vector 2022 skin
The Compact language list preference was intended to control whether to
show all languages directly or show just a few of them (with option to
search for the rest) instead. However, with the new Vector 2022 skin,
there is only a button to access language selection and thus, this
setting should be ignored for this skin.

This patch modifies the "isCompactLinksEnabled" method inside Hooks
to always return true when the skin is set to Vector 2022 (when ULS
features are enabled).

Bug: T319690
Change-Id: Ic8a537d31ee4dad02932a04017f19537140e0c1c
2022-11-02 14:38:55 +00:00
Fomafix
35852fee74 Use WebRequest::getRawVal instead of WebRequest::getText
The UTF-8 normalization for the URL attributes `languagecode`, `uselang`
and `setlang` are not needed.

Change-Id: Ib204629fb15e2578bba09be4c40d0210eb81dd77
2022-08-24 06:19:52 +00:00
Jon Robson
06091efcd0 Limit ULSPosition check to non-Vector 2022 skins
I'm not sure what this is for, but it's definitely not needed
in Vector 2022 skin. It also prevents the uls-after-portlet-link
element from appearing inside the language button when ULS is disabled.

Bug: T275147
Change-Id: I8f6c1361040b72107f2d45bfc18e22d6b8f2021c
2022-07-28 04:32:43 +00:00
Abijeet
4632f33e6a Drop support for MediaWiki 1.36
Bug: T311510
Change-Id: I9bc2f91f274df1d37ebad639b42ee4b542274db9
2022-07-26 11:04:40 +00:00
Thiemo Kreuz
78c25ebcf7 Fix-ups to comments and User interface usages
* Use isRegistered() from the more narrow UserIdentity interface.
* More specific type hints.
* Remove comments that literally repeat the code.

Change-Id: Icd0eaf8236be41b258efcf81d581540d2448e9e3
2022-04-20 09:54:25 +02:00
Reedy
f8eda0ca0c Use namespaced Babel class
Depends-On: I16411d99d97762606ed43e5a0093ff7ed1cfa0b8
Change-Id: I15ae2cd07b88991ed6f150e12af30bee9499dbdc
2022-03-06 14:41:56 +00:00
Reedy
430afafeb7 Use ExtensionRegistry to see if Babel is loaded
Change-Id: Iabc24b4580bab39a6d232d61e9c52a641cce41a3
2022-03-06 14:41:10 +00:00
Abijeet
6e6635bdbb Move version check inside PersonalUrls hook
Stop additional conditional hook if MW < 1.37, and move the check
to inside the hook itself

Bug: T299305
Change-Id: Ied1c5c0beee015d7b0a8d6bd750346f4a8a5aaa1
2022-01-24 09:24:43 +00:00
Abijeet
30986e6d9e Remove backward compatibility for MW <= 1.35
Bug: T298856
Change-Id: I1e635785d0a29d87f510e729b11fce9a2eb68e11
2022-01-18 12:51:07 +00:00
Reedy
f9532855ad Namespace extension
Change-Id: I79aa319f177589d85446888289568748cd63d1c5
2022-01-05 10:47:22 +00:00