Rename ReferencePreviews i18n keys from Popups

Final step to get the i18n key names align with this extension.

Note that the few community overrides should have a copy of the
keys we're changing here in place so the overrides work for both
variants as long as the deployment is not finished.

Bug: T363156
Change-Id: Idf098d2cb04e8f02247b78e6b4866338eaf02b44
This commit is contained in:
WMDE-Fisch 2024-04-26 13:11:54 +02:00
parent a62e855697
commit c87e6046ff
5 changed files with 32 additions and 32 deletions

View file

@ -41,13 +41,13 @@
"cite-tracking-category-cite-error-desc": "Pages in this category have errors in the usage of references tags.",
"cite-tracking-category-ref-extends": "Pages that use extended references",
"cite-tracking-category-ref-extends-desc": "Pages in this category use the \"extends\" attribute of the <ref> tag.",
"popups-refpreview-reference": "Reference",
"popups-refpreview-book": "Book reference",
"popups-refpreview-journal": "Journal reference",
"popups-refpreview-news": "News reference",
"popups-refpreview-note": "Note",
"popups-refpreview-web": "Web reference",
"popups-refpreview-collapsible-placeholder": "This reference includes a figure which does not fit in the preview.",
"cite-reference-previews-reference": "Reference",
"cite-reference-previews-book": "Book reference",
"cite-reference-previews-journal": "Journal reference",
"cite-reference-previews-news": "News reference",
"cite-reference-previews-note": "Note",
"cite-reference-previews-web": "Web reference",
"cite-reference-previews-collapsible-placeholder": "This reference includes a figure which does not fit in the preview.",
"cite_reference_backlink_symbol": "↑",
"cite_reference_link": "<sup id=\"$1\" class=\"reference\">[[#$2|&#91;$3&#93;]]</sup>",
"cite_references_link_one": "<li id=\"$1\"$4><span class=\"mw-cite-backlink\">[[#$2|↑]]</span> $3</li>",

View file

@ -46,13 +46,13 @@
"cite-tracking-category-cite-error-desc": "Tracking category description.",
"cite-tracking-category-ref-extends": "{{tracking category name}}\nThe [[:mw:Special:MyLanguage/Help:Tracking categories|tracking category]] to add to the article if it uses <code>&lt;ref&gt;</code> tags with an <code>extends</code> attribute.",
"cite-tracking-category-ref-extends-desc": "Description of the extends feature tracking category.",
"popups-refpreview-reference": "Default heading for popups that show previews of references as provided by the Cite extension's <ref> tags (also known as footnotes).\n{{Identical|Reference}}",
"popups-refpreview-book": "Heading for a popup previewing a citation from a book.\n{{Identical|Book}}",
"popups-refpreview-journal": "Heading for a popup previewing a citation from a journal.\n{{Identical|Journal}}",
"popups-refpreview-news": "Heading for a popup previewing a citation from the news.\n{{Identical|News}}",
"popups-refpreview-note": "Heading for a popup previewing a footnote.\n{{Identical|Note}}",
"popups-refpreview-web": "Heading for a popup previewing a citation from a website.\n{{Identical|Website}}",
"popups-refpreview-collapsible-placeholder": "Placeholder text for collapsible tables, templates, or other large elements inside of a reference.",
"cite-reference-previews-reference": "Default heading for popups that show previews of references as provided by the Cite extension's <ref> tags (also known as footnotes).\n{{Identical|Reference}}",
"cite-reference-previews-book": "Heading for a popup previewing a citation from a book.\n{{Identical|Book}}",
"cite-reference-previews-journal": "Heading for a popup previewing a citation from a journal.\n{{Identical|Journal}}",
"cite-reference-previews-news": "Heading for a popup previewing a citation from the news.\n{{Identical|News}}",
"cite-reference-previews-note": "Heading for a popup previewing a footnote.\n{{Identical|Note}}",
"cite-reference-previews-web": "Heading for a popup previewing a citation from a website.\n{{Identical|Website}}",
"cite-reference-previews-collapsible-placeholder": "Placeholder text for collapsible tables, templates, or other large elements inside of a reference.",
"cite_reference_backlink_symbol": "{{optional}}\nSymbol used for the reference section, used to link back to where the reference is used.",
"cite_reference_link": "{{notranslate}}\n\nParameters:\n* $1 - ref key\n* $2 - references key\n* $3 - link label",
"cite_references_link_one": "{{notranslate}}\n\nParameters:\n* $1 - references key\n* $2 - ref key\n* $3 - reference text\n* $4 - optional CSS class for direction",

