Page MenuHomePhabricator

Special:Translate redirects links from no to nb
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue:

What happens?:

  • Top right button shows "Translate to norsk"
  • Depending on the page type you might see an indicator that you're translating to nb instead of no

Screenshot 2026-04-28 at 08.45.12.png (1,850×1,104 px, 126 KB)

Screenshot 2026-04-28 at 08.44.52.png (1,848×1,192 px, 221 KB)

  • URL changed from language=no to language=nb
  • If you reload the page, the button now shows "Translate to norsk bokmål" (which is correct given that the URL changed to nb)

Screenshot 2026-04-28 at 08.46.50.png (588×98 px, 14 KB)

  • No translations are shown if they only exist in no instead of nb – you need to manually select "norsk" via the button (even if it wrongly shows "norsk" already) to get no-translations.

What should have happened instead?:

  • Opening a URL with language=no (e.g. from Special:MessageGroupStats or when navigating via Special:Translate) should always lead to language=no instead of changing to language=nb
  • If changing to language=nb is desired, the button should correctly indicate that without having to reload the page.

Event Timeline

Change #1285519 had a related patch set uploaded (by Jon Harald Søby; author: Jon Harald Søby):

[mediawiki/extensions/Translate@master] Special:Translate: Use target language autonym in language selector

https://gerrit.wikimedia.org/r/1285519

The redirect behaviour is a feature, not a bug: The language code no is a macrolanguage that consists of nb and nn, so it should not be a target of any translations. The redirecting wasn't always the case in MediaWiki, which explains the existence of some translatable pages using the no language code (though I don't see any such for [[Stewards/Elections]]? Where did you encounter a link to it with &language=no?). CentralNotice translations are a bit messy because they can be added in two ways: Normally via Special:Translate, which would perform the coercion from no to nb seamlessly, but they can also be added by directly editing the relevant pages in the CNBanner namespace, which seems to have been the case for those 2022 banner messages.

Even though the language selector showed "Norsk", the target language (even with &language=no) is always nb (which you can verify by inspecting the language selector element and checking the label's lang attribute); the patch I added above fixes the discrepancy between the displayed autonym and the actual language in use.

CentralNotice translations are a bit messy because they can be added in two ways: Normally via Special:Translate, which would perform the coercion from no to nb seamlessly, but they can also be added by directly editing the relevant pages in the CNBanner namespace, which seems to have been the case for those 2022 banner messages.

This is not specific to CentralNotice; other kinds of translations also have corresponding pages (Translations: namespace for translatable pages, MediaWiki:/Wikimedia:/etc. namespace for software translation). Editing https://meta.wikimedia.org/w/index.php?title=Translations:Stewards/Page_display_title/zh-hans&action=edit is correctly disabled (unless you’re logged in as a translation admin), but https://meta.wikimedia.org/w/index.php?title=Translations:Stewards/Page_display_title/no&action=edit seems to be editable, which looks like another bug: creating /no pages should definitely be disallowed to avoid spreading the ambiguous language code even more, maybe not even editing existing pages should be allowed.

I can’t test CentralNotice because the CentralNotice namespace is not editable by anons at all, and when I’m logged in, I’m a translation admin on Meta, so I naturally can edit any languages.

Change #1285519 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Special:Translate: Use target language autonym in language selector

https://gerrit.wikimedia.org/r/1285519

And also (unrelatedly) it should at least show a translation admin a warning that they are creating a page in a disabled language code ...

And also (unrelatedly) it should at least show a translation admin a warning that they are creating a page in a disabled language code ...

@Pppery have you submitted this as a request?

Change #1293706 had a related patch set uploaded (by Jon Harald Søby; author: Jon Harald Søby):

[operations/mediawiki-config@master] Disable the `no` language code for translation

https://gerrit.wikimedia.org/r/1293706

I believe allowing translations into otherwise disallowed languages for CentralNotice banners is a special case; such translations are not allowed for translatable pages because they are handled by the language converter instead, but the language converter doesn't work for the banners (which are loaded via JS), so they may still need to have separate translations into variants of languages with converters.

Change #1293706 merged by jenkins-bot:

[operations/mediawiki-config@master] Disable the `no` language code for translation

https://gerrit.wikimedia.org/r/1293706

Mentioned in SAL (#wikimedia-operations) [2026-05-26T13:14:10Z] <lucaswerkmeister-wmde@deploy1003> Started scap sync-world: Backport for [[gerrit:1293706|Disable the no language code for translation (T424613)]]

Mentioned in SAL (#wikimedia-operations) [2026-05-26T13:16:02Z] <lucaswerkmeister-wmde@deploy1003> jhsoby, lucaswerkmeister-wmde: Backport for [[gerrit:1293706|Disable the no language code for translation (T424613)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-05-26T13:22:40Z] <lucaswerkmeister-wmde@deploy1003> Finished scap sync-world: Backport for [[gerrit:1293706|Disable the no language code for translation (T424613)]] (duration: 08m 30s)