Merge "Follow-up d67121f6d: Blocks can apply to non-User objects too"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 31 Oct 2018 16:10:59 +0000 (16:10 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 31 Oct 2018 16:10:59 +0000 (16:10 +0000)
25 files changed:
RELEASE-NOTES-1.33
includes/DefaultSettings.php
includes/Linker.php
includes/api/i18n/pt.json
includes/api/i18n/zh-hant.json
includes/auth/AuthManager.php
includes/media/ImageHandler.php
includes/media/SvgHandler.php
includes/parser/Parser.php
languages/i18n/ace.json
languages/i18n/be-tarask.json
languages/i18n/bg.json
languages/i18n/ckb.json
languages/i18n/fi.json
languages/i18n/hu.json
languages/i18n/it.json
languages/i18n/jv.json
languages/i18n/lt.json
languages/i18n/pt.json
languages/i18n/sr-ec.json
resources/src/mediawiki.special.preferences/tabs.legacy.js [deleted file]
tests/parser/ParserTestRunner.php
tests/parser/parserTests.txt
tests/phpunit/includes/media/SVGTest.php [deleted file]
tests/phpunit/includes/media/SvgHandlerTest.php [new file with mode: 0644]

index 3e7e496..5ed9d5a 100644 (file)
@@ -11,7 +11,8 @@ production.
 * $wgEnablePartialBlocks – This enables the Partial Blocks feature, which gives
   accounts with block permissions the ability to block users, IPs, and IP ranges
   from editing specific pages, while allowing them to edit the rest of the wiki.
-* …
+* $wgMediaInTargetLanguage – whether multilingual images should be dispalyed in
+  the current parse language where available.
 
 ==== Changed configuration ====
 * …
index 82dbecf..9c26a28 100644 (file)
@@ -1225,6 +1225,16 @@ $wgSVGMetadataCutoff = 262144;
  */
 $wgAllowTitlesInSVG = false;
 
+/**
+ * Whether thumbnails should be generated in target language (usually, same as
+ * page language), if available.
+ * Currently, applies only to SVG images that use the systemLanguage attribute
+ * to specify text language.
+ *
+ * @since 1.33
+ */
+$wgMediaInTargetLanguage = false;
+
 /**
  * The maximum number of pixels a source image can have if it is to be scaled
  * down by a scaler that requires the full source image to be decompressed
index a3fba83..1d1ad06 100644 (file)
@@ -289,6 +289,7 @@ class Linker {
         *          link-title      Title object to link to
         *          link-target     Value for the target attribute, only with link-url
         *          no-link         Boolean, suppress description link
+        *          targetlang      (optional) Target language code, see Parser::getTargetLanguage()
         *
         * @param array $handlerParams Associative array of media handler parameters, to be passed
         *       to transform(). Typical keys are "width" and "page".
index c7fa15c..a9a7020 100644 (file)
        "apihelp-query+users-paramvalue-prop-editcount": "Adiciona a contagem de edições do utilizador.",
        "apihelp-query+users-paramvalue-prop-registration": "Adiciona a data e hora de registo do utilizador.",
        "apihelp-query+users-paramvalue-prop-emailable": "Etiqueta que indica se o utilizador pode e quer receber correio eletrónico através de [[Special:Emailuser]].",
-       "apihelp-query+users-paramvalue-prop-gender": "Etiqueta que indica o género do utilizador. Devolve \"male\" (masculino), \"female\" (feminino) ou \"unknown\" (desconhecido).",
+       "apihelp-query+users-paramvalue-prop-gender": "Etiqueta que indica o sexo do utilizador. Devolve \"male\" (masculino), \"female\" (feminino) ou \"unknown\" (desconhecido).",
        "apihelp-query+users-paramvalue-prop-centralids": "Adiciona os identificadores centrais e o estado de ligação central (''attachment'') do utilizador.",
        "apihelp-query+users-paramvalue-prop-cancreate": "Indica se pode ser criada uma conta para os nomes de utilizador não registados, mas válidos.",
        "apihelp-query+users-param-attachedwiki": "Com <kbd>$1prop=centralids</kbd>, indicar se o utilizador tem ligação com a wiki designada por este identificador.",
index 3d73e0d..6584506 100644 (file)
@@ -44,6 +44,7 @@
        "apihelp-block-param-reblock": "若使用者已被封鎖,覆寫既有的封鎖設定值。",
        "apihelp-block-param-watchuser": "監視使用者或 IP 位址的使用者頁面與對話頁面。",
        "apihelp-block-param-tags": "在封鎖日誌裡更改套用到項目的標籤。",
+       "apihelp-block-param-partial": "封鎖使用者訪問特殊頁面或命名空間,而不是整個網站。",
        "apihelp-block-example-ip-simple": "封鎖 IP 位址 <kbd>192.0.2.5</kbd> 三天,原因為 <kbd>First strike</kbd>。",
        "apihelp-block-example-user-complex": "永久封鎖 IP 位址 <kbd>Vandal</kbd>,原因為 <kbd>Vandalism</kbd>。",
        "apihelp-changeauthenticationdata-summary": "為目前使用者變更身分核對資料。",
        "apihelp-expandtemplates-param-revid": "修訂 ID,用於 <code><nowiki>{{REVISIONID}}</nowiki></code> 和相似變數。",
        "apihelp-expandtemplates-paramvalue-prop-wikitext": "展開的 wiki 文字。",
        "apihelp-expandtemplates-paramvalue-prop-properties": "透過在 wiki 文字裡擴充魔術字所定義的頁面屬性。",
+       "apihelp-expandtemplates-paramvalue-prop-volatile": "輸出內容是否易變,且是否不應在頁面其它位置裡重複使用。",
        "apihelp-expandtemplates-paramvalue-prop-jsconfigvars": "指定頁面的 JavaScript 設置變量。",
        "apihelp-expandtemplates-paramvalue-prop-encodedjsconfigvars": "指定頁面的 JavaScript 設置變量為 JSON 字串。",
        "apihelp-expandtemplates-param-includecomments": "輸出裡是否包含 HTML 註解。",
        "apihelp-feedrecentchanges-param-hidemyself": "隱藏由目前使用者做出的更改。",
        "apihelp-feedrecentchanges-param-hidecategorization": "隱藏分類成員更改。",
        "apihelp-feedrecentchanges-param-tagfilter": "按標籤篩選。",
+       "apihelp-feedrecentchanges-param-target": "僅顯示從該頁面所連結頁面上的變更。",
        "apihelp-feedrecentchanges-example-simple": "顯示近期變更。",
        "apihelp-feedrecentchanges-example-30days": "顯示近期30天內的變動",
        "apihelp-feedwatchlist-summary": "返回監視清單 feed。",
        "apihelp-help-summary": "顯示指定模組的說明。",
        "apihelp-help-param-toc": "在 HTML 輸出裡包含目錄。",
        "apihelp-help-example-main": "主模組使用說明",
+       "apihelp-help-example-submodules": "用於 <kbd>action=query</kbd> 與其所有子模組的幫助。",
        "apihelp-help-example-recursive": "一個頁面中的所有說明。",
        "apihelp-help-example-help": "說明模組自身的說明。",
        "apihelp-help-example-query": "兩個查詢子模組的說明。",
        "apihelp-import-param-namespace": "匯入至此命名空間。無法與 <var>$1rootpage</var> 一起使用。",
        "apihelp-import-param-rootpage": "匯入作為此頁面的子頁面。無法與 <var>$1namespace</var> 一起使用。",
        "apihelp-import-example-import": "以完整歷史紀錄匯入 [[meta:Help:ParserFunctions]] 至命名空間 100。",
+       "apihelp-linkaccount-summary": "從第三方供應者來連結帳號至目前的使用者。",
        "apihelp-linkaccount-example-link": "開始進行從 <kbd>Example</kbd> 連結至帳號的程序。",
        "apihelp-login-summary": "登入並取得身分核對 cookies",
        "apihelp-login-param-name": "使用者名稱。",
        "apihelp-parse-paramvalue-prop-iwlinks": "在已解析的 wiki 文字提供跨 wiki 連結。",
        "apihelp-parse-paramvalue-prop-wikitext": "指定被解析的原始 wiki 文字。",
        "apihelp-parse-paramvalue-prop-properties": "指定多項定義在已解析原始 wiki 文字的屬性。",
+       "apihelp-parse-paramvalue-prop-limitreportdata": "取得結構化限制報告。當有設定 <var>$1disablelimitreport</var> 時,則不會給予資料。",
+       "apihelp-parse-paramvalue-prop-limitreporthtml": "取得限制報告的 HTML 版本。當有設定 <var>$1disablelimitreport</var> 時,則不會給予資料。",
        "apihelp-parse-paramvalue-prop-parsewarnings": "提供發生在解析內容時的警告。",
        "apihelp-parse-param-disablepp": "請改用<var>$1disablelimitreport</var>。",
        "apihelp-parse-param-disableeditsection": "從解析輸出內容省略編輯段落連結。",
        "apihelp-query+allrevisions-param-generatetitles": "當作為產生器時使用,產生標題而非修訂 ID。",
        "apihelp-query+allrevisions-example-user": "列出由使用者 <kbd>Example</kbd> 做出的最近 50 個貢獻。",
        "apihelp-query+allrevisions-example-ns-main": "列出在主命名空間的前 50 個修訂。",
+       "apihelp-query+mystashedfiles-summary": "取得在目前使用者上傳儲藏裡的檔案清單。",
        "apihelp-query+mystashedfiles-param-prop": "要索取的檔案屬性。",
        "apihelp-query+mystashedfiles-paramvalue-prop-size": "索取檔案大小與圖片尺寸。",
        "apihelp-query+mystashedfiles-paramvalue-prop-type": "索取檔案的 MIME 類型以及媒體類型。",
        "apihelp-query+deletedrevs-example-mode3-main": "列出在主命名空間的前 50 個已刪除修訂(模式 3)。",
        "apihelp-query+deletedrevs-example-mode3-talk": "列出在{{ns:talk}}命名空間的前 50 個已刪除頁面(模式 3)。",
        "apihelp-query+disabled-summary": "已停用此查詢模組。",
+       "apihelp-query+duplicatefiles-summary": "基於雜湊值來列出指定檔案裡的所有重複檔案。",
        "apihelp-query+duplicatefiles-param-limit": "要回傳的重複檔案數量。",
        "apihelp-query+duplicatefiles-param-dir": "列出時所採用的方向。",
        "apihelp-query+duplicatefiles-param-localonly": "僅查看在本地端儲存庫的檔案。",
        "apihelp-query+info-paramvalue-prop-readable": "使用者是否可閱讀此頁面。請改用 <kbd>intestactions=read</kbd>。",
        "apihelp-query+info-paramvalue-prop-preload": "取得由 EditFormPreloadText 回傳的文字。",
        "apihelp-query+info-param-testactions": "測試目前使用者是否可執行頁面上的某項操作。",
+       "apihelp-query+info-paramvalue-testactionsdetail-boolean": "回傳各操作的布林值。",
+       "apihelp-query+info-paramvalue-testactionsdetail-quick": "像是 <kbd>full</kbd>;但跳過耗費的檢查。",
        "apihelp-query+info-param-token": "請改用 [[Special:ApiHelp/query+tokens|action=query&meta=tokens]]。",
        "apihelp-query+info-example-simple": "取得有關頁面 <kbd>Main Page</kbd> 的資訊。",
        "apihelp-query+info-example-protection": "取得有關 <kbd>Main Page</kbd> 的一般與保護資訊。",
        "apihelp-query+langlinks-param-url": "是否取得完整的 URL(不能與 <var>$1prop</var> 一同使用)。",
        "apihelp-query+langlinks-param-prop": "為各跨語言連結所要取得的額外屬性:",
        "apihelp-query+langlinks-paramvalue-prop-url": "添加完整的 URL。",
+       "apihelp-query+langlinks-paramvalue-prop-langname": "添加本地化語言名稱(盡可能)。使用 <var>$1inlanguagecode</var> 來控制語言。",
        "apihelp-query+langlinks-paramvalue-prop-autonym": "添加本地語言名稱。",
        "apihelp-query+langlinks-param-lang": "僅回傳帶有此語言代碼的語言連結。",
        "apihelp-query+langlinks-param-title": "要搜尋的連結。必須與 <var>$1lang</var> 一起使用。",
        "apihelp-query+links-param-dir": "列出時所採用的方向。",
        "apihelp-query+links-example-simple": "從頁面 <kbd>Main Page</kbd> 取得連結。",
        "apihelp-query+links-example-generator": "取得在 <kbd>Main Page</kbd> 頁面的連結頁面相關資訊。",
+       "apihelp-query+links-example-namespaces": "取得來自 {{ns:user}} 與 {{ns:template}} 命名空間的頁面 <kbd>Main Page</kbd> 之連結。",
        "apihelp-query+linkshere-summary": "找出連結至指定頁面的所有頁面。",
        "apihelp-query+linkshere-param-prop": "要取得的屬性。",
        "apihelp-query+linkshere-paramvalue-prop-pageid": "各頁面的頁面 ID。",
        "apihelp-query+prefixsearch-param-offset": "要略過的結果數量。",
        "apihelp-query+prefixsearch-example-simple": "搜尋開頭為 <kbd>meaning</kbd> 的頁面標題。",
        "apihelp-query+prefixsearch-param-profile": "搜尋要使用的配置。",
+       "apihelp-query+protectedtitles-summary": "列出所有被創建保護的標題。",
        "apihelp-query+protectedtitles-param-namespace": "僅列出這些命名空間的標題。",
        "apihelp-query+protectedtitles-param-level": "僅列出具有這些保護層級的標題。",
        "apihelp-query+protectedtitles-param-limit": "要回傳的頁面總數。",
+       "apihelp-query+protectedtitles-param-start": "在此保護時間戳記開始列出。",
+       "apihelp-query+protectedtitles-param-end": "在此保護時間戳記停止列出。",
        "apihelp-query+protectedtitles-param-prop": "要取得的屬性。",
        "apihelp-query+protectedtitles-paramvalue-prop-user": "添加做出添加保護操作的使用者。",
        "apihelp-query+protectedtitles-paramvalue-prop-userid": "添加做出添加保護操作的使用者 ID。",
        "apihelp-query+revisions+base-paramvalue-prop-size": "修訂的長度(位元組)。",
        "apihelp-query+revisions+base-paramvalue-prop-sha1": "修訂的 SHA-1(base 16)。",
        "apihelp-query+revisions+base-paramvalue-prop-tags": "修訂標籤。",
+       "apihelp-query+revisions+base-paramvalue-prop-parsetree": "請改用 <kbd>[[Special:ApiHelp/expandtemplates|action=expandtemplates]]</kbd> 或 <kbd>[[Special:ApiHelp/parse|action=parse]]</kbd>。修訂內容的 XML 解析樹狀(需要內容模組 <code>$1</code>)。",
        "apihelp-query+revisions+base-param-limit": "限制所回傳的修訂數量。",
+       "apihelp-query+revisions+base-param-expandtemplates": "請改用 <kbd>[[Special:ApiHelp/expandtemplates|action=expandtemplates]]</kbd>。在修訂內容裡展開模板(需要 $1prop=content)。",
+       "apihelp-query+revisions+base-param-generatexml": "請改用 <kbd>[[Special:ApiHelp/expandtemplates|action=expandtemplates]]</kbd> 或 <kbd>[[Special:ApiHelp/parse|action=parse]]</kbd>。產生用於修訂內容的 XML 解析樹狀(需要 $1prop=content)。",
+       "apihelp-query+revisions+base-param-parse": "請改用 <kbd>[[Special:ApiHelp/parse|action=parse]]</kbd>。解析修訂內容(需要 $1prop=content)。基於效能緣故,若有使用此選項,$1limit 會被強制為 1。",
        "apihelp-query+search-summary": "執行全文搜尋。",
        "apihelp-query+search-param-namespace": "僅以這些命名空間搜尋。",
        "apihelp-query+search-param-what": "要執行的搜尋類型。",
        "apihelp-query+siteinfo-paramvalue-prop-usergroups": "回傳使用者群組以及所分配權限。",
        "apihelp-query+siteinfo-paramvalue-prop-libraries": "回傳安裝在 wiki 上的函式庫。",
        "apihelp-query+siteinfo-paramvalue-prop-extensions": "回傳安裝在 wiki 上的擴充功能。",
+       "apihelp-query+siteinfo-paramvalue-prop-fileextensions": "回傳允許上傳的副檔名(檔案類型)清單。",
        "apihelp-query+siteinfo-paramvalue-prop-extensiontags": "回傳解析擴充標籤清單。",
+       "apihelp-query+siteinfo-paramvalue-prop-functionhooks": "回傳解析器函式掛勾清單。",
        "apihelp-query+siteinfo-paramvalue-prop-defaultoptions": "回傳用於使用者偏好設定的預設值。",
        "apihelp-query+siteinfo-paramvalue-prop-uploaddialog": "回傳上傳對話框的設置。",
        "apihelp-query+siteinfo-param-filteriw": "僅回傳跨 wiki 地圖的本地端或非本地端項目。",
        "apihelp-query+siteinfo-example-replag": "檢查目前的響應延遲。",
        "apihelp-query+stashimageinfo-summary": "回傳多筆儲藏檔案的檔案資訊。",
        "apihelp-query+stashimageinfo-example-simple": "回傳儲藏檔案的檔案資訊。",
+       "apihelp-query+stashimageinfo-example-params": "回傳縮圖或兩個已儲藏檔案。",
        "apihelp-query+tags-summary": "列出變更標記。",
        "apihelp-query+tags-param-limit": "能列出標籤的最大數量。",
        "apihelp-query+tags-param-prop": "要取得的屬性。",
        "apihelp-query+templates-param-limit": "要回傳的模板數量。",
        "apihelp-query+templates-param-dir": "列出時所採用的方向。",
        "apihelp-query+templates-example-simple": "取得在頁面 <kbd>Main Page</kbd> 使用到的模坂。",
+       "apihelp-query+templates-example-generator": "取得使用在 <kbd>Main Page</kbd> 的模版頁面相關資訊。",
        "apihelp-query+tokens-param-type": "要求的權杖類型。",
        "apihelp-query+tokens-example-simple": "接收 csrf 密鑰 (預設)。",
        "apihelp-query+tokens-example-types": "接收監視密鑰以及巡邏密鑰。",
        "apihelp-query+users-paramvalue-prop-rights": "列出各使用者所擁有的權限。",
        "apihelp-query+users-paramvalue-prop-editcount": "添加使用者的編輯數。",
        "apihelp-query+users-paramvalue-prop-registration": "添加使用者的註冊時間戳記。",
+       "apihelp-query+users-paramvalue-prop-gender": "標記使用者性別。回傳「male」、「female」、或「unknown」。",
        "apihelp-query+users-param-users": "要獲取的使用者清單。",
        "apihelp-query+users-param-userids": "要獲取的使用者 ID 清單。",
        "apihelp-query+users-param-token": "請改用 <kbd>[[Special:ApiHelp/query+tokens|action=query&meta=tokens]]</kbd>。",
        "apihelp-query+users-example-simple": "返回使用者 <kbd>Example</kbd> 的資訊。",
+       "apihelp-query+watchlist-summary": "取得在目前使用者的監視清單裡,頁面的近期變更。",
        "apihelp-query+watchlist-param-start": "起始列舉的時間戳記。",
        "apihelp-query+watchlist-param-end": "結束列舉的時間戳記。",
        "apihelp-query+watchlist-param-namespace": "篩選僅為指定命名空間的更改。",
        "apihelp-query+watchlist-paramvalue-type-new": "頁面建立。",
        "apihelp-query+watchlist-paramvalue-type-log": "日誌項目。",
        "apihelp-query+watchlist-paramvalue-type-categorize": "分類成員更改。",
+       "apihelp-query+watchlist-example-generator": "索取在目前使用者監視清單裡近期變更頁面的頁面資訊。",
        "apihelp-query+watchlistraw-summary": "列出在目前使用者的監視清單裡頭所有頁面。",
        "apihelp-query+watchlistraw-param-namespace": "僅列出在指定命名空間的頁面。",
        "apihelp-query+watchlistraw-param-limit": "每個請求要回傳的結果總數。",
        "apihelp-query+watchlistraw-param-prop": "要取得的額外屬性:",
        "apihelp-query+watchlistraw-param-show": "僅列出符合這些準則的項目。",
        "apihelp-query+watchlistraw-param-dir": "列出時所採用的方向。",
+       "apihelp-query+watchlistraw-param-fromtitle": "要開始列舉的標題(帶有命名空間前綴)。",
+       "apihelp-query+watchlistraw-param-totitle": "要停止列舉的標題(帶有命名空間前綴)。",
        "apihelp-query+watchlistraw-example-simple": "列出在目前使用者的監視清單裡頭頁面。",
        "apihelp-query+watchlistraw-example-generator": "索取在目前使用者監視清單裡頁面的頁面資訊。",
        "apihelp-removeauthenticationdata-summary": "為目前使用者移除身分核對資料。",
        "apihelp-rollback-param-title": "要回退的頁面標題。不可與 <var>$1pageid</var> 同時使用。",
        "apihelp-rollback-param-pageid": "要回退的頁面 ID。不可與 <var>$1title</var> 同時使用。",
        "apihelp-rollback-param-tags": "套用到回退的標籤。",
+       "apihelp-rollback-param-user": "編輯被回退的使用者名稱。",
        "apihelp-rollback-param-summary": "自定義編輯摘要。若為空,則使用預設摘要。",
        "apihelp-rollback-param-markbot": "將回退的編輯以及回退操作標記為機器人所做編輯。",
        "apihelp-rollback-param-watchlist": "無條件使用設置將頁面加入或移除目前使用者的監視清單或者是不更改監視清單。",
        "apihelp-setpagelanguage-example-default": "將 ID 是 123 頁面的語言更改為 wiki 的預設內容語言。",
        "apihelp-stashedit-summary": "在分享快取裡預備編輯。",
        "apihelp-stashedit-param-title": "正在編輯此頁面的標題。",
+       "apihelp-stashedit-param-sectiontitle": "新章節的標題。",
        "apihelp-stashedit-param-text": "頁面內容。",
+       "apihelp-stashedit-param-stashedtexthash": "要替代使用的來自先前儲藏裡頁面內容雜湊。",
        "apihelp-stashedit-param-contentmodel": "新內容的內容模組。",
        "apihelp-stashedit-param-contentformat": "用於輸入文字的內容序列化格式。",
        "apihelp-stashedit-param-baserevid": "基本修訂的修訂 ID。",
        "apihelp-upload-param-ignorewarnings": "忽略所有警告。",
        "apihelp-upload-param-file": "檔案內容。",
        "apihelp-upload-param-url": "索取檔案的來源 URL。",
+       "apihelp-upload-param-stash": "若設定的話,伺服器將會把檔案臨時暫存;而不是添加至儲存庫裡。",
        "apihelp-upload-param-filesize": "整體上傳的檔案大小。",
        "apihelp-upload-param-chunk": "大量內容。",
        "apihelp-upload-param-async": "在可能的情況下讓潛在的大型檔案非同步處理。",
        "apierror-badquery": "無效的查詢。",
        "apierror-blockedfrommail": "您已被封鎖,無法發送電子郵件。",
        "apierror-blocked": "您已被封鎖,無法編輯。",
+       "apierror-blocked-partial": "您已被禁止編輯此頁面。",
        "apierror-botsnotsupported": "此介面不支援機器人。",
        "apierror-cannotviewtitle": "您不被允許檢視$1。",
        "apierror-cantblock-email": "您沒有權限來封鎖使用者透過 wiki 來發送電子郵件。",
        "apierror-mustbeloggedin-generic": "您必須登入。",
        "apierror-mustbeloggedin-linkaccounts": "您必須登入到連結帳號。",
        "apierror-mustbeloggedin-removeauth": "必須登入,才能移除身分核對資取。",
+       "apierror-mustbeloggedin-uploadstash": "上傳儲藏僅對已登入使用者可用。",
        "apierror-mustbeloggedin": "您必須登入才能$1。",
        "apierror-nochanges": "沒有請求的更改。",
        "apierror-nodeleteablefile": "沒有這樣檔案的舊版本。",
        "apierror-nouploadmodule": "未設定上傳模組。",
        "apierror-opensearch-json-warnings": "警告不能以 OpenSearch JSON 格式表示。",
        "apierror-pagecannotexist": "命名空間不允許實際頁面。",
+       "apierror-paramempty": "參數 <var>$1</var> 不能為空。",
+       "apierror-parsetree-notwikitext": "<kbd>prop=parsetree</kbd> 僅支援用於 wiki 文字內容。",
+       "apierror-parsetree-notwikitext-title": "<kbd>prop=parsetree</kbd> 僅支援用於 wiki 文字內容。$1使用內容模組 $2。",
        "apierror-permissiondenied": "您沒有權限$1。",
        "apierror-permissiondenied-generic": "權限不足。",
        "apierror-permissiondenied-unblock": "您沒有權限來解封使用者。",
+       "apierror-prefixsearchdisabled": "前綴搜尋在 Miser 模式裡被停用。",
        "apierror-protect-invalidaction": "無效的保護類型「$1」。",
        "apierror-protect-invalidlevel": "無效的保護層級「$1」。",
        "apierror-readapidenied": "您需要有閱讀權限來使用此模組。",
        "apierror-readonly": "Wiki 目前為唯讀模式。",
        "apierror-reauthenticate": "於本工作階段還未核對身分,請重新核對。",
+       "apierror-revdel-needtarget": "此 RevDel 類型需要目標標題。",
        "apierror-revwrongpage": "r$1 不是$2的修訂。",
        "apierror-searchdisabled": "<var>$1</var>搜尋已停用。",
+       "apierror-sectionreplacefailed": "無法合併更新的章節。",
+       "apierror-show": "不正確的參數 - 不可提供互斥值。",
        "apierror-sizediffdisabled": "大小差異功能在 Miser 模式裡已停用。",
+       "apierror-spamdetected": "您的編輯被拒絕,因為有包含部份垃圾訊息內容:<code>$1</code>。",
+       "apierror-specialpage-cantexecute": "您沒有權限來查看此特殊頁面的結果。",
+       "apierror-stashedfilenotfound": "在儲藏裡找不到檔案:$1。",
+       "apierror-stashedit-missingtext": "給予的雜湊裡查無儲藏文字。",
+       "apierror-stashfilestorage": "在儲藏裡不能儲存上傳:$1。",
+       "apierror-stashinvalidfile": "無效的儲藏檔案。",
        "apierror-stashnosuchfilekey": "沒有這樣的檔案鍵:$1。",
        "apierror-stashwrongowner": "錯誤擁有者:$1",
+       "apierror-stashzerolength": "檔案長度為零,且無法儲存於儲藏:$1。",
        "apierror-systemblocked": "您已被 MediaWiki 給自動封鎖。",
        "apierror-timeout": "伺服器未有在預計的時間內回應。",
        "apierror-unknownerror-editpage": "不明編輯頁面錯誤:$1。",
        "apierror-unknownerror": "不明錯誤:\"$1\"。",
        "apierror-unknownformat": "無法識別的格式\"$1\"。",
        "apierror-unrecognizedparams": "無法識別的{{PLURAL:$2|參數|參數}}:$1。",
+       "apierror-upload-inprogress": "來自儲藏的上傳已在進行中。",
        "apierror-upload-missingresult": "狀態資料裡沒有結果。",
+       "apierror-writeapidenied": "您不被允許透過 API 來編輯此 wiki。",
+       "apiwarn-compare-nocontentmodel": "沒有可確定的內容模組,假定為 $1。",
        "apiwarn-deprecation-httpsexpected": "當應為 HTTPS 時,HTTP 要被使用。",
        "apiwarn-invalidcategory": "「$1」不是一個分類。",
        "apiwarn-invalidtitle": "「$1」不是一個有效標題。",
index c2e6d32..aae5a83 100644 (file)
@@ -1224,7 +1224,7 @@ class AuthManager implements LoggerAwareInterface {
                                        return $ret;
                                }
                        } else {
-                               if ( $user->getId() == 0 ) {
+                               if ( $user->getId() === 0 ) {
                                        $this->logger->debug( __METHOD__ . ': User does not exist locally when it should', [
                                                'user' => $user->getName(),
                                                'creator' => $creator->getName(),
index a0a1603..e88c1b0 100644 (file)
@@ -83,7 +83,7 @@ abstract class ImageHandler extends MediaHandler {
         * @param array &$params
         * @return bool
         */
-       function normaliseParams( $image, &$params ) {
+       public function normaliseParams( $image, &$params ) {
                $mimeType = $image->getMimeType();
 
                if ( !isset( $params['width'] ) ) {
index a9c7b4f..e3057f4 100644 (file)
@@ -136,6 +136,16 @@ class SvgHandler extends ImageHandler {
                return null;
        }
 
+       /**
+        * Determines render language from image parameters
+        *
+        * @param array $params
+        * @return string
+        */
+       protected function getLanguageFromParams( array $params ) {
+               return $params['lang'] ?? $params['targetlang'] ?? 'en';
+       }
+
        /**
         * What language to render file in if none selected
         *
@@ -160,11 +170,27 @@ class SvgHandler extends ImageHandler {
         * @param array &$params
         * @return bool
         */
-       function normaliseParams( $image, &$params ) {
-               global $wgSVGMaxSize;
-               if ( !parent::normaliseParams( $image, $params ) ) {
-                       return false;
+       public function normaliseParams( $image, &$params ) {
+               if ( parent::normaliseParams( $image, $params ) ) {
+                       $params = $this->normaliseParamsInternal( $image, $params );
+                       return true;
                }
+
+               return false;
+       }
+
+       /**
+        * Code taken out of normaliseParams() for testability
+        *
+        * @since 1.33
+        *
+        * @param File $image
+        * @param array $params
+        * @return array Modified $params
+        */
+       protected function normaliseParamsInternal( $image, $params ) {
+               global $wgSVGMaxSize;
+
                # Don't make an image bigger than wgMaxSVGSize on the smaller side
                if ( $params['physicalWidth'] <= $params['physicalHeight'] ) {
                        if ( $params['physicalWidth'] > $wgSVGMaxSize ) {
@@ -181,8 +207,15 @@ class SvgHandler extends ImageHandler {
                                $params['physicalHeight'] = $wgSVGMaxSize;
                        }
                }
+               // To prevent the proliferation of thumbnails in languages not present in SVGs, unless
+               // explicitly forced by user.
+               if ( isset( $params['targetlang'] ) ) {
+                       if ( !$image->getMatchedLanguage( $params['targetlang'] ) ) {
+                               unset( $params['targetlang'] );
+                       }
+               }
 
-               return true;
+               return $params;
        }
 
        /**
@@ -201,7 +234,7 @@ class SvgHandler extends ImageHandler {
                $clientHeight = $params['height'];
                $physicalWidth = $params['physicalWidth'];
                $physicalHeight = $params['physicalHeight'];
-               $lang = $params['lang'] ?? $this->getDefaultRenderLanguage( $image );
+               $lang = $this->getLanguageFromParams( $params );
 
                if ( $flags & self::TRANSFORM_LATER ) {
                        return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
@@ -531,8 +564,9 @@ class SvgHandler extends ImageHandler {
         */
        public function makeParamString( $params ) {
                $lang = '';
-               if ( isset( $params['lang'] ) && $params['lang'] !== 'en' ) {
-                       $lang = 'lang' . strtolower( $params['lang'] ) . '-';
+               $code = $this->getLanguageFromParams( $params );
+               if ( $code !== 'en' ) {
+                       $lang = 'lang' . strtolower( $code ) . '-';
                }
                if ( !isset( $params['width'] ) ) {
                        return false;
index 3509200..721d1fb 100644 (file)
@@ -5258,6 +5258,8 @@ class Parser {
                #  * bottom
                #  * text-bottom
 
+               global $wgMediaInTargetLanguage;
+
                # Protect LanguageConverter markup when splitting into parts
                $parts = StringUtils::delimiterExplode(
                        '-{', '}-', '|', $options, true /* allow nesting */
@@ -5415,6 +5417,9 @@ class Parser {
                        # Use the "caption" for the tooltip text
                        $params['frame']['title'] = $this->stripAltText( $caption, $holders );
                }
+               if ( $wgMediaInTargetLanguage ) {
+                       $params['handler']['targetlang'] = $this->getTargetLanguage()->getCode();
+               }
 
                Hooks::run( 'ParserMakeImageParams', [ $title, $file, &$params, $this ] );
 
index 01f42e1..2eea4a8 100644 (file)
        "searchprofile-images": "Multimedia",
        "searchprofile-everything": "Ban dum",
        "searchprofile-advanced": "Tingkat lanjut",
-       "searchprofile-articles-tooltip": "Mita bak $1",
+       "searchprofile-articles-tooltip": "Mita lam $1",
        "searchprofile-images-tooltip": "Mita beureukaih",
        "searchprofile-everything-tooltip": "Mita ban dum laman asoë (rôh ôn marit)",
-       "searchprofile-advanced-tooltip": "Mita bak ruweuëng nan meupat-pat",
+       "searchprofile-advanced-tooltip": "Mita lam ruweuëng nan kustom",
        "search-result-size": "$1 ({{PLURAL:$2|1 narit|$2 narit}})",
        "search-result-category-size": "{{PLURAL:$1|1 anggeeta|$1 anggeeta}} ({{PLURAL:$2|1 aneuk kawan|$2 aneuk kawan}}, {{PLURAL:$3|1 beureukaih|$3 beureukaih}})",
        "search-redirect": "(geupupinah nibak $1)",
        "tooltip-ca-move": "Pupinah laman nyoë",
        "tooltip-ca-watch": "Tamah laman nyoë u dapeuta keunalön",
        "tooltip-ca-unwatch": "Sampôh laman nyoë nibak dapeuta kalön droëneuh",
-       "tooltip-search": "Mita {{SITENAME}}",
-       "tooltip-search-go": "Mita saboh laman ngon nan nyang peureuséh lagèë nyoë meunyo na",
+       "tooltip-search": "Mita lam {{SITENAME}}",
+       "tooltip-search-go": "Mita saboh laman ngon nan nyang paih lagèe nyoe meunyo na",
        "tooltip-search-fulltext": "Mita laman nyang na asoë lagèë nyoë",
        "tooltip-p-logo": "Saweuë ôn keuë",
        "tooltip-n-mainpage": "Saweuë ôn keuë",
        "logentry-patrol-patrol-auto": "$1 otomatis {{GENDER:$2|geutanda}} revisi $4 nibak laman $3 nyang geukawai",
        "logentry-newusers-create": "$1 {{GENDER:$2|geupeugöt}} akun ureuëng ngui",
        "logentry-upload-upload": "$1 {{GENDER:$2|geupasoe}} $3",
-       "searchsuggest-search": "Mita {{SITENAME}}",
+       "searchsuggest-search": "Mita lam {{SITENAME}}",
        "duration-seconds": "{{PLURAL:$1|deutik}}",
        "duration-minutes": "{{PLURAL:$1|minèt}}",
        "duration-hours": "{{PLURAL:$1|jeum}}",
index 23fdb36..1197de0 100644 (file)
        "http-read-error": "Памылка чытаньня HTTP.",
        "http-timed-out": "Скончыўся час чаканьня HTTP-запыту.",
        "http-curl-error": "Памылка звароту да URL-адрасу: $1",
-       "http-bad-status": "Адбылася памылка пад час выкананьня HTTP-запыту: $1 $2",
+       "http-bad-status": "Адбылася памылка падчас выкананьня HTTP-запыту: $1 $2",
        "http-internal-error": "Унутраная памылка HTTP.",
        "upload-curl-error6": "Немагчыма дасягнуць URL-адрас",
        "upload-curl-error6-text": "Немагчыма адкрыць пазначаны URL-адрас.\nКалі ласка, упэўніцеся, што адрас слушны і сайт працуе.",
        "logentry-block-reblock": "$1 {{GENDER:$2|зьмяніў|зьмяніла}} тэрмін блякаваньня {{GENDER:$4|$3}} на пэрыяд $5 $6",
        "logentry-partialblock-block": "$1 {{GENDER:$2|заблякаваў|заблякавала}} {{GENDER:$4|$3}} ад рэдагаваньня {{PLURAL:$8||старонак}} $7 з часам сканчэньня $5 $6",
        "logentry-partialblock-reblock": "$1 {{GENDER:$2|зьмяніў|зьмяніла}} налады блякаваньня для {{GENDER:$4|$3}} і забараніў праўкі на {{PLURAL:$8||старонках}} $7 на тэрмін $5 $6",
+       "logentry-non-editing-block-block": "$1 {{GENDER:$2|заблякаваў|заблякавала}} {{GENDER:$4|$3}} ад дзеяньняў, не датычных да рэдагаваньня, на тэрмін $5 $6",
        "logentry-suppress-block": "$1 {{GENDER:$2|заблякаваў|заблякавала}} {{GENDER:$4|$3}} на тэрмін $5 $6",
        "logentry-suppress-reblock": "$1 {{GENDER:$2|зьмяніў|зьмяніла}} тэрмін блякаваньня {{GENDER:$4|$3}} на пэрыяд $5 $6",
        "logentry-import-upload": "$1 {{GENDER:$2|імпартаваў|імпартавала}} $3 праз загрузку файлу",
index cad8d1a..c6a9f5d 100644 (file)
@@ -63,7 +63,7 @@
        "tog-watchuploads": "Добавяне на новите качени от мен файлове към списъка ми за наблюдение",
        "tog-watchrollback": "Добавяне на страници, в които съм {{GENDER:$1|извършвал|извършвала}} отмяна на редакции в списъка ми за наблюдениe",
        "tog-minordefault": "Отбелязване на всички промени като малки по подразбиране",
-       "tog-previewontop": "Ð\9fоказване Ð½Ð° Ð¿Ñ\80едваÑ\80иÑ\82елниÑ\8f преглед преди текстовата кутия",
+       "tog-previewontop": "Ð\9fоказване Ð½Ð° Ð¿Ñ\80едваÑ\80иÑ\82елен преглед преди текстовата кутия",
        "tog-previewonfirst": "Показване на предварителен преглед при първа редакция",
        "tog-enotifwatchlistpages": "Уведомяване по е-пощата при промяна на страница или файл от списъка ми за наблюдение",
        "tog-enotifusertalkpages": "Уведомяване по е-пощата при промяна на беседата ми",
        "export-download": "Съхраняване като файл",
        "export-templates": "Включване на шаблоните",
        "export-pagelinks": "Включване на свързаните страници с дълбочина до:",
-       "export-manual": "Добавете страници ръчно:",
+       "export-manual": "Добавяне на страници ръчно:",
        "allmessages": "Системни съобщения",
        "allmessagesname": "Име",
        "allmessagesdefault": "Текст по подразбиране",
        "pageinfo-category-files": "Брой файлове",
        "pageinfo-user-id": "Потребителски номер",
        "pageinfo-file-hash": "Хеш-стойност",
-       "markaspatrolleddiff": "Ð\9eÑ\82белÑ\8fзване ÐºÐ°Ñ\82о Ð¿Ð°Ñ\82Ñ\80Ñ\83лиÑ\80ана Ñ\80едакÑ\86иÑ\8f",
+       "markaspatrolleddiff": "Ð\9eÑ\82белÑ\8fзване Ð½Ð° Ñ\80едакÑ\86иÑ\8fÑ\82а ÐºÐ°Ñ\82о Ð¿Ð°Ñ\82Ñ\80Ñ\83лиÑ\80ана",
        "markaspatrolledtext": "Отбелязване на редакцията като проверена",
        "markaspatrolledtext-file": "Отбелязване на версията на файла като проверена",
        "markedaspatrolled": "Проверена редакция",
index fbea87b..cefc9c6 100644 (file)
        "revdelete-restricted": "ئەو سنووری بەرگریانەی خستراوەتە سەر بەڕێوبەران",
        "revdelete-unrestricted": "ئەو سنووری بەرگریانەی لابردراوە لە سەر بەڕێوبەران",
        "logentry-block-block": "$1 {{GENDER:$4|$3}}ی بۆ ماوەی $5 {{GENDER:$2|بەربەست کرد}} $6",
+       "logentry-block-reblock": "$1 ھەڵبژاردەکانی بەربەستنی $3ی گۆڕی بە ڕێکەوتی بەسەرچوونی $5 $6",
        "logentry-import-upload": "$1 {{GENDER:$2|بارکرد}} $3 بە بەکارھێنانی [[special:Import|بارکەر]]",
        "logentry-move-move": "$1 پەڕەی $3ی {{GENDER:$2|گواستەوە}} بۆ $4",
        "logentry-move-move-noredirect": "$1 پەڕەی $3ی بە بێ بەجێھشتنی ڕەوانەکەرێک {{GENDER:$2|گواستەوە}} بۆ $4",
index 3db8b2c..f0020d2 100644 (file)
        "badarticleerror": "Tätä toimintoa ei voi suorittaa tälle sivulle.",
        "cannotdelete": "Sivun tai tiedoston ”$1” poisto epäonnistui.\nJoku muu on saattanut poistaa sen.",
        "cannotdelete-title": "Sivua \"$1\" ei voi poistaa",
+       "delete-scheduled": "Sivu \"$1\" on poistumassa piakkoin.\nOdota rauhassa.",
        "delete-hook-aborted": "Laajennuskoodi esti poiston antamatta syytä.",
        "no-null-revision": "Nollamuokkausta sivulla \"$1\" ei voi tehdä",
        "badtitle": "Kelvoton sivun nimi",
        "prefixindex": "Kaikki sivut katkaisuhaulla",
        "prefixindex-namespace": "Kaikki sivut etuliitteellä (nimiavaruus $1)",
        "prefixindex-submit": "Näytä",
-       "prefixindex-strip": "Älä näytä etuliitteitä listauksessa",
+       "prefixindex-strip": "Jätä näyttämättä etuliitteet tuloksissa",
        "shortpages": "Lyhyet sivut",
        "longpages": "Pitkät sivut",
        "deadendpages": "Sivut, joilla ei ole linkkejä",
        "ipb-disableusertalk": "Estä käyttäjää muokkaamasta omaa keskustelusivuaan eston aikana",
        "ipb-change-block": "Estä uudelleen näillä asetuksilla",
        "ipb-confirm": "Vahvista esto",
+       "ipb-sitewide": "Sivuston laajuinen",
+       "ipb-partial": "Osittainen",
+       "ipb-type-label": "Tyyppi",
+       "ipb-pages-label": "Sivut",
        "badipaddress": "IP-osoite on väärin muotoiltu.",
        "blockipsuccesssub": "Esto onnistui",
        "blockipsuccesstext": "[[Special:Contributions/$1|$1]] on estetty.<br />\nVoimassa olevat estot näkyvät [[Special:BlockList|estolistasta]].",
        "createaccountblock": "tunnusten luonti estetty",
        "emailblock": "sähköpostin lähettäminen estetty",
        "blocklist-nousertalk": "oman keskustelusivun muokkaaminen estetty",
+       "blocklist-editing": "muokkaaminen",
+       "blocklist-editing-sitewide": "muokkaaminen (sivuston laajuisesti)",
        "ipblocklist-empty": "Estolista on tyhjä.",
        "ipblocklist-no-results": "Pyydettyä IP-osoitetta tai käyttäjätunnusta ei ole estetty.",
        "blocklink": "estä",
        "pageinfo-category-files": "Tiedostojen määrä",
        "pageinfo-user-id": "Käyttäjän tunnistenumero",
        "pageinfo-file-hash": "Hash-arvo",
+       "pageinfo-view-protect-log": "Katso tämän sivun suojauslokia.",
        "markaspatrolleddiff": "Merkitse tarkastetuksi",
        "markaspatrolledtext": "Merkitse muutos tarkastetuksi",
        "markaspatrolledtext-file": "Merkitse tämä tiedoston versio tarkastetuksi",
        "confirm-unwatch-top": "Poistetaanko tämä sivu tarkkailulistaltasi?",
        "confirm-rollback-button": "OK",
        "confirm-rollback-top": "Palauta tämän sivun muokkaukset?",
+       "confirm-mcrrestore-title": "Palauta takaisin yksittäinen versio",
        "confirm-mcrundo-title": "Kumoa muutos",
        "mcrundofailed": "Kumoaminen epäonnistui",
        "mcrundo-missingparam": "Tarvittavat parametrit puuttuvat pyynnöstä.",
        "logentry-block-block": "$1 {{GENDER:$2|esti}} käyttäjän {{GENDER:$4|$3}}. Eston kesto on $5 $6",
        "logentry-block-unblock": "$1 {{GENDER:$2|poisti muokkauseston}} käyttäjältä {{GENDER:$4|$3}}",
        "logentry-block-reblock": "$1 {{GENDER:$2|muutti}} eston asetuksia kohteessa {{GENDER:$4|$3}}. Eston kesto on $5 $6",
+       "logentry-partialblock-block": "$1 {{GENDER:$2|esti}} käyttäjää {{GENDER:$4|$3}} muokkaamasta {{PLURAL:$8||sivuja}} $7. Eston kesto on $5 $6",
+       "logentry-non-editing-block-block": "$1 {{GENDER:$2|esti}} käyttäjää {{GENDER:$4|$3}} suorittamasta muita toimenpiteitä kuin muokkaamista. Eston kesto on $5 $6",
        "logentry-suppress-block": "$1 {{GENDER:$2|esti}} käyttäjän {{GENDER:$4|$3}}. Eston kesto on $5 $6",
        "logentry-suppress-reblock": "$1 {{GENDER:$2|muutti}} eston asetuksia kohteessa {{GENDER:$4|$3}}. Eston kesto on $5 $6",
        "logentry-import-upload": "$1 {{GENDER:$2|on tuonut}} kohteen $3 tiedostotallennuksella",
        "mw-widgets-titleinput-description-redirect": "ohjaus kohteeseen $1",
        "mw-widgets-categoryselector-add-category-placeholder": "Lisää luokka...",
        "mw-widgets-usersmultiselect-placeholder": "Lisää useampia...",
+       "mw-widgets-titlesmultiselect-placeholder": "Lisää useampia...",
        "date-range-from": "Aloituspäivä:",
        "date-range-to": "Päättymispäivä:",
        "sessionmanager-tie": "Monentyyppisiä kirjautumispyyntöjä ei voi yhdistää: $1.",
index 5f3e8a1..179d457 100644 (file)
        "http-timed-out": "A HTTP-kérés túllépte a határidőt.",
        "http-curl-error": "Hiba történt az URL lekérésekor: $1",
        "http-bad-status": "Probléma történt a HTTP-kérés közben: $1 $2",
+       "http-internal-error": "HTTP belső hiba.",
        "upload-curl-error6": "Nem érhető el az URL",
        "upload-curl-error6-text": "A megadott URL nem érhető el.  Kérjük, ellenőrizd újra, hogy az URL pontos-e, és a webhely működik-e.",
        "upload-curl-error28": "Feltöltési időtúllépés",
        "prefixindex": "Keresés előtag szerint",
        "prefixindex-namespace": "Összes lap adott előtaggal ($1 névtér)",
        "prefixindex-submit": "Mutat",
-       "prefixindex-strip": "Előtag eltüntetése a listában",
+       "prefixindex-strip": "Előtag eltüntetése a találatokból",
        "shortpages": "Rövid lapok",
        "longpages": "Hosszú lapok",
        "deadendpages": "Zsákutcalapok",
        "mw-widgets-titleinput-description-redirect": "átirányítás ide: $1",
        "mw-widgets-categoryselector-add-category-placeholder": "Kategória hozzáadása…",
        "mw-widgets-usersmultiselect-placeholder": "Továbbiak hozzáadása…",
+       "mw-widgets-titlesmultiselect-placeholder": "Továbbiak hozzáadása…",
        "date-range-from": "Dátumtól:",
        "date-range-to": "Dátumig:",
        "sessionmanager-tie": "Nem kombinálható többféle hitelesítési típus: $1.",
        "passwordpolicies-policy-passwordcannotmatchusername": "A jelszó nem lehet azonos a felhasználónévvel",
        "passwordpolicies-policy-passwordcannotmatchblacklist": "A jelszó nem lehet azonos a feketelistán szereplő jelszavakkal.",
        "passwordpolicies-policy-maximalpasswordlength": "A jelszó legfeljebb $1 karakter hosszú lehet",
-       "passwordpolicies-policy-passwordcannotbepopular": "A jelszó nem {{PLURAL:$1|lehet a gyakran használt jelszó|szerepelhet a(z) $1 leggyakrabban használt jelszó listáján}}"
+       "passwordpolicies-policy-passwordcannotbepopular": "A jelszó nem {{PLURAL:$1|lehet a gyakran használt jelszó|szerepelhet a(z) $1 leggyakrabban használt jelszó listáján}}",
+       "unprotected-js": "Biztonsági okokból JavaScript nem tölthető be védtelen lapokról. Kérlek egyedül a MediaWiki névtérben készíts JavaScriptet, vagy szerkesztői allapként."
 }
index 5c1204b..3be010b 100644 (file)
        "changepassword-success": "La tua password è stata modificata!",
        "changepassword-throttled": "Sono stati effettuati troppi tentativi di accesso in breve tempo.\nAttendi $1 e riprova in seguito.",
        "botpasswords": "Password bot",
-       "botpasswords-summary": "<em>Password bot</em> consente l'accesso ad un'utenza tramite API senza usare le credenziali di accesso principali dell'utenza. I diritti utente disponibili quando si è effettuato l'accesso con una password bot possono essere limitati.\n\nSe non conosci il motivo per cui potresti farlo, allora probabilmente non dovresti farlo. Nessuno dovrebbe mai chiederti di generare uno di questi e darli a loro.",
+       "botpasswords-summary": "<em>Password bot</em> consente l'accesso a un'utenza tramite API senza usare le credenziali di accesso principali. I diritti utente disponibili quando si è effettuato l'accesso con una password bot possono essere limitati.\n\nSe non conosci il motivo per cui potresti farlo, allora probabilmente non dovresti farlo. Nessuno dovrebbe mai chiederti di generare una password bot e darla a loro.",
        "botpasswords-disabled": "Le password bot sono disabilitate.",
        "botpasswords-no-central-id": "Per utilizzare una password bot, è necessario accedere ad un'utenza centralizzata.",
        "botpasswords-existing": "Password bot esistenti",
        "grant-editmycssjs": "Modifica i CSS/JSON/JavaScript della tua utenza",
        "grant-editmyoptions": "Modifica le preferenze della tua utenza",
        "grant-editmywatchlist": "Modifica i tuoi osservati speciali",
+       "grant-editsiteconfig": "Modifica i CSS/JS di utenti e sito",
        "grant-editpage": "Modifica pagine esistenti",
        "grant-editprotected": "Modifica pagine protette",
        "grant-highvolume": "Modifiche massive",
        "sp-contributions-newonly": "Visualizza solo le modifiche che sono creazioni di pagina",
        "sp-contributions-hideminor": "Nascondi le modifiche minori",
        "sp-contributions-submit": "Ricerca",
+       "sp-contributions-outofrange": "Impossibile mostrare i contributi. La classe di indirizzi IP specificata è maggiore del limite CIDR di /$1.",
        "whatlinkshere": "Puntano qui",
        "whatlinkshere-title": "Pagine che puntano a \"$1\"",
        "whatlinkshere-page": "Pagina:",
index ced9bc5..7c5ae4a 100644 (file)
        "filehist-filesize": "Gedhené barkas",
        "filehist-comment": "Tanggepan",
        "imagelinks": "Panggunaning barkas",
-       "linkstoimage": "{{PLURAL:$1|Kaca|$1 kaca}} ngisor iki nggayut barkas iki:",
+       "linkstoimage": "{{PLURAL:$1|Kaca|$1 kaca}} ing ngisor iki nganggo barkas iki:",
        "linkstoimage-more": "Luwih saka $1 {{PLURAL:$1|kaca|kaca-kaca}} nduwèni pranala menyang berkas iki.\nPratélan ing ngisor nuduhaké {{PLURAL:$1|kaca pisanan kanthi pranala langsung|$1 kaca kanthi pranala langsung}} menyang berkas iki.\n[[Special:WhatLinksHere/$2|pratélan pepak]] uga ana.",
        "nolinkstoimage": "Ora ana kaca kang nganggo barkas iki.",
        "morelinkstoimage": "Ndeleng [[Special:WhatLinksHere/$1|luwih akèh pranala]] menyang berkas iki.",
index 5d38a3b..6c4af68 100644 (file)
        "ipb-change-block": "Iš naujo užblokuoti naudotoją, naudojant šiuos nustatymus",
        "ipb-confirm": "Patvirtinkite blokavimą",
        "badipaddress": "Neleistinas IP adresas",
-       "blockipsuccesssub": "Užblokavimas pavyko",
+       "blockipsuccesssub": "Užblokavimas atliktas",
        "blockipsuccesstext": "[[Special:Contributions/$1|$1]] buvo užblokuotas.<br />\nAplankykite [[Special:BlockList|IP blokavimų istoriją]] norėdami jį peržiūrėti.",
        "ipb-blockingself": "Jūs ruošiatės užblokuoti save! Ar tikrai norite tai padaryti?",
        "ipb-confirmhideuser": "Jūs ruošiatės užblokuoti naudotoją, pasirinkę „slėpti naudotoją“ nustatymą. Tai paslėps naudotojo vardą visuose sąrašuose ir žurnalo įrašuose. Ar tikrai norite tai padaryti?",
index 1eceb9f..5d70dce 100644 (file)
        "tog-watchlisthideanons": "Esconder edições de utilizadores anónimos ao listar mudanças às páginas vigiadas",
        "tog-watchlisthidepatrolled": "Esconder edições patrulhadas ao listar mudanças às páginas vigiadas",
        "tog-watchlisthidecategorization": "Ocultar categorização de páginas",
-       "tog-ccmeonemails": "Enviar-me cópias das mensagens por correio eletrónico que eu enviar a outros utilizadores",
+       "tog-ccmeonemails": "Enviar-me cópias das mensagens de correio eletrónico que eu enviar a outros utilizadores",
        "tog-diffonly": "Não mostrar o conteúdo da página ao comparar duas edições",
        "tog-showhiddencats": "Mostrar categorias ocultas",
        "tog-norollbackdiff": "Não mostrar diferenças depois de reverter edições em bloco",
index a4e5b1c..16150b8 100644 (file)
        "uploadstash-zero-length": "Датотека је празна",
        "invalid-chunk-offset": "Неважећа полазна тачка",
        "img-auth-accessdenied": "Приступ је одбијен",
-       "img-auth-nopathinfo": "Недостаје PATH_INFO.\nВаш сервер није подешен да прослеђује овакве податке.\nМожда је заснован на CGI-ју који не подржава img_auth.\nПогледајте https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Image_Authorization?uselang=sr-ec.",
+       "img-auth-nopathinfo": "Недостаје информација о путањи.\nВаш сервер мора да буде подешен да пропушта REQUEST_URI и/или PATH_INFO промењиве.\nАко је то у питању, покушајте са омогућавањем $wgUsePathInfo.\nПогледајте https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Image_Authorization.",
        "img-auth-notindir": "Тражена путања није у подешеном директоријуму за отпремање.",
        "img-auth-badtitle": "Није могуће саставити важећи наслов из „$1”.",
        "img-auth-nologinnWL": "Нисте пријављени и „$1” није на списку дозвољених.",
        "tags-deactivate-not-allowed": "Није могуће деактивирати ознаку „$1”.",
        "tags-deactivate-submit": "Декативирај",
        "tags-apply-no-permission": "Немате дозволу да примените ознаке промена заједно са својим променама.",
-       "tags-apply-blocked": "Не можете да примените ознаке тагова заједно са вашим променама све док сте блокирани.",
+       "tags-apply-blocked": "Не можете да примените ознаке тагова заједно са вашим променама све док {{GENDER:$1|сте}} блокирани.",
        "tags-update-no-permission": "Немате дозволу да додате или уклоните ознаке промена из појединачних измена или уноса у дневнику.",
        "tags-update-blocked": "Не можете додавати нити уклањати ознаке измена док {{GENDER:$1|сте}} блокирани.",
        "tags-update-add-not-allowed-one": "Није дозвољено да се ознака „$1” додаје ручно.",
diff --git a/resources/src/mediawiki.special.preferences/tabs.legacy.js b/resources/src/mediawiki.special.preferences/tabs.legacy.js
deleted file mode 100644 (file)
index 27d5585..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*!
- * JavaScript for Special:Preferences: Tab navigation.
- */
-( function () {
-       $( function () {
-               var $preftoc, $preferences, $fieldsets, labelFunc, previousTab;
-
-               labelFunc = function () {
-                       return this.id.replace( /^mw-prefsection/g, 'preftab' );
-               };
-
-               $preftoc = $( '#preftoc' );
-               $preferences = $( '#preferences' );
-
-               $fieldsets = $preferences.children( 'fieldset' )
-                       .attr( {
-                               role: 'tabpanel',
-                               'aria-labelledby': labelFunc
-                       } );
-               $fieldsets.not( '#mw-prefsection-personal' )
-                       .hide()
-                       .attr( 'aria-hidden', 'true' );
-
-               // T115692: The following is kept for backwards compatibility with older skins
-               $fieldsets.addClass( 'prefsection' );
-               $fieldsets.children( 'legend' ).addClass( 'mainLegend' );
-
-               // Make sure the accessibility tip is selectable so that screen reader users take notice,
-               // but hide it by default to reduce visual clutter.
-               // Make sure it becomes visible when focused.
-               $( '<div>' ).addClass( 'mw-navigation-hint' )
-                       .text( mw.msg( 'prefs-tabs-navigation-hint' ) )
-                       .attr( 'tabIndex', 0 )
-                       .on( 'focus blur', function ( e ) {
-                               if ( e.type === 'blur' || e.type === 'focusout' ) {
-                                       $( this ).css( 'height', '0' );
-                               } else {
-                                       $( this ).css( 'height', 'auto' );
-                               }
-                       } ).insertBefore( $preftoc );
-
-               /**
-                * It uses document.getElementById for security reasons (HTML injections in $()).
-                *
-                * @ignore
-                * @param {string} name the name of a tab without the prefix ("mw-prefsection-")
-                * @param {string} [mode] A hash will be set according to the current
-                *  open section. Set mode 'noHash' to surpress this.
-                */
-               function switchPrefTab( name, mode ) {
-                       var $tab, scrollTop;
-                       // Handle hash manually to prevent jumping,
-                       // therefore save and restore scrollTop to prevent jumping.
-                       scrollTop = $( window ).scrollTop();
-                       if ( mode !== 'noHash' ) {
-                               location.hash = '#mw-prefsection-' + name;
-                       }
-                       $( window ).scrollTop( scrollTop );
-
-                       $preftoc.find( 'li' ).removeClass( 'selected' )
-                               .find( 'a' ).attr( {
-                                       tabIndex: -1,
-                                       'aria-selected': 'false'
-                               } );
-
-                       $tab = $( document.getElementById( 'preftab-' + name ) );
-                       if ( $tab.length ) {
-                               $tab.attr( {
-                                       tabIndex: 0,
-                                       'aria-selected': 'true'
-                               } ).focus()
-                                       .parent().addClass( 'selected' );
-
-                               $preferences.children( 'fieldset' ).hide().attr( 'aria-hidden', 'true' );
-                               $( document.getElementById( 'mw-prefsection-' + name ) ).show().attr( 'aria-hidden', 'false' );
-                       }
-               }
-
-               // Enable keyboard users to use left and right keys to switch tabs
-               $preftoc.on( 'keydown', function ( event ) {
-                       var keyLeft = 37,
-                               keyRight = 39,
-                               $el;
-
-                       if ( event.keyCode === keyLeft ) {
-                               $el = $( '#preftoc li.selected' ).prev().find( 'a' );
-                       } else if ( event.keyCode === keyRight ) {
-                               $el = $( '#preftoc li.selected' ).next().find( 'a' );
-                       } else {
-                               return;
-                       }
-                       if ( $el.length > 0 ) {
-                               switchPrefTab( $el.attr( 'href' ).replace( '#mw-prefsection-', '' ) );
-                       }
-               } );
-
-               // Jump to correct section as indicated by the hash.
-               // This function is called onload and onhashchange.
-               function detectHash() {
-                       var hash = location.hash,
-                               matchedElement, parentSection;
-                       if ( hash.match( /^#mw-prefsection-[\w]+$/ ) ) {
-                               mw.storage.session.remove( 'mwpreferences-prevTab' );
-                               switchPrefTab( hash.replace( '#mw-prefsection-', '' ) );
-                       } else if ( hash.match( /^#mw-[\w-]+$/ ) ) {
-                               matchedElement = document.getElementById( hash.slice( 1 ) );
-                               parentSection = $( matchedElement ).parent().closest( '[id^="mw-prefsection-"]' );
-                               if ( parentSection.length ) {
-                                       mw.storage.session.remove( 'mwpreferences-prevTab' );
-                                       // Switch to proper tab and scroll to selected item.
-                                       switchPrefTab( parentSection.attr( 'id' ).replace( 'mw-prefsection-', '' ), 'noHash' );
-                                       matchedElement.scrollIntoView();
-                               }
-                       }
-               }
-
-               $( window ).on( 'hashchange', function () {
-                       var hash = location.hash;
-                       if ( hash.match( /^#mw-[\w-]+/ ) ) {
-                               detectHash();
-                       } else if ( hash === '' ) {
-                               switchPrefTab( 'personal', 'noHash' );
-                       }
-               } )
-                       // Run the function immediately to select the proper tab on startup.
-                       .trigger( 'hashchange' );
-
-               // Restore the active tab after saving the preferences
-               previousTab = mw.storage.session.get( 'mwpreferences-prevTab' );
-               if ( previousTab ) {
-                       switchPrefTab( previousTab, 'noHash' );
-                       // Deleting the key, the tab states should be reset until we press Save
-                       mw.storage.session.remove( 'mwpreferences-prevTab' );
-               }
-
-               $( '#mw-prefs-form' ).on( 'submit', function () {
-                       var value = $( $preftoc ).find( 'li.selected a' ).attr( 'id' ).replace( 'preftab-', '' );
-                       mw.storage.session.set( 'mwpreferences-prevTab', value );
-               } );
-
-       } );
-}() );
index 1f3183f..5c4c48c 100644 (file)
@@ -300,6 +300,7 @@ class ParserTestRunner {
                $setup['wgHtml5'] = true;
                $setup['wgDisableLangConversion'] = false;
                $setup['wgDisableTitleConversion'] = false;
+               $setup['wgMediaInTargetLanguage'] = false;
 
                // "extra language links"
                // see https://gerrit.wikimedia.org/r/111390
@@ -1113,6 +1114,7 @@ class ParserTestRunner {
                                + [ 'ISBN' => true, 'PMID' => true, 'RFC' => true ],
                        // Test with legacy encoding by default until HTML5 is very stable and default
                        'wgFragmentMode' => [ 'legacy' ],
+                       'wgMediaInTargetLanguage' => self::getOptionValue( 'wgMediaInTargetLanguage', $opts, false ),
                ];
 
                $nonIncludable = self::getOptionValue( 'wgNonincludableNamespaces', $opts, false );
@@ -1393,7 +1395,17 @@ class ParserTestRunner {
                                'bits'        => 0,
                                'media_type'  => MEDIATYPE_DRAWING,
                                'mime'        => 'image/svg+xml',
-                               'metadata'    => serialize( [] ),
+                               'metadata'    => serialize( [
+                                       'version'        => SvgHandler::SVG_METADATA_VERSION,
+                                       'width'          => 240,
+                                       'height'         => 180,
+                                       'originalWidth'  => '100%',
+                                       'originalHeight' => '100%',
+                                       'translations'   => [
+                                               'en' => SVGReader::LANG_FULL_MATCH,
+                                               'ru' => SVGReader::LANG_FULL_MATCH,
+                                       ],
+                               ] ),
                                'sha1'        => Wikimedia\base_convert( '', 16, 36, 31 ),
                                'fileExists'  => true
                ], $this->db->timestamp( '20010115123500' ), $user );
index bbd9ecb..d836111 100644 (file)
@@ -37,7 +37,7 @@
 # You can also set the following parser properties via test options:
 #  wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel,
 #  wgLinkHolderBatchSize, wgRawHtml, wgInterwikiMagic,
-#  wgEnableMagicLinks
+#  wgEnableMagicLinks, wgMediaInTargetLanguage
 #
 # For testing purposes, temporary articles can created:
 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
@@ -15370,6 +15370,30 @@ parsoid=wt2html,wt2wt,html2html
 <figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/thumb/f/ff/Foobar.svg/220px-Foobar.svg.png" data-file-width="240" data-file-height="180" data-file-type="drawing" height="165" width="220"/></a><figcaption>lang=invalid:language:code</figcaption></figure>
 !! end
 
+!! test
+SVG thumbnails in page language
+!! options
+language=ru
+wgMediaInTargetLanguage = true
+!! wikitext
+[[File:Foobar.svg]] [[File:Foobar.svg|lang=en]]
+!! html/php
+<p><a href="/wiki/%D0%A4%D0%B0%D0%B9%D0%BB:Foobar.svg" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/langru-240px-Foobar.svg.png" width="240" height="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langru-360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langru-480px-Foobar.svg.png 2x" /></a> <a href="/index.php?title=%D0%A4%D0%B0%D0%B9%D0%BB:Foobar.svg&amp;lang=en" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/240px-Foobar.svg.png" width="240" height="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/480px-Foobar.svg.png 2x" /></a>
+</p>
+!! end
+
+!! test
+SVG thumbnails in page language not present in the file
+!! options
+language=de
+wgMediaInTargetLanguage = true
+!! wikitext
+[[File:Foobar.svg]] [[File:Foobar.svg|lang=ru]]
+!! html/php
+<p><a href="/wiki/Datei:Foobar.svg" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/240px-Foobar.svg.png" width="240" height="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/480px-Foobar.svg.png 2x" /></a> <a href="/index.php?title=Datei:Foobar.svg&amp;lang=ru" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/langru-240px-Foobar.svg.png" width="240" height="180" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langru-360px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langru-480px-Foobar.svg.png 2x" /></a>
+</p>
+!! end
+
 !! test
 T3887: A ISBN with a thumbnail
 !! wikitext
diff --git a/tests/phpunit/includes/media/SVGTest.php b/tests/phpunit/includes/media/SVGTest.php
deleted file mode 100644 (file)
index b68dd0e..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-
-/**
- * @group Media
- */
-class SVGTest extends MediaWikiMediaTestCase {
-
-       /**
-        * @var SvgHandler
-        */
-       private $handler;
-
-       protected function setUp() {
-               parent::setUp();
-
-               $this->filePath = __DIR__ . '/../../data/media/';
-
-               $this->setMwGlobals( 'wgShowEXIF', true );
-
-               $this->handler = new SvgHandler;
-       }
-
-       /**
-        * @param string $filename
-        * @param array $expected The expected independent metadata
-        * @dataProvider providerGetIndependentMetaArray
-        * @covers SvgHandler::getCommonMetaArray
-        */
-       public function testGetIndependentMetaArray( $filename, $expected ) {
-               $file = $this->dataFile( $filename, 'image/svg+xml' );
-               $res = $this->handler->getCommonMetaArray( $file );
-
-               $this->assertEquals( $res, $expected );
-       }
-
-       public static function providerGetIndependentMetaArray() {
-               return [
-                       [ 'Tux.svg', [
-                               'ObjectName' => 'Tux',
-                               'ImageDescription' =>
-                                       'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg',
-                       ] ],
-                       [ 'Wikimedia-logo.svg', [] ]
-               ];
-       }
-
-       /**
-        * @param string $userPreferredLanguage
-        * @param array $svgLanguages
-        * @param string $expectedMatch
-        * @dataProvider providerGetMatchedLanguage
-        * @covers SvgHandler::getMatchedLanguage
-        */
-       public function testGetMatchedLanguage( $userPreferredLanguage, $svgLanguages, $expectedMatch ) {
-               $match = $this->handler->getMatchedLanguage( $userPreferredLanguage, $svgLanguages );
-               $this->assertEquals( $expectedMatch, $match );
-       }
-
-       public function providerGetMatchedLanguage() {
-               return [
-                       'no match' => [
-                               'userPreferredLanguage' => 'en',
-                               'svgLanguages' => [ 'de-DE', 'zh', 'ga', 'fr', 'sr-Latn-ME' ],
-                               'expectedMatch' => null,
-                       ],
-                       'no subtags' => [
-                               'userPreferredLanguage' => 'en',
-                               'svgLanguages' => [ 'de', 'zh', 'en', 'fr' ],
-                               'expectedMatch' => 'en',
-                       ],
-                       'user no subtags, svg 1 subtag' => [
-                               'userPreferredLanguage' => 'en',
-                               'svgLanguages' => [ 'de-DE', 'en-GB', 'en-US', 'fr' ],
-                               'expectedMatch' => 'en-GB',
-                       ],
-                       'user no subtags, svg >1 subtag' => [
-                               'userPreferredLanguage' => 'sr',
-                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl-BA', 'sr-Latn-ME', 'en-US', 'fr' ],
-                               'expectedMatch' => 'sr-Cyrl-BA',
-                       ],
-                       'user 1 subtag, svg no subtags' => [
-                               'userPreferredLanguage' => 'en-US',
-                               'svgLanguages' => [ 'de', 'en', 'en', 'fr' ],
-                               'expectedMatch' => null,
-                       ],
-                       'user 1 subtag, svg 1 subtag' => [
-                               'userPreferredLanguage' => 'en-US',
-                               'svgLanguages' => [ 'de-DE', 'en-GB', 'en-US', 'fr' ],
-                               'expectedMatch' => 'en-US',
-                       ],
-                       'user 1 subtag, svg >1 subtag' => [
-                               'userPreferredLanguage' => 'sr-Latn',
-                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl-BA', 'sr-Latn-ME', 'fr' ],
-                               'expectedMatch' => 'sr-Latn-ME',
-                       ],
-                       'user >1 subtag, svg >1 subtag' => [
-                               'userPreferredLanguage' => 'sr-Latn-ME',
-                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl-BA', 'sr-Latn-ME', 'en-US', 'fr' ],
-                               'expectedMatch' => 'sr-Latn-ME',
-                       ],
-                       'user >1 subtag, svg <=1 subtag' => [
-                               'userPreferredLanguage' => 'sr-Latn-ME',
-                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl', 'sr-Latn', 'en-US', 'fr' ],
-                               'expectedMatch' => null,
-                       ],
-                       'ensure case-insensitive' => [
-                               'userPreferredLanguage' => 'sr-latn',
-                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl', 'sr-Latn-ME', 'en-US', 'fr' ],
-                               'expectedMatch' => 'sr-Latn-ME',
-                       ],
-               ];
-       }
-}
diff --git a/tests/phpunit/includes/media/SvgHandlerTest.php b/tests/phpunit/includes/media/SvgHandlerTest.php
new file mode 100644 (file)
index 0000000..9c98ada
--- /dev/null
@@ -0,0 +1,367 @@
+<?php
+
+use Wikimedia\TestingAccessWrapper;
+
+/**
+ * @group Media
+ */
+class SvgHandlerTest extends MediaWikiMediaTestCase {
+
+       /**
+        * @covers \SvgHandler::getCommonMetaArray()
+        * @dataProvider provideGetIndependentMetaArray
+        *
+        * @param string $filename
+        * @param array $expected The expected independent metadata
+        */
+       public function testGetIndependentMetaArray( $filename, $expected ) {
+               $this->filePath = __DIR__ . '/../../data/media/';
+               $this->setMwGlobals( 'wgShowEXIF', true );
+
+               $file = $this->dataFile( $filename, 'image/svg+xml' );
+               $handler = new SvgHandler();
+               $res = $handler->getCommonMetaArray( $file );
+
+               self::assertEquals( $res, $expected );
+       }
+
+       public static function provideGetIndependentMetaArray() {
+               return [
+                       [ 'Tux.svg', [
+                               'ObjectName' => 'Tux',
+                               'ImageDescription' =>
+                                       'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg',
+                       ] ],
+                       [ 'Wikimedia-logo.svg', [] ]
+               ];
+       }
+
+       /**
+        * @covers SvgHandler::getMatchedLanguage()
+        * @dataProvider provideGetMatchedLanguage
+        *
+        * @param string $userPreferredLanguage
+        * @param array $svgLanguages
+        * @param string $expectedMatch
+        */
+       public function testGetMatchedLanguage( $userPreferredLanguage, $svgLanguages, $expectedMatch ) {
+               $handler = new SvgHandler();
+               $match = $handler->getMatchedLanguage( $userPreferredLanguage, $svgLanguages );
+               self::assertEquals( $expectedMatch, $match );
+       }
+
+       public function provideGetMatchedLanguage() {
+               return [
+                       'no match' => [
+                               'userPreferredLanguage' => 'en',
+                               'svgLanguages' => [ 'de-DE', 'zh', 'ga', 'fr', 'sr-Latn-ME' ],
+                               'expectedMatch' => null,
+                       ],
+                       'no subtags' => [
+                               'userPreferredLanguage' => 'en',
+                               'svgLanguages' => [ 'de', 'zh', 'en', 'fr' ],
+                               'expectedMatch' => 'en',
+                       ],
+                       'user no subtags, svg 1 subtag' => [
+                               'userPreferredLanguage' => 'en',
+                               'svgLanguages' => [ 'de-DE', 'en-GB', 'en-US', 'fr' ],
+                               'expectedMatch' => 'en-GB',
+                       ],
+                       'user no subtags, svg >1 subtag' => [
+                               'userPreferredLanguage' => 'sr',
+                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl-BA', 'sr-Latn-ME', 'en-US', 'fr' ],
+                               'expectedMatch' => 'sr-Cyrl-BA',
+                       ],
+                       'user 1 subtag, svg no subtags' => [
+                               'userPreferredLanguage' => 'en-US',
+                               'svgLanguages' => [ 'de', 'en', 'en', 'fr' ],
+                               'expectedMatch' => null,
+                       ],
+                       'user 1 subtag, svg 1 subtag' => [
+                               'userPreferredLanguage' => 'en-US',
+                               'svgLanguages' => [ 'de-DE', 'en-GB', 'en-US', 'fr' ],
+                               'expectedMatch' => 'en-US',
+                       ],
+                       'user 1 subtag, svg >1 subtag' => [
+                               'userPreferredLanguage' => 'sr-Latn',
+                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl-BA', 'sr-Latn-ME', 'fr' ],
+                               'expectedMatch' => 'sr-Latn-ME',
+                       ],
+                       'user >1 subtag, svg >1 subtag' => [
+                               'userPreferredLanguage' => 'sr-Latn-ME',
+                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl-BA', 'sr-Latn-ME', 'en-US', 'fr' ],
+                               'expectedMatch' => 'sr-Latn-ME',
+                       ],
+                       'user >1 subtag, svg <=1 subtag' => [
+                               'userPreferredLanguage' => 'sr-Latn-ME',
+                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl', 'sr-Latn', 'en-US', 'fr' ],
+                               'expectedMatch' => null,
+                       ],
+                       'ensure case-insensitive' => [
+                               'userPreferredLanguage' => 'sr-latn',
+                               'svgLanguages' => [ 'de-DE', 'sr-Cyrl', 'sr-Latn-ME', 'en-US', 'fr' ],
+                               'expectedMatch' => 'sr-Latn-ME',
+                       ],
+               ];
+       }
+
+       /**
+        * @covers \SvgHandler::makeParamString()
+        * @dataProvider provideMakeParamString
+        *
+        * @param array $params
+        * @param string $expected
+        * @param string $message
+        */
+       public function testMakeParamString( array $params, $expected, $message = '' ) {
+               $handler = new SvgHandler();
+               self::assertEquals( $expected, $handler->makeParamString( $params ), $message );
+       }
+
+       public function provideMakeParamString() {
+               return [
+                       [
+                               [],
+                               false,
+                               "Don't thumbnail without knowing width"
+                       ],
+                       [
+                               [ 'lang' => 'ru' ],
+                               false,
+                               "Don't thumbnail without knowing width, even with lang"
+                       ],
+                       [
+                               [ 'width' => 123, ],
+                               '123px',
+                               'Width in thumb'
+                       ],
+                       [
+                               [ 'width' => 123, 'lang' => 'en' ],
+                               '123px',
+                               'Ignore lang=en'
+                       ],
+                       [
+                               [ 'width' => 123, 'targetlang' => 'en' ],
+                               '123px',
+                               'Ignore targetlang=en'
+                       ],
+                       [
+                               [ 'width' => 123, 'lang' => 'en', 'targetlang' => 'ru' ],
+                               '123px',
+                               "lang should override targetlang even of it's in English"
+                       ],
+                       [
+                               [ 'width' => 123, 'targetlang' => 'en' ],
+                               '123px',
+                               'Ignore targetlang=en'
+                       ],
+                       [
+                               [ 'width' => 123, 'lang' => 'en', 'targetlang' => 'en' ],
+                               '123px',
+                               'Ignore lang=targetlang=en'
+                       ],
+                       [
+                               [ 'width' => 123, 'lang' => 'ru' ],
+                               'langru-123px',
+                               'Include lang in thumb'
+                       ],
+                       [
+                               [ 'width' => 123, 'targetlang' => 'ru' ],
+                               'langru-123px',
+                               'Include targetlang in thumb'
+                       ],
+                       [
+                               [ 'width' => 123, 'lang' => 'fr', 'targetlang' => 'sq' ],
+                               'langfr-123px',
+                               'lang should override targetlang'
+                       ],
+               ];
+       }
+
+       /**
+        * @covers SvgHandler::normaliseParamsInternal()
+        * @dataProvider provideNormaliseParamsInternal
+        *
+        * @param $message
+        * @param int $width
+        * @param int $height
+        * @param array $params
+        * @param array $paramsExpected
+        */
+       public function testNormaliseParamsInternal( $message,
+               $width,
+               $height,
+               array $params,
+               array $paramsExpected = null
+       ) {
+               $this->setMwGlobals( 'wgSVGMaxSize', 1000 );
+
+               /** @var SvgHandler $handler */
+               $handler = TestingAccessWrapper::newFromObject( new SvgHandler() );
+
+               $file = $this->getMockBuilder( File::class )
+                       ->disableOriginalConstructor()
+                       ->setMethods( [ 'getWidth', 'getHeight', 'getMetadata', 'getHandler' ] )
+                       ->getMock();
+
+               $file->method( 'getWidth' )
+                       ->willReturn( $width );
+               $file->method( 'getHeight' )
+                       ->willReturn( $height );
+               $file->method( 'getMetadata' )
+                       ->willReturn( serialize( [
+                               'version' => SvgHandler::SVG_METADATA_VERSION,
+                               'translations' => [
+                                       'en' => SVGReader::LANG_FULL_MATCH,
+                                       'ru' => SVGReader::LANG_FULL_MATCH,
+                               ],
+                       ] ) );
+               $file->method( 'getHandler' )
+                       ->willReturn( $handler );
+
+               /** @var File $file */
+               $params = $handler->normaliseParamsInternal( $file, $params );
+               self::assertEquals( $paramsExpected, $params, $message );
+       }
+
+       public function provideNormaliseParamsInternal() {
+               return [
+                       [
+                               'No need to change anything',
+                               400, 500,
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500 ],
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500 ],
+                       ],
+                       [
+                               'Resize horizontal image',
+                               2000, 1600,
+                               [ 'physicalWidth' => 2000, 'physicalHeight' => 1600, 'page' => 0 ],
+                               [ 'physicalWidth' => 1250, 'physicalHeight' => 1000, 'page' => 0 ],
+                       ],
+                       [
+                               'Resize vertical image',
+                               1600, 2000,
+                               [ 'physicalWidth' => 1600, 'physicalHeight' => 2000, 'page' => 0 ],
+                               [ 'physicalWidth' => 1000, 'physicalHeight' => 1250, 'page' => 0 ],
+                       ],
+                       [
+                               'Preserve targetlang present in the image',
+                               400, 500,
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500, 'targetlang' => 'en' ],
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500, 'targetlang' => 'en' ],
+                       ],
+                       [
+                               'Preserve targetlang present in the image 2',
+                               400, 500,
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500, 'targetlang' => 'en' ],
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500, 'targetlang' => 'en' ],
+                       ],
+                       [
+                               'Remove targetlang not present in the image',
+                               400, 500,
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500, 'targetlang' => 'de' ],
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500 ],
+                       ],
+                       [
+                               'Remove targetlang not present in the image 2',
+                               400, 500,
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500, 'targetlang' => 'ru-UA' ],
+                               [ 'physicalWidth' => 400, 'physicalHeight' => 500 ],
+                       ],
+               ];
+       }
+
+       /**
+        * @covers \SvgHandler::isEnabled()
+        * @dataProvider provideIsEnabled
+        *
+        * @param string $converter
+        * @param bool $expected
+        */
+       public function testIsEnabled( $converter, $expected ) {
+               $this->setMwGlobals( 'wgSVGConverter', $converter );
+
+               $handler = new SvgHandler();
+               self::assertEquals( $handler->isEnabled(), $expected );
+       }
+
+       public function provideIsEnabled() {
+               return [
+                       [ 'ImageMagick', true ],
+                       [ 'sodipodi', true ],
+                       [ 'invalid', false ],
+               ];
+       }
+
+       /**
+        * @covers \SvgHandler::getAvailableLanguages()
+        * @dataProvider provideAvailableLanguages
+        *
+        * @param array $metadata
+        * @param array $expected
+        */
+       public function testGetAvailableLanguages( array $metadata, array $expected ) {
+               $metadata['version'] = SvgHandler::SVG_METADATA_VERSION;
+               $file = $this->getMockBuilder( File::class )
+                       ->disableOriginalConstructor()
+                       ->setMethods( [ 'getMetadata' ] )
+                       ->getMock();
+               $file->method( 'getMetadata' )
+                       ->willReturn( serialize( $metadata ) );
+
+               $handler = new SvgHandler();
+               /** @var File $file */
+               self::assertEquals( $expected, $handler->getAvailableLanguages( $file ) );
+       }
+
+       public function provideAvailableLanguages() {
+               return [
+                       [ [], [] ],
+                       [ [ 'translations' => [] ], [] ],
+                       [
+                               [
+                                       'translations' => [
+                                               'ru-RU' => SVGReader::LANG_PREFIX_MATCH
+                                       ]
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'translations' => [
+                                               'en' => SVGReader::LANG_FULL_MATCH,
+                                               'ru-RU' => SVGReader::LANG_PREFIX_MATCH,
+                                               'ru' => SVGReader::LANG_FULL_MATCH,
+                                               'fr-CA' => SVGReader::LANG_PREFIX_MATCH,
+                                       ],
+                               ],
+                               [ 'en', 'ru' ],
+                       ],
+               ];
+       }
+
+       /**
+        * @covers SvgHandler::getLanguageFromParams()
+        * @dataProvider provideGetLanguageFromParams
+        *
+        * @param array $params
+        * @param string $expected
+        * @param string $message
+        */
+       public function testGetLanguageFromParams( array $params, $expected, $message ) {
+               /** @var SvgHandler $handler */
+               $handler = TestingAccessWrapper::newFromObject( new SvgHandler() );
+               self::assertEquals( $expected, $handler->getLanguageFromParams( $params ), $message );
+       }
+
+       public function provideGetLanguageFromParams() {
+               return [
+                       [ [], 'en', 'Default no language to en' ],
+                       [ [ 'preserve' => 'this' ], 'en', 'Default no language to en 2' ],
+                       [ [ 'preserve' => 'this', 'lang' => 'ru' ], 'ru', 'Language from lang' ],
+                       [ [ 'lang' => 'ru' ], 'ru', 'Language from lang 2' ],
+                       [ [ 'targetlang' => 'fr' ], 'fr', 'Language from targetlang' ],
+                       [ [ 'lang' => 'fr', 'targetlang' => 'de' ], 'fr', 'lang overrides targetlang' ],
+               ];
+       }
+}