From 8dab6986052901a45a560e300199c433519457a4 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Tue, 29 Oct 2024 19:38:08 +0100 Subject: [PATCH] MMV should have an affordance for which image is being viewed in the article (i18n) Additional change: * Bump bundle size for Codex module due to recent Codex update. Follow-Up: I701632faa6890bd1577eb725ac4b25579fb510b8 Bug: T377791 Change-Id: I110335dabbec15c9290b771440d172c877351d5a --- bundlesize.config.json | 2 +- extension.json | 1 + i18n/en.json | 1 + i18n/qqq.json | 1 + resources/mmv/mmv.lightboxinterface.js | 7 ++++++- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bundlesize.config.json b/bundlesize.config.json index d52bba3cf..97f371bbb 100644 --- a/bundlesize.config.json +++ b/bundlesize.config.json @@ -10,7 +10,7 @@ }, { "resourceModule": "mmv.codex", - "maxSize": "5.2 kB" + "maxSize": "5.4 kB" }, { "resourceModule": "mmv.ui.reuse", diff --git a/extension.json b/extension.json index 9dfa7c038..ed8c379f6 100644 --- a/extension.json +++ b/extension.json @@ -102,6 +102,7 @@ ], "messages": [ "license-header", + "multimediaviewer-current-image-number", "multimediaviewer-file-page", "multimediaviewer-enable-alert", "multimediaviewer-disable-confirmation-header", diff --git a/i18n/en.json b/i18n/en.json index 6e744a3c0..23217eb22 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -4,6 +4,7 @@ "Mark Holmquist " ] }, + "multimediaviewer-current-image-number": "$1 ⁄ $2", "multimediaviewer-desc": "Expand thumbnails in a larger size in a fullscreen interface", "multimediaviewer-optin-pref": "Enable [https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Media_Viewer/About Media Viewer]", "multimediaviewer-file-page": "Go to corresponding file page", diff --git a/i18n/qqq.json b/i18n/qqq.json index 2f328048a..a1ba6a7d0 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -17,6 +17,7 @@ "Wladek92" ] }, + "multimediaviewer-current-image-number": "Message for displaying the current image number ($1) and the total number of images ($2).", "multimediaviewer-desc": "{{desc|name=Multimedia Viewer|url=https://www.mediawiki.org/wiki/Extension:MultimediaViewer}}", "multimediaviewer-optin-pref": "Label for preference to enable the Media Viewer.", "multimediaviewer-file-page": "Text for a link to the file page for an image.", diff --git a/resources/mmv/mmv.lightboxinterface.js b/resources/mmv/mmv.lightboxinterface.js index 652ba1c82..0ded22e34 100644 --- a/resources/mmv/mmv.lightboxinterface.js +++ b/resources/mmv/mmv.lightboxinterface.js @@ -492,7 +492,12 @@ class LightboxInterface extends UiElement { this.buttons.setOffset( prevNextTop ); this.buttons.$nav.toggle( imageCount > 1 ); - this.buttons.$currentImageNumber.show().html( `${ currentIndex + 1 } ⁄ ${ imageCount }` ); + this.buttons.$currentImageNumber.show().text( + mw.msg( 'multimediaviewer-current-image-number', + mw.language.convertNumber( currentIndex + 1 ), + mw.language.convertNumber( imageCount ) + ) + ); } /**