From 3c03ff738df4470c2ac5e0a1905820e1132c0cd0 Mon Sep 17 00:00:00 2001 From: Shawn Date: Tue, 30 Aug 2022 09:54:53 -0600 Subject: [PATCH] Tweak locale fallback logic --- README.md | 1 - lib/logic/locale_logic.dart | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f0ba5bd..0575fdde 100644 --- a/README.md +++ b/README.md @@ -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

diff --git a/lib/logic/locale_logic.dart b/lib/logic/locale_logic.dart index c07ac9e3..9067fda9 100644 --- a/lib/logic/locale_logic.dart +++ b/lib/logic/locale_logic.dart @@ -17,6 +17,9 @@ class LocaleLogic { // Uncomment for testing in chinese // locale = Locale('zh'); } + if (AppLocalizations.supportedLocales.contains(locale) == false) { + locale = Locale('en'); + } _strings = await AppLocalizations.delegate.load(locale); } }