android - 如何在 Android 中使用带有英文单词的 ar-rAE?
问题描述
我有资源R.string.word
<string name="word">%2$s %1$s</string>
此字符串资源用于显示 TextView(Ej. 12343 ترتيب),这与阿拉伯语的设备完美配合。但是,如果我有阿拉伯语的设备并且单词是另一种语言(如英语),则应用程序会更改订单 Ej.(订单 12343)。我尝试删除英文的默认字符串资源但不起作用,我尝试使用自定义区域设置强制使用(ar-rAE)但也不起作用。
Resources res = getResources();
Configuration conf = res.getConfiguration();
Locale savedLocale = conf.locale;
conf.locale = desiredLocale; // whatever you want here
res.updateConfiguration(conf, null);
我不完全确定 Android 是否检测到这些词并忽略设备中的语言,使用这些词来定义要使用的 R.string。
解决方案
在此处查看有关 Android 文档中 RTL 的更多信息:支持布局镜像
推荐阅读
- python - 如何在python中重新采样和插入新数据
- dax - DAX 将每一行值除以累积和的结果
- node.js - 如何在 Node js 中处理并发 sftp 连接。出现错误没有可用的 sftp 连接
- c++ - 随机将字符转换为大写的函数
- c++ - 密码登录程序永远循环并显示不正确的结果
- git - 如何合并这些已停产的分支
- reactjs - 我需要类似于下面给出的引导响应导航栏组件的材料 UI 组件
- azure-devops - Azure Devops 分支选项卡未在构建管道中显示任何内容
- sql - 如何在 SQL 中创建 CREATE VIEW INVOICE_V?
- amazon-dynamodb - 根据用户角色/访问权限从 dynamodb 表中获取数据