您的 React Native 应用程序本地化的工具箱
您的 React Native 应用程序本地化的工具箱。
此库遵循 React Native 版本支持政策。
它支持 最新版本 和 前两个次要系列。
$ npm install --save react-native-localize
# --- or ---
$ yarn add react-native-localize请不要忘记在此之后运行 pod install!
在 ios/YourApp/Info.plist 中将您支持的本地化版本添加到 CFBundleLocalizations 中:
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>fr</string>
</array>在 android/app/src/main/AndroidManifest.xml 中的 <application> 元素上设置 android:localeConfig:
<application android:localeConfig="@xml/locale_config" />然后在 android/app/src/main/res/xml/locale_config.xml 中列出您支持的区域设置:
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
<locale android:name="en" />
<locale android:name="fr" />
</locale-config>使用 config 插件在 app.json 或 app.config.js 中指定支持的本地化版本。
暂无开放 Issues,或尚未同步最近议题。