我有一个简单的应用程序,我使用i18next在我的应用程序中应用翻译。
这是我的i18next代码:
import i18n from 'i18next';
import {initReactI18next} from 'react-i18next';
import en from './en/en.json';
import ar from './ar/ar.json';
import he from './he/he.json';
import AsyncStorage from '@react-nat
我正在尝试设置默认语言当用户第一次打开应用程序时,我使用的是i18next &react-I18下一种默认语言我想设置为ar,有没有一种方法可以在不需要用户操作的情况下将语言更改为ar
这是我的配置
import i18n from 'i18next';
import {initReactI18next} from 'react-i18next';
import {I18nManager} from 'react-native';
// the translations
const ar = require('./Lang/ar.
我正在使用i18n在react原生应用程序中进行本地化,但我在更改应用程序方向时遇到了一个问题,当我将其更改为阿拉伯语时,它将更改为RTL,但返回到英语时,它仍然保持不变 import { I18nManager } from 'react-native';
import I18n from 'react-native-i18n';
import Store from '../store/Store';
import en from './en';
import ar from './ar';
I18n.fall
当我试图在Android中编译我的应用程序时,我对“react原生-地理定位-服务”有一个问题。
Cannot find a version of 'com.android.support:appcompat-v7' that satisfies the version constraints:
Dependency path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7:26.1.0'
我正在尝试链接react-native-fetch-blob库,但出现错误
react-native link react-native-fetch-blob
和错误显示
Scanning folders for symlinks in ...\node_modules (48ms)
rnpm-install ERR! ERRPACKAGEJSON No package found. Are you sure this is a React Native project?
Cannot read property '_text' of undefined
我已经使用npm i
我无法从react-native项目中的react-native-osc库中导入。导入会导致一个“未定义”的对象。
我确实用npm安装库:
$ npm install react-native-osc --save
在App.js脚本中,导入了对象库,无论如何,当我在Expo.io环境中运行应用程序时,对象osc是'undefiend':
import osc from 'react-native-osc';
console.log(osc); // it will log 'undefined' on expo.io Android and e
我尝试使用此命令来安装库react-native-share
npm install react-native-share --save
react-native link react-native-share
但是我得到了这个错误:
A problem occurred evaluating project ':react-native-share'.
> Could not find method compileOnly() for arguments [com.facebook.react:react-native:+] on object of type org
问题描述
我通过npx react-native link react-native-navigation (并在andoid/build.gradle中修改minSdkVersion )安装库。
当我运行npx react-native run-android时,应用程序已经构建并且工作正常,尽管我在终端中得到了以下错误:
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-naviga
在iOS链接阶段,我开始看到的错误。
React原生版本:0.41.2、0.40、0.39
所有操作都很好,我编辑了Android版本,响应本地代码没有改变,当这种链接错误开始显示时,没有找到/node_modules/react-native/React/Base/{RCTHeaderName.h}路径上的标题:
In file included from /Users/user/ReactNativeProject/node_modules/react-native-vector-icons/RNVectorIconsManager/RNVectorIconsManager.h: