Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个简单的数据库 - 一张有 6 个列的表。其中3个我想要两种语言。
是否可以自动完成?就像在列中添加语言前缀,它将选择用户使用的语言(_EN,_PL)?它会工作吗?
我必须将所有内容都放在一个数据库中,因为我将其复制到用户设备中。
我找不到有关它的信息,谢谢您的帮助。
不,即使使用 Android 的本地化功能,SQLite DB 也不是这样工作的。您可以strings.xml(例如)通过创建...
strings.xml
/res/values/strings.xml /res/values-pl/strings.xml
...等等,但数据库和查询对绝对列名起作用。
我能想到的最好的方法是识别本地语言,并在构建查询等时简单地使用缩写作为后缀或前缀。