【问题标题】:For Xamarin.Forms localization, do I need to implement ILocalize?对于 Xamarin.Forms 本地化,是否需要实现 ILocalize?
【发布时间】:2019-04-01 06:20:55
【问题描述】:

在 Xamarin 帮助页面 https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/localization/text?tabs=windows 中,对于“显示正确的语言”,它建议定义接口 ILocalize 然后使用 DependencyService 获取一些语言环境信息。

但是,我的 Xamarin.Forms Android 应用只能根据设备的区域设置选择正确的语言资源文件,并显示正确的语言。

因此,如果没有 ILocalize 和实现,翻译工作正常。我真的需要 ILocalize 和实现吗?

【问题讨论】:

  • 我在各种安卓设备上测试过,不需要。我还没有在 iOS 上测试过。

标签: android xamarin xamarin.forms localization internationalization


【解决方案1】:

不需要DependencyService,Xamarin.Forms 会自动识别并获取相应的资源文件。文档需要更新,an issue was opened for the same

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-27
    • 1970-01-01
    • 2019-07-24
    • 2016-01-02
    • 1970-01-01
    • 1970-01-01
    • 2015-09-03
    相关资源
    最近更新 更多