Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@crowdin/react-native-sdk
Advanced tools
Readme
beta
Crowdin React Native SDK delivers all-new translations from the Crowdin project to the application immediately. So there is no need to update this application to get the new version with the localization.
The SDK is using the Android SDK and iOS SDK as Native Modules and provides:
It allows you to easily download localization from Crowdin and use it in your application.
React Native 0.6+
Using npm:
npm install @crowdin/react-native-sdk --save
Using React Native CLI:
react-native link @crowdin/react-native-sdk
To discover how React Native SDK is integrated into a real project see the Example project. You can set up this project for yourself, run, and test.
This example uses the React Native Localization package for interface localization.
To run the example project, first clone the repo, fill in SDK configuration in the App class and run a project in the example directory:
Navigate to the example directory:
cd react-native-sdk/example
Install dependencies:
npm install
Start React Native webserver:
react-native start
Run Emulator/Simulator or connect a real device.
Open another terminal and run:
react-native run-android
for Android App
react-native run-ios
for iOS App
Note: To read more about setting up the development environment see the Official Docs.
To configure React Native SDK integration you need to:
Distribution is a CDN vault that mirrors the translated content of your project and is required for integration with the React Native app.
To manage distributions open the needed project and go to Over-The-Air Content Delivery. You can create as many distributions as you need and choose different files for each. You’ll need to click the Release button next to the necessary distribution every time you want to send new translations to the app.
Notes:
Import Crowdin dependency:
import Crowdin from '@crowdin/react-native-sdk';
Crowdin React Native SDK provides a set of methods that allows you to download localization from CDN and use it in your application.
Initialization:
Crowdin.initWithHashString('distribution_hash', 'source_language_code', (messages) => { })
distribution_hash
- Crowdin Distribution Hash.source_language_code
- Source language code in your Crowdin project.Callback parameters:
messages
- An array of errors of library initialization or localization downloading. In case initialization success returns "Localization downloaded" message.Get localization resources for the current language:
Crowdin.getResources()
Returns all downloaded localization for the current language in JSON format as a String.
{"language": "en", "strings": {...}, "arrays": {...}, "plurals": {...}}
Get localizations for the specific language:
Crowdin.getResourcesByLocale('target_language_code', (data) => { })
target_language_code
- Language Codes.Callback parameters:
data
- all downloaded localization for the specified language in JSON format as a String.
{"language": "en", "strings": {...}, "arrays": {...}, "plurals": {...}}
Get localized string by key for current locale:
Crowdin.getString('key')
key
- localization string key.Example of how to Update / Overwrite Locale with the react-native-localization
:
updateLocalization() {
Crowdin.initWithHashString('distribution_hash', DEFAULT_LANGUAGE, (message) => {});
Crowdin.getResourcesByLocale('uk', (data) => {
var response = JSON.parse(data);
translations.setContent(
Object.assign({}, translations.getContent(), {
uk: response.strings
})
);
this.resetState();
})
}
resetState = () => {
this.setState({});
}
For more details see the App.js class.
Currently, Screenshots and Real-Time Preview features are not available.
If you want to contribute please read the Contributing guidelines.
If you find any problems or would like to suggest a feature, please feel free to file an issue on Github at Issues Page.
Need help working with Crowdin React Native SDK or have any questions? Contact Customer Success Service.
Crowdin React Native SDK CDN feature is built with security in mind, which means minimal access possible from the end-user is required. When you decide to use Crowdin React Native SDK, please make sure you’ve made the following information accessible to your end-users.
The Crowdin React Native SDK is licensed under the MIT License. See the LICENSE file distributed with this work for additional information regarding copyright ownership. Except as contained in the LICENSE file, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization.
FAQs
Crowdin React Native SDK delivers all new translations from Crowdin project to the application immediately
The npm package @crowdin/react-native-sdk receives a total of 2 weekly downloads. As such, @crowdin/react-native-sdk popularity was classified as not popular.
We found that @crowdin/react-native-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.