One possible solution

MediaWiki Translations
Possible Solution
I think this is a good solution if you separate different language pages into Sidebar/zh-hans, Sidebar/de and so on. Thus, you do not need switch for select sidebar.