File:Content Translation default suggested language calculation.svg

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

This is a file from the Wikimedia Commons. The description on its description page there is copied below.

Summary

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

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.

Captions

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

Items portrayed in this file

depicts

28 February 2023

image/svg+xml

80509afe0e4777b54bc0025a04a9ccb98a59326d

24,256 byte

1,233 pixel

1,189 pixel

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)AdamwRemove unused node
12:06, 28 February 2023Thumbnail for version as of 12:06, 28 February 20231,225 × 1,234 (24 KB)AdamwUploaded own work with UploadWizard

The following page uses this file:

Metadata