Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | gengh | T279114 Switch ZMonoLingualString over to using Z60/Natural language objects, rather than 'en' etc. strings | |||
Resolved | DVrandecic | T279115 Populate initial Z60/Natural language objects | |||
Resolved | DVrandecic | T263000 Decide on modelling for a type for natural languages (for ZMonoLingualString, etc.) |
Event Timeline
I have looked into this issue to define the scope of it, and mapped it to be as follow:
- Change the UI component of a monolingual string to show a dropdown of Z60 and not he hardcoded
- Change the UI component to define the selected language as a reference to the Z60 selected ( this is my assumption)
- Change the PHP side to define a monolingual as an array of Z60
- Define the Z60 and tests associated to it in the backend
- Change the "getPreferredMonolingualString" method to return the Z60 representation of the language?
Not sure what "Change the PHP side to define a monolingual as an array of Z60" means, but if it means that a Monolingual string should use the Z60 instead of a Z6 for the language, then that is right.
You also asked me to provide a few example JSONs, here we go:
So the definition of Z11/Monolingual string would change from the current
- Z11K1/language of type Z6/String
- Z11K2/text of type Z6/String
to
- Z11K1/language of type Z60/Language
- Z11K2/text of type Z6/String
We already should have a set of languages available in an empty installation (all Z1xxx objects).
So an instance of a current monolingual text would currently look like
{ "Z1K1": "Z11", "Z11K1": "en", "Z11K2": "Hello, world!" }
and would look after the change like
{ "Z1K1": "Z11", "Z11K1": "Z1002", "Z11K2": "Hello, world!" }
or, in normal form,
{ "Z1K1": { "Z1K1": "Z9", "Z9K1": "Z11" }, "Z11K1": { "Z1K1": "Z6", "Z6K1": "en" }, "Z11K2": { "Z1K1": "Z6", "Z6K1": "Hello, world!" } }
would change to
{ "Z1K1": { "Z1K1": "Z9", "Z9K1": "Z11" }, "Z11K1": { "Z1K1": "Z9", "Z9K1": "Z1002" }, "Z11K2": { "Z1K1": "Z6", "Z6K1": "Hello, world!" } }
Thus, a literal of a Z12/Multingual string would change, in canonical form, from
{ "Z1K1": "Z12", "Z12K1": [{ "Z1K1": "Z11", "Z11K1": "en", "Z11K2": "Hello, world!" }, { "Z1K1": "Z11", "Z11K1": "it", "Z11K2": "Ciao mondo!" }] }
to
{ "Z1K1": "Z12", "Z12K1": [{ "Z1K1": "Z11", "Z11K1": "Z1002", "Z11K2": "Hello, world!" }, { "Z1K1": "Z11", "Z11K1": "Z1787", "Z11K2": "Ciao mondo!" }] }
I hope this helps!
One thing that would need to be changed would be to change all the data on wiki from the current code based language identifiers to the new ZIDs, at least for the data to be loaded in. We might also want to have a task to provide a maintenance script to update an existing wiki.
That explanation is perfect Denny!
i will investigate this story further and ask for clarification/help if required down the line
I have spent a couple of hours on investigation of this tasks, and realized that its scope is too wide for my current knowledge of the PHP side. Will remove me as assignee and will probably pick this up later when my knowledge of the BE have improved
While working on some maintenance scripts, I have come across the following problems. While updating the label data table, the following entry clashes are found, which result on an update failure:
Problem updating Z1253: The provided content's label clashes with ZObject 'Z1202' for the label in 'en'. Problem updating Z1477: The provided content's label clashes with ZObject 'Z1097' for the label in 'en'. Problem updating Z1528: The provided content's label clashes with ZObject 'Z1193' for the label in 'en'. Problem updating Z1653: The provided content's label clashes with ZObject 'Z1498' for the label in 'en'. Problem updating Z1669: The provided content's label clashes with ZObject 'Z1265' for the label in 'en'. Problem updating Z1706: The provided content's label clashes with ZObject 'Z1196' for the label in 'en'. Problem updating Z1742: The provided content's label clashes with ZObject 'Z1132' for the label in 'en'. Problem updating Z1762: The provided content's label clashes with ZObject 'Z1503' for the label in 'en'. Problem updating Z1852: The provided content's label clashes with ZObject 'Z1755' for the label in 'en'.
According to our code, labels must be uniquely identified by (type, language, label)
Change 697761 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):
[mediawiki/extensions/WikiLambda@master] Change language codes to ZLanguage (Z60) Zids
Change 697761 merged by jenkins-bot:
[mediawiki/extensions/WikiLambda@master] Change language codes to ZLanguage (Z60) Zids
Change 702253 had a related patch set uploaded (by DVrandecic; author: DVrandecic):
[mediawiki/extensions/WikiLambda@master] Switch type of Z11K1/language from Z6/String to Z60/Language
Change 702253 merged by jenkins-bot:
[mediawiki/extensions/WikiLambda@master] Follow-up ae21160f50: Switch type of Z11K1/language from Z6/String to Z60/Language