在应用程序运行时获取特定的字符串资源转换

时间:2019-06-28 12:14:18

标签: android xml resources translation android-resources

在Xamarin.Android中,我具有用德语翻译的String资源和默认的英语翻译。当应用运行时,它仅获取德语字符串。如何在不更改设备区域设置的情况下获取英语翻译?

<string name="exampleResource">Example string</string>

<string name="exampleResource">Beispiel string</string>

我需要在运行时在Xamarin应用程序中显示第二个翻译。

1 个答案:

答案 0 :(得分:0)

您是否尝试过更改resx对象的区域性?

 AppResources.Culture = new CultureInfo("en-EN");
相关问题