有没有办法在使用 expo 的 react-native 中根据电话语言翻译上下文菜单? [英] Is there any way to translate context menu according to phone language in react-native using expo?

查看:22
本文介绍了有没有办法在使用 expo 的 react-native 中根据电话语言翻译上下文菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我使用 i18n 库来本地化我的应用程序的语言并且没有问题,除了仅在 iOS 中的上下文菜单中.即使我已经改变了像日语这样的语言,它总是会显示像英语这样的(选择、全选等)

So I use i18n library to localize my app's languages and theres no problem about it, except in context menu only in iOS. Even though I already change the language like Japanese it will always show English like (Select, Select All, etc.)

https://user-images.githubusercontent.com/47558402/66972776-41d34100-f0c8-11e9-850c-a2aa6b913782.png

我们有同样的问题:如何翻译上下文菜单反应原生?

但我在 expo 中使用 react-native.

but I'm using react-native with expo.

谢谢.

推荐答案

添加到app.json:

Add to app.json:

  1. 添加空的本地化文件(https://docs.expo.io/versions/latest/distribution/app-stores/#localizing-system-dialogs-on-ios):

语言环境":{"zh": "./languages/zh.json",ru":./languages/ru.json"},

"locales": { "zh": "./languages/zh.json", "ru": "./languages/ru.json" },

2.

 "ios": {
     "infoPlist": {
       "CFBundleLocalizations" : ["zh", "ru"],
       "CFBundleDevelopmentRegion" : "zh"
      }
    }

这篇关于有没有办法在使用 expo 的 react-native 中根据电话语言翻译上下文菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