获取应用程序的资源语言应用程序、语言、资源

2023-09-04 05:05:29 作者:追光少年i

是否有可能在运行时,知道哪些资源的语言嵌在我的应用程序?

即此的presence文件夹:

 值恩
值德
值-FR
...
 

解决方案

AssetManager.getLocales()实际上要做到这一点的方式。然而,从公共API,你创建的每一个AssetManager也有包含在其搜索路径......所以,当你调用AssetManager.getLocales(),您还将看到与框架资源的一部分的任何语言​​环境的框架资源。有没有办法来解决这个问题的SDK,不好意思。

Is it possible, at runtime, to know which resources languages are embedded in my app?

C语言程序设计 宿舍信息管理系统

i.e the presence of this folders:

values-en
values-de
values-fr
...

解决方案

AssetManager.getLocales() is actually the way to do this. However, from the public API every AssetManager you create also has the framework resources included in its search path... so when you call AssetManager.getLocales() you will also see any locales that are part of the framework resources. There is no way to get around this with the SDK, sorry.