Page MenuHomePhabricator

Edit schemas in multiple languages
Closed, ResolvedPublic

Event Timeline

Lucas_Werkmeister_WMDE triaged this task as High priority.Feb 14 2019, 2:53 PM
Lucas_Werkmeister_WMDE created this task.

Parking this here, this or something like this should be added to MediaWikiRevisionSchemaWriterTest when implementing this ticket.

	public function testUpdateMultiLingualSchemaNameBadgeSuccess() {
		$id = 'O1';
		$language = 'en';
		$englishLabel = 'Goat';
		$englishDescription = 'This is what a goat looks like';
		$englishAliases = [ 'Capra' ];
		$existingContent = new WikibaseSchemaContent( json_encode( [
			'id' => $id,
			'serializationVersion' => '2.0',
			'labels' => [
				'en' => 'Cat',
				'de' => 'Ziege',
			],
			'descriptions' => [
				'en' => 'This is what a cat looks like',
				'de' => 'Wichtigste Eigenschaften einer Ziege'
			],
			'aliases' => [
				'en' => [ 'Tiger', 'Lion' ],
				'de' => [ 'Capra', 'Hausziege' ]
			],
			'schema' => '# some schema about goats',
			'type' => 'ShExC',
		] ) );
		$expectedContent = new WikibaseSchemaContent( json_encode( [
			'id' => $id,
			'serializationVersion' => '2.0',
			'labels' => [
				'en' => $englishLabel,
				'de' => 'Ziege',
			],
			'descriptions' => [
				'en' => $englishDescription,
				'de' => 'Wichtigste Eigenschaften einer Ziege'
			],
			'aliases' => [
				'en' => $englishAliases,
				'de' => [ 'Capra', 'Hausziege' ]
			],
			'schema' => '# some schema about goats',
			'type' => 'ShExC',
		] ) );

		$pageUpdaterFactory = $this
			->getPageUpdaterFactoryProvidingAndExpectingContent( $expectedContent, $existingContent );
		$writer = new MediaWikiRevisionSchemaWriter(
			$pageUpdaterFactory,
			$this->getMessageLocalizer(),
			$this->getMockWatchlistUpdater( 'optionallyWatchEditedSchema' )
		);

		$writer->updateSchemaNameBadge(
			new SchemaId( $id ),
			$language,
			$englishLabel,
			$englishDescription,
			$englishAliases
		);
	}
Michael claimed this task.Mar 7 2019, 11:41 AM
Michael moved this task from Backlog to Doing on the Shape Expressions Sprint 3 board.
Restricted Application added a project: User-Michael. · View Herald TranscriptMar 7 2019, 11:41 AM

Change 495852 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Implement editing schema in multiple languages

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

Possible improvements to what is currently being worked on:

  • Back to "item/language selection"-Button on second form
  • Add simple autocomplete for the language selection field (I would suggest using <datalist>)
  • Show page title in the notice of the second form in the interface language instead of the edited language
  • Rename text on first form submit button to "Next" or something similar

I ordered them to how useful I think they might be. But they should be implemented in new stories.
CC @Lydia_Pintscher

Change 495852 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Implement editing schema in multiple languages

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

hoo removed a project: Patch-For-Review.
hoo added a subscriber: hoo.

Moving this back to Doing as this seems to not be done yet (also the full scope is somewhat unclear).

Michael removed Michael as the assignee of this task.Mar 13 2019, 10:02 AM

Unassigning myself as I'm not sure what there is left to do.

Lydia_Pintscher closed this task as Resolved.Mar 14 2019, 8:50 AM
Lydia_Pintscher claimed this task.
Lydia_Pintscher moved this task from Verification to Done on the Shape Expressions Sprint 4 board.

\o/