View file

@ -45,14 +45,14 @@ function renderReferencePreview(
) {
const type = model.referenceType || 'generic';
// The following messages are used here:
// * popups-refpreview-book
// * popups-refpreview-journal
// * popups-refpreview-news
// * popups-refpreview-note
// * popups-refpreview-web
let titleMsg = mw.message( `popups-refpreview-${ type }` );
// * cite-reference-previews-book
// * cite-reference-previews-journal
// * cite-reference-previews-news
// * cite-reference-previews-note
// * cite-reference-previews-web
let titleMsg = mw.message( `cite-reference-previews-${ type }` );
if ( !titleMsg.exists() ) {
titleMsg = mw.message( 'popups-refpreview-reference' );
titleMsg = mw.message( 'cite-reference-previews-reference' );
}
const el = TEMPLATE.content.cloneNode( true ).children[ 0 ];
@ -91,7 +91,7 @@ function renderReferencePreview(
icon.classList.add( 'popups-icon', 'popups-icon--infoFilled' );
const label = document.createElement( 'span' );
label.classList.add( 'mwe-collapsible-placeholder-label' );
label.textContent = mw.msg( 'popups-refpreview-collapsible-placeholder' );
label.textContent = mw.msg( 'cite-reference-previews-collapsible-placeholder' );
otherNode.appendChild( icon );
otherNode.appendChild( label );
replaceWith( node, otherNode );

View file

@ -109,13 +109,13 @@ class CiteHooks implements
'referencePreview.less',
],
'messages' => [
'popups-refpreview-reference',
'popups-refpreview-book',
'popups-refpreview-journal',
'popups-refpreview-news',
'popups-refpreview-note',
'popups-refpreview-web',
'popups-refpreview-collapsible-placeholder',
'cite-reference-previews-reference',
'cite-reference-previews-book',
'cite-reference-previews-journal',
'cite-reference-previews-news',
'cite-reference-previews-note',
'cite-reference-previews-web',
'cite-reference-previews-collapsible-placeholder',
],
'packageFiles' => [
'index.js',

View file

@ -36,7 +36,7 @@ QUnit.test( 'createReferencePreview(model)', ( assert ) => {
assert.strictEqual(
$( preview.el ).find( '.mwe-popups-title' ).text().trim(),
'<popups-refpreview-web>'
'<cite-reference-previews-web>'
);
assert.strictEqual(
$( preview.el ).find( '.mw-parser-output' ).text().trim(),
@ -59,7 +59,7 @@ QUnit.test( 'createReferencePreview default title', ( assert ) => {
assert.strictEqual(
$( preview.el ).find( '.mwe-popups-title' ).text().trim(),
'<popups-refpreview-reference>'
'<cite-reference-previews-reference>'
);
} );
@ -92,6 +92,6 @@ QUnit.test( 'createReferencePreview collapsible/sortable handling', ( assert ) =
assert.strictEqual( $( preview.el ).find( 'th' ).attr( 'title' ), undefined );
assert.strictEqual(
$( preview.el ).find( '.mwe-collapsible-placeholder' ).text(),
'<popups-refpreview-collapsible-placeholder>'
'<cite-reference-previews-collapsible-placeholder>'
);
} );