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