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

语言支持始终显示英文 #394

Open
ixre opened this issue Nov 19, 2024 · 2 comments
Open

语言支持始终显示英文 #394

ixre opened this issue Nov 19, 2024 · 2 comments

Comments

@ixre
Copy link

ixre commented Nov 19, 2024

尝试以下方法:

  1. 通过函数设置本地化
LocaleSettings.setLocale(AppLocale.zhHans);
CallKitI18nUtils.setLanguage(const Locale("zh"));
  1. 设置MaterialApp的语言为"zh-Hans-CN"或"zh-Hans"
MaterialApp(locale: const Locale('zh-Hans'))

拨打语音电话的UI文案始终为英文

@ixre
Copy link
Author

ixre commented Nov 19, 2024

经排查代码:

case AppLocale.zhHans: return 'zh-Hans';

无法与zh-Hans-CN进行匹配,故获取到英文。

同时在tuicall_kit_widget.dart文件中去掉设置语言的代码,此段代码会设置为英文

CallKitI18nUtils.setLanguage(Localizations.localeOf(context));

去掉后界面显示正常中文

1 similar comment
@ixre
Copy link
Author

ixre commented Nov 19, 2024

经排查代码:

case AppLocale.zhHans: return 'zh-Hans';

无法与zh-Hans-CN进行匹配,故获取到英文。

同时在tuicall_kit_widget.dart文件中去掉设置语言的代码,此段代码会设置为英文

CallKitI18nUtils.setLanguage(Localizations.localeOf(context));

去掉后界面显示正常中文

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