Tweak locale fallback logic

This commit is contained in:
Shawn 2022-08-30 09:54:53 -06:00
parent 88572fd7af
commit 3c03ff738d
2 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,3 @@
[![Codemagic build status](https://api.codemagic.io/apps/62c5bf4e59f5e09fd24b0994/62c5bf4e59f5e09fd24b0993/status_badge.svg)](https://codemagic.io/apps/62c5bf4e59f5e09fd24b0994/62c5bf4e59f5e09fd24b0993/latest_build)
# Wonderous # Wonderous
<p align="center"> <p align="center">
<img src="https://user-images.githubusercontent.com/736973/187334196-b79e48b2-dbb8-4ea7-8aac-04dbc7e5159f.png#gh-dark-mode-only"> <img src="https://user-images.githubusercontent.com/736973/187334196-b79e48b2-dbb8-4ea7-8aac-04dbc7e5159f.png#gh-dark-mode-only">

View File

@ -17,6 +17,9 @@ class LocaleLogic {
// Uncomment for testing in chinese // Uncomment for testing in chinese
// locale = Locale('zh'); // locale = Locale('zh');
} }
if (AppLocalizations.supportedLocales.contains(locale) == false) {
locale = Locale('en');
}
_strings = await AppLocalizations.delegate.load(locale); _strings = await AppLocalizations.delegate.load(locale);
} }
} }