Add the same no-arg options for language code that
{{#dir}} and {{#bcp47}} have, for consistency:
* `{{#language}}` will return the name of the *target language*
(for articles, the content language; for messages, the user language)
The default value for the "in language" argument should be the autonym.
This was working previously but only via a baroque code flow path for
invalid language codes. Make this a bit clearer and add tests.
Since non-autonym language code translations are added via the
[[Extension:CLDR]] in production, hook LanguageGetTranslatedLanguageNames
in the ParserTestRunner to ensure that we can test this.
Followup-To: Ice1c671c5b3cc077d2bb80ea5dc25c5eabbfeb36
Followup-To: I19c3e91a924e080f37dc95a0d4e61493583b533e
Change-Id: Ibf6e7f194cc056eadb48a5ad8e6d01a761d9351c
Template:Bcp47 is one of the most used templates in Wikimedia Commons.
Providing its functionality as a parser function, tied to MediaWiki's
language-handling code, reduces code duplication and will allow us to
reduce template usage on commons.
As with the {{#dir}} parser function, support one special case:
* `{{#bcp47}}` will return the BCP-47 code of the *target language*
(for articles, the content language; for messages, the user language)
Note the following slight differences from [[Template:BCP47]] on Commons,
documented in an added parser test:
* 'simple' maps to 'en-simple' (not just 'en')
* 'roa-tara' maps to 'nap-x-tara' (not 'it-x-tara')
Bug: T366623
Change-Id: Ice1c671c5b3cc077d2bb80ea5dc25c5eabbfeb36
This mostly reverts commit 28ad29ea0f.
Checking the validity of the provided email doesn't reveal any
information about any users, and it could help catch genuine mistakes,
e.g. if someone inputs the username in the email field.
Previously if an invalid email was provided, we showed a success
message that is an obvious lie (saying we sent an email to something
that isn't an email address).
Change-Id: Idec437b29b22e5b1e5aaff3846632fbc413a3dcb
First export in commit 754c37901f
(Change-Id Ie16c8fbd777a51cebafd32cd1406907c763be975 ).
Language codes nan, nan-hani, nan-latn will be used for language
converter codes.
Bug: T354937
Bug: T370987
Change-Id: Ia87cfa3ec3a71e554ba767bacdb970549454aa93
I added this over 10 years ago when this page was still an integrated
and skinned MW page. Now that we use the standalone QUnit layout, the
message no longer fits in. Also, since QUnit 2.14, the layout is fixed
so our message is invisible anyway becaise it falls behind the toolbar.
Bug: T250045
Change-Id: Icc228e332155147c7f88fb3d85953fc1046473fc
Template:Dir is one of the most used templates in Wikimedia Commons,
this tries to provide parts of its functionality in hope we can
perhaps simplify or get rid of the template eventually for clarity and
performance reasons.
As a convenience, `{{#dir}}` and `{{#dir:}}` are synonyms for
`{{#dir:{{PAGELANGUAGE}}}}`: they return the direction of the target
language. For articles, the target language is the content language;
for messages, the target language is the user language.
In addition, to avoid confusion between BCP-47 language codes and
MediaWiki-internal language codes, an optional second parameter can be
supplied. If the second parameter is the (localizable) string
'bcp47', the language code given in the first parameter will be
treated as a BCP-47 code. For example: `{{#dir:sr-Cyrl|bcp47}}`.
(See LanguageCode::bcp47ToInternal() for a description of the
differences and overlaps between MediaWiki internal and BCP-47
codes. These overlaps *so far* don't result in any case where
encouraging editors to be precise about which set of enumerated
string values they are using for consistency with other
language-related functions, and because MediaWiki internally
differentiates between BCP-47 codes and internal codes.)
Bug: T359761
Change-Id: I19c3e91a924e080f37dc95a0d4e61493583b533e
Minimal support for this language to
allow right to left reading and writing.
Similar to MessagesPhr.php.
Bug: T369578
Change-Id: I977c8aa3964ef0d04afda46ab29609d0c7ce5594
This is the Language Converter from Meitei Script to Bengali Script in mniwiki.
I don't know the language. I got help from a native speaker User:Haoreima.
The original prototype was in a Python Library written by myself.
It only converts the words that have Meitei characters (U+ABC0..U+ABFF).
The original prototype is already being used in mniwiki via Gadget and a Bot.
Bug: T357853
Change-Id: I810f18050f29efa38b2a646d96644e298af47c50
This allows rendering of the data passed to the skin rendering
layer, to allow developers to debug the information used to render
a skin.
Bug: T364696
Change-Id: I32aaa6a85d24df4f4689269f6a455823bb08196b
Some Codex components have strings that are always or usually
consistent across features (such as the aria-label for the
icon-only "Close" button in a CdxDialog). Currently, the burden
is on the developer user to provide a translated string every
time they use one of these components.
These new messages will be used in Codex components for features
in MediaWiki, so the strings no longer need to be provided by the
dev user. See the parent task T345386 for additional context.
Bug: T368447
Change-Id: Ia39b9b775cc53719deae51abe96e18ba13dcfb7d
What:
* Capitalized "API" in MessagesZh_hans.php
* Translated new special page names into Simplified Chinese
Change-Id: Ie6506c6bb004ebc89326094997a80d97551235ab
This reverts commit 0995e06b8e.
Reason for revert: The "named" group was removed in
I06bd5d7150203bbcb0806868fe829a438af486ba
Bug: T355741
Change-Id: I898470de4416e8e9d59901641767a4457648238b
Special:RestSandbox presents a Swagger-UI interface for exploring REST APIs. The available APIs can be configured using RestSandboxSpecs.
For now, the default is to support no APIs, so the feature is disabled in production. In the future, it would make sense to expose the wiki's own REST API per default. The corresponding entry in $wgRestSandboxSpecs in LocalSettings.php would look like this:
'mw' => [
'url' => $wgScriptPath . '/rest.php/',
'name' => 'MediaWiki REST API',
]
Note that the spec URL may still change.
To also explore the endpoints exposed through RESTbase, we might add:
'wmf-restbase' => [
'url' => $wgServer . '/api/rest_v1/',
'name' => 'Wikimedia RESTbase API',
]
Similarly, we could expose a spec for endpoints on api.wikimedia.org, which could then be explored using the new special page.
NOTE: This adds a dependency on the swagger-ui npm library. See T325558 for the security review.
Bug: T362006
Change-Id: I1dd5ed82680a28f9c15136b446a2de0398525061
HTMLMultiSelectField used the jquery.chosen library, but only for the
legacy display format, and only if the 'dropdown' option was passed.
There is only one form that passes the 'dropdown' option
(SpecialActiveUsers), and that form uses the OOUI display format, so
this code is unused.
Also remove the htmlform-chosen-placeholder i18n message, which is now
unused as well.
Bug: T53443
Change-Id: Ie4f9fff322ae26fbdf9eae1b3634d1b04e746179
This is internal class is exclusively used by LockFileChecker,
which in turn is used by maintenance/checkComposerLockUpToDate.php,
which in turn is used by PHPUnit and maintenance/update.php.
Both of these cases have to use workarounds to disable localisation,
because they run on the CLI (no request context or user language),
and without access to MediaWikiServices, Database, or LocalSettings.
Follows-up:
* T330228: I2caddfb8f2 (5ecbb62f7f): Add composer check to PHPUnit.
* T333412: Skip composer check for mediawiki-vendor Jenkins jobs.
* If6110eeaec (397e00444a): Fix invisible pre-fatal errors messages.
* T283389: I0d56f23560 (20e77793b8): Refactor and add localization.
* I995a1cb01a (d5d585b9b2): Fix "premature access" during PHPUnit.
* I33bf81087c2: Fix MessageCache crash during update.php.
The localization was added for T283389, but ended up not using it,
since all it does is check isGood and then render a custom interface
message localised as part of the Installer. Hence, remove this to
categorically remove and avoid these problems.
This change effectively reverts I995a1cb01a (d5d585b9b2) and thus
restores the more detailed and useful error details when failing
in the context of a PHPUnit command.
Change-Id: Ia30d39d7e064e9ff0d8397d25918d0bb2ea10914
Adds localizable description for new linter error going into
parsoid for hidden tool tracking.
Bug: T344378
Change-Id: I787927e9f03bd9c23d069da964b111be5f563a21
- Add a disabled by default feature flag 'EnableProtectionIndicators'
- When the config flag is enabled, show a lock indicator at the top
of the page.
- The lock icon should be overridable by the content of the page
- The indicator has a predictable ID which could be potentially used
to style the icon using the onwiki Common.css file.
- The lock icon by default links to https://www.mediawiki.org/wiki/Help:Protection. However
this link can be customized per wiki per protection level using a
empty message (for example: `protection-sysop-helppage`)
Bug: T12347
Change-Id: I3e36d98edfe54a9c138b1fe8e5057e107ded281b
Experimental library that can display the login form in a small
browser popup window, a new browser tab or window, or an iframe in
a modal message dialog. We're still testing which of these methods
work from the technical side, and which are understandable for users.
Some methods or the whole library may be removed in the future.
Usage:
const authPopup = require( 'mediawiki.authenticationPopup' );
authPopup.startPopupWindow()
// or: authPopup.startNewTabOrWindow()
// or: authPopup.startIframe()
.then( function ( userinfo ) {
if ( userinfo ) {
// Logged in
} else {
// Cancelled by the user
}
}, function ( error ) {
// Unexpected error stopped the login process
} );
Or in future JS:
const userinfo = await authPopup.startPopupWindow(); // etc.
if ( userinfo ) {
// Logged in
} else {
// Cancelled by the user
}
In all three methods, the popup opens the login form with
&display=popup and with &returnto pointing to an unlisted special
page that communicates with the module on the parent page.
Once the library is stable, the AuthPopup component may be separated
from MediaWiki and released as its own package, to be used by tools
to open MediaWiki OAuth workflows in a similar way.
Bug: T364939
Change-Id: I08d9c799b8f79ebab2bcf4fcf330ee8eb995582e
This message is already very long; let's not unnecessarily bloat
it by reference Opera or Internet Explorer, neither of which we
explicitly support any more even for basic no-JS browsing.
Change-Id: I24c3de3969d257caec881c2ac74b105d36d4db85
Multiple pages may be deleted to make way for page moves performed together, e.g. "Page", "Talk:Page", and "Talk:Page/Subpage". Clearly show which will be deleted if the box is checked.
Bug: T12814
Change-Id: I85b25e82436c7fcf6d305b891ae32fa9dfcc60d5
A little history: This is the first time that the $linkTrail
regular expression uses \p with a script name and not explicit
characters or code point numbers.
Bug: T365365
Change-Id: Ia3cf06b8241f74772608179605f1fd7f08a08f8c
Add clarifying comments to several Messages*.php
file that were added only in order to support
RTL content. They will be useful for avoiding
confusion about the expected level of support
and also about the absence of those languages
from Names.php.
Also clean up autonyms for:
* Pulaar: use only Adlam, as in the
Wikimedia Incubator, for which this file
was created.
* Ladino: Use the same name as used on
translatewiki.
* Pothwari: Use just one name, which is
used in the Wikimedia Incubator, and remove
a space.
Follow-up to
I5c78889474d02850198519de04d2a553f1f97a9e
Change-Id: Idc9f50c40b3eafc52721505ba94d81fc2b17071a
This is useful to link to the talk page of a page that is only known by
its title without needing to parse it or make any API requests.
I originally had the class extend RedirectSpecialPage, but couldn’t make
the form work properly that way, so eventually I opted to extend
FormSpecialPage instead and implement the redirect behavior directly.
Cache behavior is moderately aggressive, pinned to the parser cache
expiry, as these redirects should only need to change when the
namespace settings are updated.
Bug: T242346
Change-Id: I531b0b061d1ff1fef9ceffd6c82dc34940ba653d
Autonym according to Ethnologue is "Baso Palembang".
This is also the name most commonly used by the
language's speakers according to the article
Alsamadani, Mardheya; Taibah, Samar (2019).
"Types and Functions of Reduplication in Palembang".
Journal of the Southeast Asian Linguistics Society.
Bug: T364291
Change-Id: I4a867a8671ab32366aa459d49361682305b67dcb
These languages have some content in the Wikimedia Incubator
and/or Translatewiki, but because they don't have
MessagesXx.php files (with $rtl = true;), they get the
default LTR direction, and we needed to add some CSS &
Javascript hacks to get them to display correctly (and
even then, only partially).
The presence of these files does not enable these languages
in the preferences, it only sets the RTL setting for pages
with any of these languages as a page language.
Change-Id: I5c78889474d02850198519de04d2a553f1f97a9e
* Fix Aladin.co.kr search link
* Add MyLog alias
* Change Renameuser main alias from "이름바꾸기" to "사용자이름바꾸기"
이름바꾸기(Rename) does not have a one-to-one correspondence with Renameuser.
사용자이름바꾸기 does.
Change-Id: I978857d275edda812409957b8edaed7904b26048
I think there is further room for improvement
here, such as a method that takes 2 points in time
and gives you a more precise summarization of the duration
in terms of actual dates.
(And we will do this in a followup)
To avoid changing behaviour where this method is called
the default interval of `month` is not specified, so
existing calls return as they did before.
For callers that want `month` granularity, they can
specify month.
Bug: T219397
Change-Id: I5a07e14629fd9f67b1f17df3db75b68f98295dfb
This is, and has always been, a filtered list even of public logs, so let's
change the label for now to that it's less misleading. There are many, many
difficulties with the log pages' design but there's no apparent appetite to
tackle this in the short- or even medium-term, so a minor fix might help to
be slightly less bewilderingly wrong.
Bug: T237729
Change-Id: I103e5ffd4751d6cae4c4f3b654c51eb20cfda471
Use a number of days directly in the message, instead of
indirectly via `Language::formatTimePeriod()` (which will
yield 'days' for any reasonable value of WatchersMaxAge),
to aid with translation.
Follows-Up: I898c463f5cb4efc40877f0bc67156a296bd506e4
Bug: T363659
Change-Id: Ic3c9f94232264aead3cb6e058a5603256f5eebf2
First export in commit d00df6b018
(Change-Id Ie05945912bfed800b5627a306559f21109ccafd2 ).
Language codes nan, nan-hani, nan-latn will be used for language
converter codes.
Bug: T354937
Bug: T362041
Change-Id: Id78405dea23858ea8369fbfc1e655e98d827e89a
Added "Additional details" fields.
Added 'block' function that will be responsible for submitting to API:Block
Modified userLook field so that the value is the username since the API
needs a username rather than a userid.
Bug: T361148
Change-Id: I1e77a63133b8c8ea043c680ddb8af0e044a6fb31
Add two new error messages to the Special:EditRecovery page, one
for when the user is not logged in, and one for when the
preference is not enabled.
Bug: T361721
Change-Id: I28eeab7192e7ab037d95d77406b4743717b0b5bc
Add a link/button to delete a given EditRecovery entry.
Add i18n `edit-recovery-special-delete`
Bug: T353996
Change-Id: I77d94eb0400c0a54df8d3b3cfae6e3adf37805d5
Requested by the zgh community in the Wikimedia Incubator at [1];
the converter is the same as for Shilha (`shi`); the main difference
between the two languages is that the main script for `zgh` is
Tifinagh, which can't be losslessly converted to the Latin script
(the former is unicameral, the latter is bicameral), so the
converter and configuration added here is essentially one-directional.
[1] https://incubator.wikimedia.org/wiki/Special:PermaLink/6060805
Change-Id: I483a1594f001226439497f0870176e9a1e447458
Added "name" attribute to user look up field.
Added component to handle the "Block Details" field which is a checkbox group.
Bug: T361147
Change-Id: I343aa7758c9f5d83c17f29498af59f6eba7bf658
Why:
* Now that the security patch for T357760 has been uploaded to
gerrit, the hardcoded English strings can be replaced with
i18n message keys. The use of hardcoded English was necessary
to avoid causing a localisation cache refresh on every WMF
production deployment.
* While this is being done, it would be useful to add tests
to verify that the changes being made are correct and that
the security fix continues to work.
What:
* Replace the hardcoded English strings with i18n message keys
in SpecialMovePage::showSubpagesList
* Add tests for SpecialMovePage to verify these changes, which
also provide test coverage for the class which was previously
untested.
Bug: T357760
Change-Id: Ib0603f9188f624229b3c9e6d30b8c7266420f8ce
ParamValidator so far only supports primitive types as input, which is
insufficient for validating request bodies.
This adds an "array" parameter type that accepts any array. In the
future, we should add validation for such parameters, based on JSON
schema.
Change-Id: Idfa1c90be40772948a3c53d010441905b44b7b4e
These should be kept in sync with the linter categories and
localization strings in Extension:Linter.
Bug: T360796
Change-Id: I932a4e4b60839ec036dc7abb80c2f5761983f911
With this change, when async uploads are enabled, upload-by-url
will spawn a job and a form with a button to check the status of the
process is shown to the user.
In the process, add processing of warnings in the remote jobs spawned by
the API or the Special page. This is done by adding checks to
UploadJobTrait::verifyUpload. In order to manage warnings serialized in
the job status, a method to unserialize the result of
UploadBase::makeWarningsSerializable.
Things that we might want to fix:
* The form's UI is abysmal, we should probably use Codex
* While it's not a huge deal, I'd like to figure out why I need to
purge the page cache if I want the file to show up. And more
interestingly, why this doesn't happen when uploading via the API
Bug: T295007
Bug: T118887
Change-Id: I49181d93901f064815808380285fc4abae755341
- Override HTMLForm::wrapFieldSetSection() to apply the right
markup and classes for a fieldset and its legend
- Override HTMLForm::formatSection() to include the
.cdx-field__control class
- Add a setter for section info to HTMLForm (that only
works when the display format is 'codex')
- Add an optional flag message
- Override HTMLForm::getLegend() to include CSS classes
and additional sub-elements of the legend, including an
"optional" flag and a description.
Implementation notes:
- CodexHTMLForm::getLegend() returns HTML, while the parent
method returns plain text. This was necessary to include
the "optional" flag and description within the legend
element, which is critical for users of assistive tech.
- setSections() was added to HTMLForm instead of CodexHTMLForm
to support use cases like FormSpecialPage, which expect the
form to be an HTMLForm
Bug: T359020
Bug: T359016
Change-Id: I7b637331e171c46b48de085a6fa92f8ceaf16a50
The getTotalAutoblocks query is unindexed and takes 6-7 seconds on
enwiki. It regularly appears in the slow query log.
So, remove the feature.
Change-Id: I4552b7f4894c76de48db026faa01b2c8aabd87e0
"Deny from all" is deprecated; the replacement syntax has been
available since Apache 2.4 (originally released in 2012).
See <https://httpd.apache.org/docs/2.4/howto/access.html>.
Bug: T360850
Change-Id: I825053ccefe34f6ca4e04af5ad2601f79e4d51a7
For many languages, I believe, it is too restrictive to require
the same message for the button text and the reason.
Additionally, this change makes the capitalization consistent
for English. Compare with "editundo" (link text) and "undo-summary"
(edit summary default text).
Change-Id: I344ca3b567b5dafbe4417228ea9e8ea27d95a45e
The incubator wiki has some backend errors for the chn wiki since the
main page is an invalid title. The reason is the "mainpage-description"
got amended to add description which includes a newline and that got
mistakengly copy pasted to "mainpage". The later is used to forge a
Title and the newline character make it an invalid Title.
The faulty localization comes from Feb 22nd 2024 with:
cdabac07fb
Bug: T360066
Change-Id: I59118b9892d11ad7b26d5ebdeccab82d98b28fc7
It's an extension message, so it shouldn't be referenced here.
(There are plenty of other extension-defined grants, it's
unmaintainable to try to list them here.)
Change-Id: Ieb962e89a82f85d673cd6378582368169d62314e
Code is stolen from Special:MovePage (bfcea5ac)
This also contains a list for unsuppress reasons for oversighters only
(empty by default) - similiar to action=delete
Bug: T326746
Change-Id: I9668004a53a86eee48b17dd6a2f8bdaaf9ac0247
This reverts commit cb09a27cc2.
The class is not very useful as it is now, due to performance issues
(T169027#9342985). The Graph extension is not going to use iframes
(T334940#9537862) and that was the only concrete feature for this, so
making the class usable in practice is unlikely to get prioritized.
No point in leaving the code in its current halfway state.
Bug: T222807
Bug: T169027
Change-Id: Id1b5193975435b58aebc225528e30f04456d0c41