瀏覽代碼

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

appflowy 3 年之前
父節點
當前提交
62bafce0b2
共有 1 個文件被更改,包括 2 次插入2 次删除
  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);