我正在尝试使用 Xamarin 表单的 xaml 本地化指南中解释的 TranslateExtension 方法。但是我收到错误。
Unhandled Exception:
System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "CashRegisterApp.Resx.AppResources.resources" was correctly embedded or linked into assembly "CashRegisterApp.Android" at compile time, or that all the satellite assemblies required are loadable and fully signed. occurred
调试后,我注意到资源文件的扩展名由于某种原因设置为 .resources。由于这不是资源管理器的公共(public)成员,我不确定如何将其设置为使用 resx 或 resw 文件。
最佳答案
您需要为您的资源
指定当前区域性。
var culture = "en-US";
AppResources.Culture = new System.Globalization.CultureInfo(culture);
关于.net - 尝试以 xaml xamarin 形式进行本地化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48913363/