Page MenuHomePhabricator

Add control to avoid saving multilingual strings with repeated languages.
Open, MediumPublic

Assigned To
None
Authored By
CCoxwell-WMF
Jul 11 2023, 8:41 PM
Referenced Files
F43512125: Screenshot from 2024-03-26 17-31-39.png
Mar 27 2024, 10:36 AM
F43512115: Screenshot from 2024-03-26 17-31-32.png
Mar 27 2024, 10:36 AM
Restricted File
Mar 26 2024, 4:32 PM
Restricted File
Mar 26 2024, 4:32 PM
Subscribers

Description

Description

This json publishes/persists with no errors:

{
	"Z1K1": "Z2",
	"Z2K1": {
		"Z1K1": "Z6",
		"Z6K1": "Z10003"
	},
	"Z2K2": {
		"Z1K1": "Z8",
		"Z8K1": [
			"Z17",
			{
				"Z1K1": "Z17",
				"Z17K1": "Z99",
				"Z17K2": "Z10003K1",
				"Z17K3": {
					"Z1K1": "Z12",
					"Z12K1": [
						"Z11"
					]
				}
			}
		],
		"Z8K2": "Z2",
		"Z8K3": [
			"Z20"
		],
		"Z8K4": [
			"Z14",
			"Z928"
		],
		"Z8K5": "Z10003"
	},
	"Z2K3": {
		"Z1K1": "Z12",
		"Z12K1": [
			"Z11",
			{
				"Z1K1": "Z11",
				"Z11K1": "Z1002",
				"Z11K2": "example function name"
			}
		]
	},
	"Z2K4": {
		"Z1K1": "Z32",
		"Z32K1": [
			"Z31"
		]
	},
	"Z2K5": {
		"Z1K1": "Z12",
		"Z12K1": [
			"Z11",
			{
				"Z1K1": "Z11",
				"Z11K1": "Z1002",
				"Z11K2": "an english description"
			},
			{
				"Z1K1": "Z11",
				"Z11K1": "Z1002",
				"Z11K2": "another english description"
			}
		]
	}
}

Desired behavior/Acceptance criteria

  • Multilingual strings have a set of unique-language Monolingual strings
  • The front-end provides a component system that avoids repeated languages
  • The PHP layer provides a system to pin down such occurrences and returns an error (or removes the repeated item? which one is kept? the first? the last?)

Completion checklist

Event Timeline

Mcastro lowered the priority of this task from High to Medium.Jan 18 2024, 5:45 PM
gengh renamed this task from Possible to create a Z2K5 that contains multiple description objects for the same language to Add control to avoid saving multilingual strings with repeated languages..Feb 22 2024, 10:06 AM
gengh updated the task description. (Show Details)
gengh added a project: WikiLambda Front-end.
gengh edited subscribers, added: gengh; removed: CCoxwell-WMF.

@AAlhazwani-WMF Does it make any sense to create a ZMultilingualString component for default view?
Is there anything (interface-wise) that we could do that would be better than the current TypedList of ZMonolingualString components?

If there's a reason to do this, we could address this problem within the component. Else, we'll have to do some extra transformations pre-submissions

Currently multilingual string objects are shown this way:

Screenshot from 2024-03-26 17-31-32.png (378×350 px, 14 KB)

Screenshot from 2024-03-26 17-31-39.png (479×386 px, 20 KB)

DSmit-WMF subscribed.

@gengh I think we have the first 2 now, which leave the PHP part of this I think