Page MenuHomePhabricator

New pre-defined built-in function: Z860/Get ZLanguage Given Language Code
Closed, ResolvedPublic

Description

Introduce a new Builtin that takes a language code and returns the corresponding Language object ZID.

Returns an error if the language code does not match to anything.

Signature: Z6 -> Z60

Suggested ZID: Z860 (Because Z60 is language)

  • Add new definition to function-schemata for Z860 and Z960.
  • Add built-in implementation of Z960 to function-orchestrator and wire up for Z860 requests.

Event Timeline

The logic might be in MediaWiki for that? Would Orchestrator call over that MediaWiki API?

Should MediaWiki have a clean API to do this, and then the Vue code could use this API too?

(Also consider Aliases)

Happy to work on this.

I like the idea of making it a MW API call.

Should the language code -> language mapping live in the DB, or might it be sufficient just to have an in-memory map in the PHP code? Are we relying on MW's languages at all, or is this a totally separate mapping? ISO language codes?

DVrandecic triaged this task as Lowest priority.Oct 6 2021, 4:44 PM
Jdforrester-WMF renamed this task from New builtin: From language code to language to New pre-defined function, Z860/From language code to language.Nov 3 2021, 4:37 PM
DVrandecic raised the priority of this task from Lowest to High.Nov 17 2021, 5:52 PM
Jdforrester-WMF renamed this task from New pre-defined function, Z860/From language code to language to New pre-defined built-in function: Z860/Get ZLanguage Given Language Code.Jan 26 2022, 10:29 PM

Change 762859 had a related patch set uploaded (by Jkieserman; author: Jkieserman):

[mediawiki/services/function-schemata@master] add mapping file for language code to zid, add definition and implementation files for language code to language function

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

Change 763249 had a related patch set uploaded (by Jforrester; author: Jkieserman):

[mediawiki/services/function-schemata@master] definitions: Provide Z860/Language code to language and Z960 built-in

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

Change 762859 merged by jenkins-bot:

[mediawiki/services/function-schemata@master] definitions: Add a mapping file for language code -> ZID and enforce up-to-date-ness

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

Change 763249 merged by jenkins-bot:

[mediawiki/services/function-schemata@master] definitions: Provide Z860/Language code to language and Z960 built-in

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

Change 763250 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (9930c82)

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

Change 763251 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (9930c82)

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

Change 763253 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (9930c82)

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

Change 763251 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (9930c82)

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

Change 763330 had a related patch set uploaded (by Jkieserman; author: Jkieserman):

[mediawiki/services/function-orchestrator@master] add implementation for builtin language code to language

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

Change 763250 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (9930c82)

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

Change 763253 merged by jenkins-bot:

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (bd3c52f)

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

Change 763330 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] add implementation for builtin language code to language

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

Jdforrester-WMF added a subscriber: Jdforrester-WMF.

@JKieserman – I think this is done, but don't want to revert your move from QA to Code Review.

ah sorry I wasn't sure if it belonged in code review or QA but yes it is done!

ah sorry I wasn't sure if it belonged in code review or QA but yes it is done!

Excellent. :-)