mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-11 16:48:43 +00:00
Merge "Use different titles for "Edit" and "Edit source" links (section headings)"
This commit is contained in:
commit
4231c7a328
|
@ -157,7 +157,9 @@
|
|||
"createlocaldescription": "create-local",
|
||||
"createlocaldescriptionsource": "visualeditor-ca-createlocaldescriptionsource",
|
||||
"editsection": "editsection",
|
||||
"editsectionsource": "visualeditor-ca-editsource-section"
|
||||
"editsectionhint": "editsectionhint",
|
||||
"editsectionsource": "visualeditor-ca-editsource-section",
|
||||
"editsectionsourcehint": "visualeditor-ca-editsource-section-hint"
|
||||
}
|
||||
},
|
||||
"VisualEditorTabPosition": {
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
"visualeditor-ca-editlocaldescriptionsource": "Edit local description source",
|
||||
"visualeditor-ca-editsource": "Edit source",
|
||||
"visualeditor-ca-editsource-section": "edit source",
|
||||
"visualeditor-ca-editsource-section-hint": "Edit section's source code: $1",
|
||||
"visualeditor-categories-tool": "Categories",
|
||||
"visualeditor-changedesc-mwcategory-sortkey-changed": "Sort key changed from $1 to $2",
|
||||
"visualeditor-changedesc-mwcategory-sortkey-set": "Sort key set to $1",
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
"visualeditor-ca-editlocaldescriptionsource": "Text for the \"Edit local description source\" tab, if the page exists and the page is the local description of a file in a foreign repository (e.g. Wikimedia Commons). The tab allows the user to edit the local description page in the wikitext source code editor.\n\nCf. {{msg-mw|Edit-local}}",
|
||||
"visualeditor-ca-editsource": "Text for the \"Edit source\" tab, if the page exists. This is short \"Edit the source code of this page\" ({{msg-mw|Tooltip-ca-editsource}}).\n\nThe difference between \"Edit source\" and \"Edit\" ({{msg-mw|edit}}) is that when the Visual Editor is enabled, \"Edit source\" is for editing the page or the section in wikitext markup language, and \"Edit\" is for editing the page in VisualEditor. The word \"edit\" should be used in both messages (with necessary grammar adaptation).\n\nIf the page doesn't exist, the following link text is used: {{msg-mw|Visualeditor-ca-createsource}}\n\nUsed in:\n* {{msg-mw|Visualeditor-beta-warning}}\n* {{msg-mw|Visualeditor-wikitext-warning}}\n{{Identical|Edit source}}",
|
||||
"visualeditor-ca-editsource-section": "Used as link text for \"edit source\" mode of section edit links. This is short \"Edit the source code of this section\".\n\nCorresponds to the {{msg-mw|editsection}} message for default mode.\n{{Identical|Edit source}}",
|
||||
"visualeditor-ca-editsource-section-hint": "Tooltip shown when hovering the mouse over the link to edit a section's source code ({{msg-mw|visualeditor-ca-editsource-section}}).\n\nExample: Edit section's source code: Heading name\n\nParameters:\n* $1 - section heading name",
|
||||
"visualeditor-categories-tool": "Tool for opening the categories section of the meta dialog.\n{{Identical|Category}}",
|
||||
"visualeditor-changedesc-mwcategory-sortkey-changed": "Description of a category short key being changed from one value to another.",
|
||||
"visualeditor-changedesc-mwcategory-sortkey-set": "Description of a category short key being set to a value.",
|
||||
|
|
|
@ -741,6 +741,11 @@ class Hooks implements TextSlotDiffRendererTablePrefixHook {
|
|||
// * visualeditor-ca-editsource-section
|
||||
$sourceEditSection = $tabMessages['editsectionsource'];
|
||||
$result['editsection']['text'] = $skin->msg( $sourceEditSection )->inLanguage( $lang )->text();
|
||||
// The following messages can be used here:
|
||||
// * visualeditor-ca-editsource-section-hint
|
||||
$sourceEditSectionHint = $tabMessages['editsectionsourcehint'];
|
||||
$result['editsection']['attribs']['title'] = $skin->msg( $sourceEditSectionHint )->rawParams( $tooltip )
|
||||
->inLanguage( $lang )->text();
|
||||
}
|
||||
|
||||
// Exit if we're using the single edit tab.
|
||||
|
@ -753,10 +758,17 @@ class Hooks implements TextSlotDiffRendererTablePrefixHook {
|
|||
|
||||
// add VE edit section in VE available namespaces
|
||||
if ( self::isVisualAvailable( $title, $skin->getRequest(), $user ) ) {
|
||||
// The following messages can be used here:
|
||||
// * editsection
|
||||
$veEditSection = $tabMessages['editsection'];
|
||||
// The following messages can be used here:
|
||||
// * editsectionhint
|
||||
$veEditSectionHint = $tabMessages['editsectionhint'];
|
||||
|
||||
$attribs = $result['editsection']['attribs'];
|
||||
$attribs['class'] = ( $attribs['class'] ?? '' ) . ' mw-editsection-visualeditor';
|
||||
$attribs['title'] = $skin->msg( $veEditSectionHint )->rawParams( $tooltip )
|
||||
->inLanguage( $lang )->text();
|
||||
|
||||
$veLink = [
|
||||
'text' => $skin->msg( $veEditSection )->inLanguage( $lang )->text(),
|
||||
|
|
|
@ -1031,6 +1031,7 @@
|
|||
var $editsection = $( this ),
|
||||
$editSourceLink = $editsection.find( 'a' ).eq( 0 ),
|
||||
$editLink = $editSourceLink.clone(),
|
||||
sectionTitle = $editsection.siblings( '.mw-headline' ).text(),
|
||||
$divider = $( '<span>' ),
|
||||
dividerText = mw.msg( 'pipe-separator' );
|
||||
|
||||
|
@ -1039,9 +1040,17 @@
|
|||
// * config value of tabMessages.editsectionsource
|
||||
$editSourceLink.text( mw.msg( tabMessages.editsectionsource ) );
|
||||
// The following messages can be used here:
|
||||
// * visualeditor-ca-editsource-section-hint
|
||||
// * config value of tabMessages.editsectionsourcehint
|
||||
$editSourceLink.attr( 'title', mw.msg( tabMessages.editsectionsourcehint, sectionTitle ) );
|
||||
// The following messages can be used here:
|
||||
// * editsection
|
||||
// * config value of tabMessages.editsections
|
||||
// * config value of tabMessages.editsection
|
||||
$editLink.text( mw.msg( tabMessages.editsection ) );
|
||||
// The following messages can be used here:
|
||||
// * editsectionhint
|
||||
// * config value of tabMessages.editsectionhint
|
||||
$editLink.attr( 'title', mw.msg( tabMessages.editsectionhint, sectionTitle ) );
|
||||
|
||||
$divider
|
||||
.addClass( 'mw-editsection-divider' )
|
||||
|
|
Loading…
Reference in a new issue