mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-21 20:39:22 +00:00
Fix lang selection
This commit is contained in:
parent
bfe932c053
commit
90b3ffbe81
@ -48,8 +48,8 @@ class _BannerWidgetState extends State<BannerWidget> {
|
||||
),
|
||||
Flexible(
|
||||
child: Text(
|
||||
banner.message.containsKey(lang())
|
||||
? banner.message[lang()]
|
||||
banner.message.containsKey(shortLang)
|
||||
? banner.message[shortLang]
|
||||
: banner.message["en"],
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
|
@ -49,7 +49,9 @@ String tr(String string, {Map<String, String> args}) {
|
||||
return string;
|
||||
}
|
||||
|
||||
/// Get current lang
|
||||
String lang() {
|
||||
return _currLang != null ? _currLang : "en";
|
||||
}
|
||||
/// Get current lang, in format aa_BB
|
||||
String get lang => _currLang != null ? _currLang : "en_US";
|
||||
|
||||
|
||||
/// Get short lang format, in format aa
|
||||
String get shortLang => lang.split("_")[0];
|
||||
|
Loading…
Reference in New Issue
Block a user