active_keyboard_language
library
Functions
-
isRtlLanguageTag(String? tag)
→ bool
-
True if
tag's primary language subtag is a right-to-left script
language (Arabic, Hebrew, Persian, Urdu, Pashto, Sindhi, Central
Kurdish, Divehi, Yiddish). Matches on the primary subtag only, so
ar-EG, AR, and ar are all treated the same.
-
normalizeLanguageTag(String? raw)
→ String?
-
Normalizes a raw platform-provided language tag: lowercase language
subtag (remapping legacy Java/Android codes to their modern equivalents),
titlecase 4-letter script subtags (e.g.
Hans), uppercase 2-letter
region subtags. Returns null for null/empty/unparseable input rather
than throwing — an odd keyboard tag must never crash the host app.