Page MenuHomePhabricator

Edit schemas in multiple languages
Closed, ResolvedPublic

Event Timeline

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
		);
	}

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).

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