Since MediaWiki core provided this feature in T4085: Add a {{USERLANGUAGE}} magic word. However we need to replace all current usage of {{UILANGCODE}} in translatewiki first.
(After this we should archive UILangCode extension, which will be another task.)