Page MenuHomePhabricator

Names.php: Language codes in SVG should use BCP 47 codes, but some language names won't show when they are only defined in MediaWiki internal codes
Open, Needs TriagePublicBUG REPORT

Description

Names.php : Language codes in SVG should use BCP 47 codes, but some language names won't show when they are only defined in MediaWiki internal codes.

Steps to replicate the issue (include links if applicable):

What happens?:

  • The BCP 47 codes cannot show their language names

What should have happened instead?:

  • The BCP 47 codes should able to show their language names

Software version:

  • Wikimedia Commons, MediaWiki 1.40.0-wmf.6 ( bb4c5db )

Event Timeline

Change 805351 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] i18n: Add missing BCP 47 codes in Names.php and LanguageCode.php

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

Winston_Sung changed the task status from Open to In Progress.Oct 26 2022, 2:48 AM
Winston_Sung moved this task from Untriaged to Language data and databases on the I18n board.

I don't think they need adding to Names.php for that. The dropdown is showing translated names. They will need adding to LocalNamesEn.php to add the English names and LocalNamesEn.php overrides names from Names.php (see azb in the list on https://commons.wikimedia.org/wiki/File:SystemLanguage.svg?uselang=zh, for example).

Do we consider fix the issue in {{#language: parser function?

By the way, the label will find the names in CLDR extension first (if installed) THEN Names.php . So we should add them in both files.

Change 876305 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code cbk (Zamboanga Chavacano) to Names.php

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

Change 876406 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code cdo-* (Eastern Min) to Names.php

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

Change 876407 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add cpx / cpx-* (Pu-xian Min) to Names.php

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

Change 876408 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code de-x-formal (German - formal address ("Sie")) to Names.php

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

Change 876409 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code en-simple (Simple English) to Names.php

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

Change 876410 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code es-x-formal (Spanish formal address) to Names.php

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

Change 876411 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add hak-* (Hakka) to Names.php

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

Change 876413 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code hsn-* (Xiang) to Names.php

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

Change 876414 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code hu-x-formal (Hungarian formal address) to Names.php

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

Change 876415 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code jv-x-bms (map-bms, Banyumasan) to Names.php

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

Change 876416 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add mnc / mnc-* (Manchu) to Names.php

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

Change 876417 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code nan-* (Southern Min) to Names.php

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

Change 876418 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code nap-x-tara (Tarantino) to Names.php

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

Change 876419 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code nl-x-informal (Dutch (informal address ("je"))) to Names.php

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

Change 876420 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code nrf (nrm, Norman) to Names.php

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

Change 876424 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code wuu-* (Wu) to Names.php

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

Change 879402 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code zh-*-* ((Mandarin) Chinese) to Names.php

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

Change 879403 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code kk-*-* (Kazakh) to Names.php

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

Change 879404 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Add missing BCP 47 code ro-cyrl-md (mo, Moldovan) to Names.php

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

I don't think this is the right solution. We have good support for Bcp47Code in core now. We should more-carefully distinguish between "BCP-47 codes" (used in web standards, such as HTML, HTTP, and SVG) and "MediaWiki internal codes", and carefully convert between them (using the functions available both in core and client-side) where needed. We shouldn't need to add redundant entries to Names.php.

Change 805351 merged by jenkins-bot:

[mediawiki/core@master] Minor adjustments for Names.php and LanguageCode.php

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

I don't think this is the right solution. We have good support for Bcp47Code in core now. We should more-carefully distinguish between "BCP-47 codes" (used in web standards, such as HTML, HTTP, and SVG) and "MediaWiki internal codes", and carefully convert between them (using the functions available both in core and client-side) where needed. We shouldn't need to add redundant entries to Names.php.

Then there are 2 solutions:

  • Use BCP 47 codes in Names.php
    • LanguageCode::bcp47
    • Pros:
      • Language code follow BCP 47 mapping
      • We can have the actual als code in Names.php
    • Cons:
      • Names.php does not use MediaWiki internal codes
  • Map BCP 47 back to MediaWiki internal codes in the SVG lang menu
    • LanguageCode::bcp47ToInternal()

Any opinions?

Change 876420 abandoned by Winston Sung:

[mediawiki/core@master] Add nrf (nrm, Norman) to Names.php

Reason:

Replaced-by Ib8d3c344ebe082e4d3e5ec12b3815c5845f4797e

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

Change 879402 abandoned by Winston Sung:

[mediawiki/core@master] Add missing BCP 47 code zh-*-* ((Mandarin) Chinese) to Names.php

Reason:

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

Change 876414 abandoned by Winston Sung:

[mediawiki/core@master] Add missing BCP 47 code hu-x-formal (Hungarian formal address) to Names.php

Reason:

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

Change 876410 abandoned by Winston Sung:

[mediawiki/core@master] Add missing BCP 47 code es-x-formal (Spanish formal address) to Names.php

Reason:

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

Change 876419 abandoned by Winston Sung:

[mediawiki/core@master] Add missing BCP 47 code nl-x-informal (Dutch (informal address ("je"))) to Names.php

Reason:

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

Change 879403 abandoned by Winston Sung:

[mediawiki/core@master] Add missing BCP 47 code kk-*-* (Kazakh) to Names.php

Reason:

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

Change 876415 abandoned by Winston Sung:

[mediawiki/core@master] Add missing BCP 47 code jv-x-bms (map-bms, Banyumasan) to Names.php

Reason:

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

Change 876408 abandoned by Winston Sung:

[mediawiki/core@master] Add missing BCP 47 code de-x-formal (German - formal address ("Sie")) to Names.php

Reason:

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

Change 876418 abandoned by Winston Sung:

[mediawiki/core@master] Add missing BCP 47 code nap-x-tara (Tarantino) to Names.php

Reason:

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

Pppery changed the task status from In Progress to Open.Sat, Jun 15, 3:29 PM
Pppery edited projects, added Patch-Needs-Improvement; removed Patch-For-Review.