假设我有一个应用程序,它有一个标签,上面写着"hello“。我在应用程序商店上“全球”发布它。
如果有人在中国购买并打开它,应用商店会自动将其翻译为“你好”吗?如果不是,我该如何解决这个问题?我必须为每个国家制作一个应用程序吗?有没有办法在Xcode/coding中自动翻译?
发布于 2020-05-21 02:24:37
应用程序不会自动转换。您需要使用本地化。您设置了Localizable.strings (中国)和一个英文版本
英文文件:"hello“= "hello”
中国文件:"hello“=”你好“
在您的应用程序中,您需要使用NSLocalizedString
static let hello = NSLocalizedString("hello", comment: "Tab Bar title, and navigation bar title for Profile")
label.test = hello现在将根据设备语言设置进行翻译
更多示例https://www.raywenderlich.com/250-internationalizing-your-ios-app-getting-started
https://stackoverflow.com/questions/61667545
复制相似问题