use lcode_to_ietf for comparing lang codes when fetching flat topic tree

Cleaner solution for #1399, based off @bcipolli's comments.