简体   繁体   English

Flutter:微信资产选择器。 将语言更改为英语

[英]Flutter: WeChat Assets Picker. Change language to English

I am using flutter wechat_assets_picker , but the language in select picture/camera screen is in Chinese: enter image description here我正在使用flutter wechat_assets_picker ,但是选择图片/相机屏幕中的语言是中文:在此处输入图像描述

Is there anyway to change the language to English?有没有办法把语言改成英文? Thank you谢谢

you have to just pass EnglishTextDelegate to textDelegate argument您只需将 EnglishTextDelegate 传递给 textDelegate 参数

selectedImages = await AssetPicker.pickAssets(context,textDelegate:EnglishTextDelegate() ); selectedImages = 等待 AssetPicker.pickAssets(context,textDelegate:EnglishTextDelegate());

The plugin now supports determining which language (if the language is supported) to use by lookup the Locale through the widget tree.该插件现在支持通过在小部件树中查找Locale来确定使用哪种语言(如果支持该语言)。 In summary:总之:

  • If your project supports localizations through the widget tree ( Locale specified in the WidgetsApp ), the picker will do its own to choose the matching locale.如果您的项目通过小部件树(在WidgetsApp中指定的Locale )支持本地化,则选择器将自行选择匹配的语言环境。
  • If none of the languages you're using are supported by the picker, customize your own by extending AssetPickerTextDelegate , then pass through the AssetPickerConfig.textDelegate when calling the picker.如果选择器不支持您使用的任何语言,请通过扩展AssetPickerTextDelegate自定义您自己的语言,然后在调用选择器时通过AssetPickerConfig.textDelegate传递。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为flutter包编写测试 Flutter WeChat Assets Picker - How to write test for flutter package Flutter WeChat Assets Picker 安装 wechat_assets_picker 后无法构建 Flutter App (Android) - Cannot build Flutter App (Android) after install wechat_assets_picker 在 flutter_wechat_assets_picker 中生成 android apk 时遇到错误 - Facing error while generating android apk in glide flutter_wechat_assets_picker 如何在 flutter 中更改显示日期选择器的语言 - How to change language of Show date picker in flutter 带有日期选择器的 Flutter 表单生成器。 没有名为“anchorPoint”的命名参数。 锚点:小部件.锚点, - Flutter Form Builder with Date Picker. No named parameter with the name 'anchorPoint'. anchorPoint: widget.anchorPoint, 当我更改应用程序的语言时,我只想在 Flutter 中将剪贴板文本(复制、粘贴等)更改为英文? - when i change the language of app i want clipboard text (Copy, Paste etc.,) to english only in Flutter? 我想通过wechat_camera_picker删除抓拍的图片 Flutter - I want to delete the captured image via wechat_camera_picker Flutter 更改语言的按钮 Flutter - Button to change the language Flutter 更改 Flutter package 中的语言(颤振) - Change language in a Flutter package (flutter) flutter 中的 timeago 从不更改英语的语言环境/语言 - timeago in flutter never changes locale/language from english
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM