ReactNativeLocalization | Class to localize the ReactNative interface | Internationalization library
kandi X-RAY | ReactNativeLocalization Summary
kandi X-RAY | ReactNativeLocalization Summary
This library has been refactored to use the newly created localized-strings package, now added as a dependency, so to unify the code and make it easier to mantain. All the basic code is now in the localized-strings project and in the react-localization version that adds support for embedding JSX code in the formatted strings, by overriding the formatString method. This version adds a custom version of the getInterfaceLanguage to retrieve the interface language from the native OS.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ReactNativeLocalization
ReactNativeLocalization Key Features
ReactNativeLocalization Examples and Code Snippets
Community Discussions
Trending Discussions on ReactNativeLocalization
QUESTION
I am having issue in Xcode while I try to build or archive my react-native project. Xcode throwing error like no such file or directory: '/Users/...../DerivedData/myproject/Build/Products/Debug-iphonesimulator/libReactNativeLocalization.a'
.
when I run react-native run-ios
or in release mode react-native run-ios --configuration Release
then it is working perfectly fine but when I try to build or archive it from Xcode then it is throwing error.
- I am using Xcode version 10
- My
react-native
version is 0.57.4 - iOS development target is 9.0
react-native-localization
version is 2.0.3
Tried things which didn't worked for me
Removed node_modules and pods completely and run
npm install
andpod install
didn't worked for me .In menue File --> workspace setting changed build system from Use Shared System to Legacy build system. in this particular case app is build and archived successfully but when I lunch my app then it crashes after splash screen.
Removed Derived Data completely and rebuild again still getting this error.
If I remove
react-native-localization
completely from my project then all the things are working fine and I am able to build and archive the project.
ANSWER
Answered 2019-Apr-03 at 03:10When we run react-native link react-native-localization
command then it also applies the changes on ios app too which creates an issue in our case. So due to this command, it creates an entry in project_name → ios → podfile (podfile)
Here ReactNativeLocalization is pointing to project_name/node_modules/react-native-localization directory due to this line when we run pod install command then there is one dependence React in this package is going to reinstall in your pods as you can see in this image.(as you can see here)
Follow the following steps to overcome form this issue
- After
react-native link react-native-localization
command navigate to project_name → ios → podfile and remove or commentpod ‘ReactNativeLocalization’, :path => ‘../node_modules/react-native-localization’
- Now its time to link
react-native-localization
library manually from Xcode. So to link this library manually open project_name → ios → project_name.xcworksace file in Xcode and select your target. - After that in project navigator right click on library and select Add Files to “...” and after that navigate to project_name → node_modules → react-native-localization and select ReactNativeLocalization.xcodeproj file.
- Now navigate to project Target → Build Phase and expand Link Binary With Library after that click on plus icon and add libReactNativeLocalization.a library
QUESTION
I'm building a React Native app with TypeScript.
I want to use jest-fetch-mock. In the documentation it says to create setup.js
file and add
ANSWER
Answered 2018-Nov-14 at 10:45Why typescript compiles .js
files?
If you have setup.ts
file: try to add declare var global: any;
before global.fetch = ...
.
However, I suggest you to use typings for your project:
QUESTION
I have an existing React-native project which I'm trying to move to expo
I have followed the steps described here to do this. I have complete all the steps in the article, yet when I start the project I run into the following error.
From my research what I understood is that, a libReactNativeLocalization.a
file is missing from somewhere.
Here is the library I'm using for localization.
What am I doing wrong?
...ANSWER
Answered 2017-May-22 at 21:53With Expo, you can't react-native-link custom native modules. You write just JavaScript (unless you eject, in which case you're in a roughly similar situation before you tried to convert to Expo).
The way you can do localization with Expo is to use these functions: https://docs.expo.io/versions/v17.0.0/sdk/util.html#expoutilgetcurrentlocaleasync
There isn't a way to use the native module you link to without ejecting unfortunately.
Good luck!
QUESTION
I'm starting to code in React-Native and, when trying to use the ReactLocalization library im getting the following error codes:
...ANSWER
Answered 2017-Mar-02 at 09:38Changed the above code with this one:
https://github.com/stefalda/react-localization/blob/master/src/LocalizedStrings.js
and the error went away.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ReactNativeLocalization
npm install --save react-native-localization
In the XCode's "Project navigator", right click on Libraries folder under your project ➜ Add Files to <...>
Go to node_modules ➜ react-native-localization and add the ReactNativeLocalization.xcodeproj file
Add libReactNativeLocalization.a to Build Phases -> Link Binary With Libraries
Build and run
register module (in MainApplication.java). (Thanks to @rebeccahughes for showing by example how to create an android module for React Native).
npm install --save react-native-localization
In android/setting.gradle ... include ':react-native-localization', ':app' project(':react-native-localization').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-localization/android')
In android/app/build.gradle ... dependencies { ... compile project(':react-native-localization') }
register module (in MainApplication.java) import com.babisoft.ReactNativeLocalization.ReactNativeLocalizationPackage; // <--- import public class MainApplication extends Application implements ReactApplication { ...... @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new ReactNativeLocalizationPackage() ); } ...... }
Full process is documented in official React Native plugin for Universal Windows repo: https://github.com/Microsoft/react-native-windows/blob/master/docs/LinkingLibrariesWindows.md.
Run npm install --save react-native-localization
Open your Visual Studio solution.
Right-click the solution in the Solution Explorer
Select Add -> Existing Project
Choose the .csproj of the dependency from the Explorer window. Dependency will be in node_modules\react-native-localization\windows\ReactNativeLocalization
Right-click the Universal Windows App project in the Solution Explorer
Select Add -> Reference
Choose the ReactNativeLocalization project.
Open MainPage.cs
Add the new ReactNativeLocalization.RNLocalizationPackage() to the Packages list in MainPage.cs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page