Page MenuHomePhabricator

Recognize apc language code in MediaWiki
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):

Support the apc language code.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

I want to be able to use language=apc (for instance) in citation templates on the English Wikipedia.

However, there is a limited number of supported languages for citation on Wikipedia: https://en.wikipedia.org/wiki/Template:Citation_Style_documentation/language/doc

In particular, Levantine Arabic is not recognized whereas other Arabic varieties such as arz (Egyptian), arq (Algerian), aeb (Tunisian), shu (Chadian), and ary (Moroccan) are: https://en.wikipedia.org/wiki/Help_talk:Citation_Style_1#Add_languages

Benefits (why should this be implemented?):

Support one of the most spoken and most widely understood Arabic varieties in the Arab world.

According to T187344: Add language codes for Arabic languages for use in labels, aliases and descriptions to Wikidata; "If one or the other language code is needed (for labels/descriptions/aliases) or just monolingual string or lexemes, it might be worth creating a separate request.", here it is!

See also: T286290: Update Levantine Arabic language & T286417: Default font for Levantine Arabic (ajp/apc) shows incorrect glyphs on Windows 10

Adding languages: https://www.mediawiki.org/wiki/Manual:Adding_and_removing_languages

  • Add to translatewiki
  • Add to cldr extension if possible or the cldr overrides
  • Add to language-data if not possible to add to cldr extension
  • Add to includes/languages/data/Names.php (patch)
  • Set fallback, etc. (discussion, jquery.i18n patch, core patch)
  • Add to rtl languages of MF (patch)
  • Add to release notes (patch)
  • Remove from translatewiki after deploying the core change (patch)
  • Remove the language from Wikibase and WikibaseLexeme (patch)
  • Fix ULS language search (patch)

(Comment: The initial version of this task included the ajp code, but that code was deprecated in ISO 639 since then.)

Event Timeline

A455bcd9 updated the task description. (Show Details)

If the use is for an English Wikipedia template, shouldn't additions be required there?

No samples for uses at Wikidata have been provided.

According to people here the only way to solve this issue is to add it to MediaWiki and it cannot be done on the English Wikipedia.

An example of use on Wikidata, we cannot use the "native label" using the apc code on the Levantine Arabic item: https://www.wikidata.org/wiki/Q56593

It seems the request is unrelated to Wikidata. Maybe you want to edit the description to make this clear.

Merely adding "native label" on the language item itself isn't considered sufficient to create the code for Wikidata (see https://www.wikidata.org/wiki/Help:Monolingual_text_languages#Requirements_for_a_new_language_code ).

OK, I thought the underlying issue for the lack of support for ajp in the citation template and on Wikidata was the same.

If it's not, then it means I need to create a new ticket for Wikidata?

In any case, this issue (the lack of support of ajp in citation templates) still stands.

Depending on how it's solved for the template, it might do it for Wikidata as well.

There is a simplified way to define it for monolingual text in Wikidata, but this generally requires to provide samples for how it's to be used.

OK, I see, thanks.

So regarding samples for how it's to be used:

Please let me know if this is enough. There may also be other use cases I don't have in mind right now.

Actually it seems that audio entries can be added for South Levantine Arabic (or any other dialect, for instance "Palestinian Arabic") even though ajp and apc codes are not recognized.

ajp has been deprecated since the task was created and merged into apc.

apc is supported on translatewiki. If anyone translates enough of it, it will be fully supported in MediaWiki.

If you want support in Wikidata or Lexemes before that, it's probably covered by task T332264, and this task can probably be merged into that one.

Nikki subscribed.

ajp has been deprecated since the task was created and merged into apc.

apc is supported on translatewiki. If anyone translates enough of it, it will be fully supported in MediaWiki.

If you want support in Wikidata or Lexemes before that, it's probably covered by task T332264, and this task can probably be merged into that one.

This task has nothing to do with Wikidata. The description says they want it to work in a template on the English Wikipedia. It looks like the template/module is fetching language names from MediaWiki, which fails because MediaWiki doesn't have names for most languages. I'm not sure why it's doing that instead of using something more suited to the task like https://en.wikipedia.org/wiki/Module:ISO_639_name, but if we want MediaWiki to know the English name, it would have to be added to LocalNamesEn.php in the CLDR extension (even if someone translates enough of it for it to be added as an interface language).

