Browse Source

fix: fallback to supported locale if easy_localization doesn't support device locale

appflowy 3 years ago
parent
commit
62bafce0b2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      frontend/app_flowy/lib/workspace/application/appearance.dart

+ 2 - 2
frontend/app_flowy/lib/workspace/application/appearance.dart

@@ -47,10 +47,10 @@ class AppearanceSettingModel extends ChangeNotifier with EquatableMixin {
 
   void setLocale(BuildContext context, Locale newLocale) {
     if (_locale != newLocale) {
-      if (context.supportedLocales.contains(newLocale)) {
+      if (!context.supportedLocales.contains(newLocale)) {
         Log.error("Unsupported locale: $newLocale");
         newLocale = const Locale('en');
-        Log.debug("Fall back to locale: $newLocale");
+        Log.debug("Fallback to locale: $newLocale");
       }
 
       context.setLocale(newLocale);