defaultLanguageStr property

String defaultLanguageStr

To extract the language code from a locale identifier, we typically parse the identifier and take the first part before any underscore. The language code is always at the beginning of the locale identifier and is separated from any subsequent parts (like country/region or script) by an underscore.

Implementation

String get defaultLanguageStr => utils.normalizeLocale(defaultLocaleStr).split('_')[0];