Change 955921 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/core@master] Add apc autonym to MediaWiki

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

Made this patch because of T345870, but might require additional changes to cldr extension and friends ?

Change 955921 abandoned by TheDJ:

[mediawiki/core@master] Add apc autonym to MediaWiki

Reason:

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

Made this patch because of T345870, but might require additional changes to cldr extension and friends ?

Hi,
I don't understand, the latest CLDR release includes apc: https://cldr.unicode.org/index/downloads/cldr-43

What else needs to be done?

What else needs to be done?

I guess Debian needs to ship an updated package which the Wikimedia servers which run Debian would use: https://tracker.debian.org/pkg/unicode-cldr-core

What else needs to be done?

I guess Debian needs to ship an updated package which the Wikimedia servers which run Debian would use: https://tracker.debian.org/pkg/unicode-cldr-core

Thanks. I asked them when it'll be packaged.

I guess Debian needs to ship an updated package which the Wikimedia servers which run Debian would use: https://tracker.debian.org/pkg/unicode-cldr-core

That's not relevant for English names. English names for languages come from the CLDR extension. The data in the extension is independent of the operating system, it's updated by downloading the version of CLDR you want to use and running rebuild.php.

I don't understand, the latest CLDR release includes apc: https://cldr.unicode.org/index/downloads/cldr-43

What else needs to be done?

CLDR does not have an English name for apc though - https://github.com/unicode-org/cldr/blob/main/common/main/en.xml

Once they've added one, it will be included in the next release, and after the next release, the MediaWiki CLDR extension will need updating to the latest CLDR release. Until that happens, it could be temporarily added to LocalNamesEn.php in the CLDR extension.

Amire80 changed the task status from Open to Stalled.Feb 29 2024, 1:42 AM

Most of the remaining points can be completed after the localization of core MediaWiki gets to 13%. Currently, it's at 11%, so you are very close.

The first thing I recommend is fixing the translations with wikitext issues: https://translatewiki.net/w/i.php?title=Special:Translate&group=core-0-mostused&language=apc&filter=fuzzy&optional=1&action=page

(Most of those have incorrect usage of {{PLURAL}}. Whoever does the translations, should make sure to use all the correct singular and plural forms. It looks like now all of them only use the plural forms and omit the singular, and they don't use the {{PLURAL}} keyword at all. The instructions for using {{PLURAL}} in Standard Arabic are at https://translatewiki.net/wiki/Localisation_guidelines/ar , and they can probably be reused for this language, too.)

After all those are fixed, complete the "Most important messages".

jquery.ime is probably unnecessary, but if you need any characters that don't appear in Standard Arabic keyboards, please let me know.

Amire80 renamed this task from Recognize ajp and apc language codes in MediaWiki to Recognize apc language codes in MediaWiki.Mon, Apr 29, 11:29 AM
Amire80 renamed this task from Recognize apc language codes in MediaWiki to Recognize apc language code in MediaWiki.
Amire80 updated the task description. (Show Details)
Raymond changed the task status from Stalled to Open.Tue, Apr 30, 7:33 AM

First export for apc from translatewiki now with https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1025602

I think https://gerrit.wikimedia.org/r/955921 could be restored, couldn't it?

First export for apc from translatewiki now with https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1025602

I think https://gerrit.wikimedia.org/r/955921 could be restored, couldn't it?

True, thanks for the reminder.

Change #955921 restored by Amire80:

[mediawiki/core@master] Add apc autonym to MediaWiki

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

Change #1025712 had a related patch set uploaded (by Amire80; author: Amire80):

[mediawiki/extensions/WikibaseLexeme@master] Remove local definitions for languages fon and apc

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

Change #955921 merged by jenkins-bot:

[mediawiki/core@master] Add apc autonym to MediaWiki

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

Change #1025708 had a related patch set uploaded (by Abijeet Patro; author: Amire80):

[translatewiki@master] Remove apc, which was added to Names.php

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

Change #1025708 merged by jenkins-bot:

[translatewiki@master] Remove apc, which was added to Names.php

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

Change #1030898 had a related patch set uploaded (by Amire80; author: Amire80):

[mediawiki/extensions/UniversalLanguageSelector@master] Add search aliases for Levantine Arabic and Palembang

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