如何知道 strings.xml 是否是默认文件?

How to know if the strings.xml is the default file?

我在这个项目中有 7 个字符串

strings.xml //This is the default
strings.xml (en)
strings.xml (ar)
strings.xml (es)
strings.xml (de)
strings.xml (it)
strings.xml (ru)

我在这样的服务器中有 JSON

[
  {
    "default": {
      "Message": "..."
    },
    "en": {
      "Message": "..."
    },
    "ar": {
      "Message": "..."
    },
    "es": {
      "Message": "..."
    },
    "de": {
      "Message": "..."
    },
    "it": {
      "Message": "..."
    },
    "ru": {
      "Message": "..."
    }
  }
]

我想根据设备语言阅读消息,但问题是如何知道 strings.xml 是否是显示来自 JSON 的默认消息的默认文件?

你可以使用方法。

总而言之,您在每个 strings.xml 中声明一个 string 告诉当前正在使用哪个。