2014-03-27 09:02:52 +00:00
{
2014-10-29 15:57:35 +00:00
"@metadata" : {
"authors" : [
"Daniel Kinzler, brightbyte.de"
]
} ,
"gadgets-desc" : "Lets users select custom [[Special:Gadgets|CSS and JavaScript gadgets]] in their [[Special:Preferences#mw-prefsection-gadgets|preferences]]" ,
"prefs-gadgets" : "Gadgets" ,
2022-09-27 17:50:32 +00:00
"prefs-description-gadgets" : "Enable additional features for your account." ,
2020-01-17 02:30:34 +00:00
"gadgets-prefstext" : "Below is a list of special gadgets you can enable for your account.\nThese gadgets are mostly based on JavaScript, so JavaScript has to be enabled in your browser for them to work.\nNote that these gadgets will have no effect on this preferences page.\n\nAlso note that these special gadgets are not part of the MediaWiki software, and are usually developed and maintained by users on your local wiki.\nLocal interface administrators can edit the [[MediaWiki:Gadgets-definition|definitions]] of available gadgets, and local administrators can edit their [[Special:Gadgets|descriptions]], where you can see the source code of each gadget. The numbers of users for each gadget on this wiki is listed at [[Special:GadgetUsage|Gadget usage statistics]]." ,
2023-09-07 13:42:23 +00:00
"gadgets-prefstext-safemode" : "Gadgets are currently unavailable as safe mode has been enabled. Please [[#mw-input-wpforcesafemode|disable safe mode]] to use gadgets." ,
2024-02-07 13:04:41 +00:00
"special-gadgets" : "Gadgets" ,
2015-10-20 06:27:23 +00:00
"gadgetusage" : "Gadget usage statistics" ,
"gadgetusage-gadget" : "Gadget" ,
"gadgetusage-usercount" : "Number of users" ,
"gadgetusage-noresults" : "No gadgets found." ,
2015-12-14 05:22:02 +00:00
"gadgetusage-intro" : "This table indicates the number of users who have enabled each gadget on this wiki. An active user is counted as someone who has made an edit in the last {{PLURAL:$1|day|$1 days}}. This list excludes stats for gadgets enabled for everyone by default and may include gadgets that are no longer available." ,
2015-12-17 14:03:21 +00:00
"gadgetusage-intro-noactive" : "This table indicates the number of users who have enabled each gadget on this wiki. This list excludes stats for gadgets enabled for everyone by default and may include gadgets that are no longer available." ,
2015-11-30 16:13:18 +00:00
"gadgetusage-activeusers" : "Active users" ,
2015-12-14 05:22:02 +00:00
"gadgetusage-default" : "Default" ,
2014-10-29 15:57:35 +00:00
"gadgets-definition" : "" ,
"gadgets-title" : "Gadgets" ,
"gadgets-pagetext" : "Below is a list of special gadgets users can enable on their [[Special:Preferences#mw-prefsection-gadgets|preferences page]], as defined by the [[MediaWiki:Gadgets-definition|definitions]].\nThis overview provides easy access to the system message pages that define each gadget's description and code." ,
2021-12-26 21:23:06 +00:00
"gadgets-editdescription" : "Edit description" ,
"gadgets-viewdescription" : "View description" ,
2014-10-29 15:57:35 +00:00
"gadgets-uses" : "Uses" ,
Improve localisation on Special:Gadgets, minor code cleanups
For each item, either display human-readable and translated text,
or display a technical non-translatable identifier as `<code>`,
with optional localised text in the title attribute.
* Re-format "rights" as a sentence instead of a bullet list. It was
the only one using a bullet list, which made it feel a bit long.
* Re-format "actions" as `<code>` since they are not localised.
* Re-format "contentModels" as `<code>`, and add the localised display
name in a title attribute, same as we do with "rights" already.
ContentHandler::getLocalizedName() is also used already on
Special:ChangeContentModel.
* Fix "contentModels" to set `needLineBreakAfter = true`, otherwise
if a gadget also sets "supportsUrlLoad", then that sentence is
appended to the previous line.
Update phrasing and sorting to be consistent everywhere, and adopt
native PHP types where possible.
In most cases, I made things alphabetical, with the exception of
Special:Gadgets user interface output, and Gadget class methods,
which both follow the order of most recently added feature last
(rights, skins, actions, namespaces, contentmodels, categories).
Highlights:
* Fix namespace IDs type. These can be strings when they are parsed
from the gadget definition text, not always integers.
* Add explicit default for 'category'. In theory not needed because
MediaWikiGadgetsDefinitionRepo has a `$section = '';` default, and
MediaWikiGadgetsJsonRepo uses GadgetDefinitionContentHandler where
`category: ''` is part of both the initial page content, as well
as merged via getDefaultMetadata.
This default benefits simpler test cases, and static analysis,
since the Gadget class constructor does not (yet) require it.
Without this, getCategory() could TypeError due to returning null.
Bug: T63007
Change-Id: I3b2c72a6424d520431d03761d23a5a222518ce3d
2024-03-16 23:32:44 +00:00
"gadgets-required-rights" : "Requires the following {{PLURAL:$2|right|rights}}: $1." ,
2020-09-04 03:42:31 +00:00
"gadgets-required-skins" : "Available for the {{PLURAL:$2|$1 skin|following skins: $1}}." ,
"gadgets-required-actions" : "Limited to the {{PLURAL:$2|\"$1\" page action|following page actions: $1}}." ,
"gadgets-required-namespaces" : "Limited to {{PLURAL:$2|namespace $1|the following namespaces: $1}}." ,
2024-02-20 13:55:52 +00:00
"gadgets-required-categories" : "Limited to {{PLURAL:$2|category $1|the following categories: $1}}." ,
2023-05-22 08:41:15 +00:00
"gadgets-required-contentmodels" : "Limited to {{PLURAL:$2|content model $1|the following content models: $1}}." ,
2014-10-29 15:57:35 +00:00
"gadgets-default" : "Enabled for everyone by default." ,
2020-04-15 20:34:12 +00:00
"gadgets-legacy" : "Gadget is not loaded. Please migrate to ResourceLoader. ([https://www.mediawiki.org/wiki/Special:MyLanguage/ResourceLoader/Migration_guide_(users) Learn more])" ,
2021-10-17 13:05:15 +00:00
"gadgets-packaged" : "This gadget is [https://www.mediawiki.org/wiki/ResourceLoader/Package_files packaged], with entry point being $1" ,
2014-10-29 15:57:35 +00:00
"gadgets-export" : "Export" ,
"gadgets-export-title" : "Gadget export" ,
"gadgets-not-found" : "Gadget \"$1\" not found." ,
2023-07-14 15:47:37 +00:00
"gadgets-export-text" : "To export the $1 gadget, click on \"{{int:gadgets-export-download}}\" button, save the downloaded file,\ngo to Special:Import on the destination wiki and upload it. Then add the following to MediaWiki:Gadgets-definition page:\n<pre>$2</pre>\nYou must have appropriate permissions on the destination wiki (including the right to edit system messages) and import from file uploads must be enabled." ,
2014-10-29 15:57:35 +00:00
"gadgets-export-download" : "Download" ,
2022-01-30 13:15:25 +00:00
"gadgets-requires-es6" : "This gadget is only supported on ES6-compliant browsers" ,
2015-08-03 06:37:32 +00:00
"gadgets-validate-notset" : "The property <code>$1</code> is not set." ,
Replace EditFilterMergedContent hook with ContentHandler override
The reason for this hook is not the validation itself, because that
is already done by `GadgetDefinitionContent->isValid` which is part
of the core Content interface, already enforced by ContentHandler.
Instead, the hook was here to provide the custom interface message
GadgetDefinitionValidator, because the core Content interface is
limited to boolean isValid(), which provides a very generic error
message.
However, nowadays ContentHandler exposes this mechanism directly
such that we can directly attach a custom message to it without
needing to wait for the stack to reach the EditPage and then override
it after the fact from a global hook.
Also:
* Simplify validation logic towards "is" checks with only an
expected description.
* Move schema.json file to top-level file.
It has been unused for as long as it has been in the repo, despite
appearing (due to its placement) to be used as part of the source.
It was added, I believe, with the intent to be used by the validator,
but it isn't. It also isn't validated or checked for correctness
by anything right now.
For now, keep it as informal schema in the top-level location for
easy discovery where perhaps others can find a use for it.
SD0001 mentions gadget developers may want to start using it for
Git-maintained gadgets to help with validation in their IDE, after
Gadgets 2.0 is launched.
Test Plan:
* Set `$wgGadgetsRepo = 'json+definition';`
* Create `MediaWiki:Gadgets/example.json`
* Attempt to save "x" in settings.namespaces item.
* Attempt to save "x.zip" in module.pages item.
* Fails with this patch, similar as on master.
Bug: T31272
Change-Id: I61bc3e40348a0aeb3bd3fa9ca86ccb7b93304095
2024-03-26 21:06:26 +00:00
"gadgets-validate-wrongtype" : "The property <code>$1</code> must be of type <code>$2</code>." ,
2023-12-01 15:05:56 +00:00
"gadgets-validate-json" : "JSON files are specified but not used. They are only valid in packaged gadgets." ,
2021-12-28 21:29:05 +00:00
"gadgets-validate-es6default" : "Gadgets requiring ES6 cannot be enabled by default." ,
"gadgets-validate-noentrypoint" : "Package flag ignored as no script files are specified." ,
"gadgets-validate-noscripts" : "Scripts are ignored, because this gadget sets <code>type=styles</code>." ,
"gadgets-validate-stylepeers" : "Peer gadgets are ignored, because this is a styles-only gadget. Set <code>type=general</code> to override." ,
"gadgets-validate-scriptsnotallowed" : "Scripts and data files are not used, because this gadget sets <code>type=styles</code>." ,
"gadgets-validate-invalidjs" : "Script $1 is not used, due to invalid content model \"$2\"." ,
"gadgets-validate-invalidcss" : "Stylesheet $1 is not used, due to invalid content model \"$2\"." ,
"gadgets-validate-invalidjson" : "Data page $1 is not used, due to invalid content model \"$2\"." ,
"gadgets-validate-nopeer" : "Peer gadget \"$1\" is ignored, because it does not exist." ,
"gadgets-validate-invalidpeer" : "Peer gadget \"$1\" is ignored, because it is not a styles-only gadget." ,
2023-12-01 15:44:26 +00:00
"gadgets-validate-invalidactions" : "The following {{PLURAL:$2|action is|actions are}} not recognized: $1" ,
"gadgets-validate-invalidcontentmodels" : "The following content {{PLURAL:$2|model does|models do}} not exist: $1" ,
"gadgets-validate-invalidnamespaces" : "The following namespace {{PLURAL:$2|number does|numbers do}} not exist: $1" ,
2023-12-16 15:08:57 +00:00
"gadgets-validate-invalidskins" : "The following {{PLURAL:$2|skin does|skins do}} not exist: $1" ,
"gadgets-validate-invalidrights" : "The following {{PLURAL:$2|right does|rights do}} not exist: $1" ,
2021-12-28 21:29:05 +00:00
"gadgets-validate-invalidtitle" : "Page title \"$1\" is invalid" ,
2023-12-11 17:16:30 +00:00
"gadgets-validate-unknownpages" : "Contains one or more pages without .js, .css or .json suffix. They would not be used." ,
2023-12-08 21:33:19 +00:00
"gadgets-validate-duplicate" : "A second definition of gadget $1 was detected and shall be ignored" ,
2021-12-28 21:29:05 +00:00
"gadgets-validate-nopage" : "Page \"$1\" does not exist." ,
Goodbye Gadget/Gadget_definition namespaces!
== What ==
* Remove the empty Gadget and Gadget_definition namespaces.
* Remove the "gadgets-definition-edit" user right.
* Remove need for custom namespace permissions that previously
had to extend editsitejs to apply to NS_GADGET.
== Why ==
Simplify the (unused) "GadgetDefinitionNamespaceRepo" backend for
Gadgets 2.0 by making it less radically different from the status quo.
The experimental 2.0 branch will now make use of the "gadget definition"
content model via "MediaWiki:Gadgets/<id>.json" pages, instead of
through a dedicated namespace.
When I first worked the Gadgets 2.0 branch, content models
were not a thing in MediaWiki, and interface-admin wasn't a thing yet
either. Now that we have per-page permissions and per-page content
models, we don't really need a separate namespace.
This follows the principle of least surprise, and fits well with other
interface admin and site configuration tools such as:
- Citoid, MediaWiki:Citoid-template-type-map.json,
- VisualEditor, MediaWiki:Visualeditor-template-tools-definition.json,
- AbuseFilter, MediaWiki:BlockedExternalDomains.json,
- the upcoming "Community Config" initiative.
If/when we develop the SpecialPage GUI for editing gadget definitions,
this can save its data to these pages the same as it would in
any other namespace. Similar to how Special:BlockedExternalDomains
operates on MediaWiki:BlockedExternalDomains.json.
See also bf1d6b3e93 (I6ffd5e9467), which recently removed the
gadgets-edit user right in favour of the editsite{css,js,json} rights.
Change-Id: I5b04ab251552e839087d0a8a6923d205adc7f771
2023-12-05 23:28:45 +00:00
"gadgets-supports-urlload" : "This gadget supports loading via URL with <code>?withgadget</code> query parameter."
2014-10-29 15:57:35 +00:00
}