File:Content Translation default suggested language calculation.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 1,189 × 1,233 pixels, file size: 24 KB)

Captions

Captions

Activity diagram detailing the Content Translation calculation to find a default suggested translation language pair.

Summary[edit]

Description
English: Unreviewed analysis of the current behavior of the UniversalLanguageSelector and ContentTranslation extensions.

PlantUML source code:

@startuml
start
split
	group mw.uls.getFrequentLanguageList
		:ulsFrequentLanguages = [
			wgUserLanguage,
			wgContentLanguage,
			window.navigator.language or window.navigator.userLanguage,
			ULS previously used languages,
			wgULSAcceptLanguageList or window.navigator.languages,
			geolocated country languages,
		];
		:Clean list to only include
		valid and supported languages;
	end group
split again
	group siteMapper.getLanguagePairs
		:{targetLanguages, sourceLanguages} =
			get /list/languagepairs from CX service;
	end group
end split
group CXDashboard
	:filter possible target and source languages
	by ulsFrequentLanguages
	and filter to targets which are also in sources;
	split
		if (URL query "to"?) then (yes)
			:targetLanguage = query.to;
		(no) elseif (stored targetLanguage?) then (yes)
			:targetLanguage = stored targetLanguage;
		else (no)
		endif
		if (targetLanguage in targetLanguages) then (no)
			:targetLanguage = wgContentLanguage;
		else (yes)
		endif
	split again
		if (URL query "from"?) then (yes)
			:sourceLanguage = query.from;
		(no) elseif (stored sourceLanguage?) then (yes)
			:sourceLanguage = stored sourceLanguage;
		else (no)
		endif
	end split
	if (sourceLanguage valid?) then (no)
	  :sourceLanguage = first sourceLanguages != targetLanguage;
  else (yes)
	endif
	if (targetLanguage valid?) then (no)
	  :targetLanguage = first targetLanguages != sourceLanguage;
  else (yes)
	endif
	:store default source and target language;
end group
stop
@enduml
Date
Source Own work
Author Adamw

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current22:24, 28 February 2023Thumbnail for version as of 22:24, 28 February 20231,189 × 1,233 (24 KB)Adamw (talk | contribs)Remove unused node
12:06, 28 February 2023Thumbnail for version as of 12:06, 28 February 20231,225 × 1,234 (24 KB)Adamw (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata