对于Xamarin.Forms本地化,我是否需要实现ILocalize? [英] For Xamarin.Forms localization, do I need to implement ILocalize?

查看:114
本文介绍了对于Xamarin.Forms本地化,我是否需要实现ILocalize?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Xamarin帮助页面 https://docs.microsoft.com/zh-cn/xamarin/xamarin-forms/app-fundamentals/localization/text?tabs=windows ,用于显示正确的语言",建议定义界面然后,ILocalize使用DependencyService获取一些语言环境信息.

In Xamarin help page https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/localization/text?tabs=windows, for "Displaying the Correct Language", it suggests to define interface ILocalize then use DependencyService to get some locale info.

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

However, My Xamarin.Forms Android app could just pick the right language resource file according to the locale settings of the device, and display rightful language.

因此,在没有ILocalize及其实现的情况下,翻译效果很好.我真的需要ILocalize及其实现吗?

So translations are working fine without ILocalize and the implementations. Do I really need ILocalize and the implementations?

推荐答案

不需要Xc0,Xamarin.Forms会自动识别它并获取适当的资源文件.文档需要更新,为此问题打开了一个问题

No need of DependencyService, Xamarin.Forms automatically recognizes it and gets the appropriate resource file. Docs needs to be updated, an issue was opened for the same

这篇关于对于Xamarin.Forms本地化,我是否需要实现ILocalize?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