android - 在应用程序运行时获取特定的字符串资源翻译
问题描述
在 Xamarin.Android 中,我有德语翻译的字符串资源和默认的英语翻译。当应用程序运行时,它只获取德语字符串。如何在不更改设备区域设置的情况下使其获得英文翻译?
<string name="exampleResource">Example string</string>
<string name="exampleResource">Beispiel string</string>
我需要在运行时在 Xamarin 应用程序中显示的第二个翻译。
解决方案
您是否尝试过改变 resx 对象的文化?
AppResources.Culture = new CultureInfo("en-EN");
推荐阅读
- php - 用文件名输入做笔记不起作用html?
- javascript - axios 解析 JSON 错误(服务器响应中出现意外字符)
- javascript - 依赖于 bootstrap.js 的轮播在 vue.js 组件中不起作用
- java - 你如何在 Android 中操作多边形?
- python - 我只有一把钥匙,但需要根据评分提取对象
- javascript - Angular 中的 D3 力模拟
- deconvolution - 在pytorch中使用双线性插值进行反卷积(convTranspose2D)初始化?
- java - 使用 lambda 表达式查找 Recaman 序列的第 n 个值
- xamarin.forms - 在后端服务器请求上启动后台服务
- python - 如何在python列表中的map()中使用lambda if else?