Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地语言bug #13

Open
Carl-Wen opened this issue Mar 5, 2020 · 0 comments
Open

本地语言bug #13

Carl-Wen opened this issue Mar 5, 2020 · 0 comments

Comments

@Carl-Wen
Copy link

Carl-Wen commented Mar 5, 2020

iOS:1. 设置本地语言为 中文简体,系统回掉 取到的是 美国英文;
2. (系统中文)先设置app为中文环境,重启app,然后选auto,app显示中文,在重启app,又会显示为英文;

Android:1. 系统设置为中文,app中取到的是 zh_Hans_CN,设置auto的话还是显示英文;

localeResolutionCallback:
                (Locale _locale, Iterable<Locale> supportedLocales) {
              if (localeModel.getLocale() != null) {
                //如果已经选定语言,则不跟随系统
                return localeModel.getLocale();
              } else {
                Locale locale;
                //APP语言跟随系统语言,如果系统语言不是中文简体或美国英语,
                //则默认使用美国英语
                print(_locale);
                print(supportedLocales.toList()[0]);
                print(supportedLocales.toList()[1]);
                if (supportedLocales.contains(_locale)) {
                  locale = _locale;
                } else {
                  locale = Locale('en', 'US');
                }
                return locale;
              }
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant