Refactored language selection to be clearer and support fallback mappings