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.
react-native-locale-listener
Advanced tools
The library allows you to listen to locale changes on your device. for example reloading the app when the locale changed. ## Getting started
Readme
The library allows you to listen to locale changes on your device. for example reloading the app when the locale changed.
$ npm install react-native-locale-listener --save
$ react-native link react-native-locale-listener
android/app/src/main/java/[...]/MainApplication.java
import com.toyberman.localeReload.RNReactNativeLocalePackage;
to the imports at the top of the filenew RNReactNativeLocalePackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-locale-listener'
project(':react-native-locale-listener').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-locale-listener/android')
android/app/build.gradle
:
compile project(':react-native-locale-listener')
add to AndroidManifest.xml this :
android:configChanges="layoutDirection|locale"
and to MainActivity.java
import android.content.res.Configuration;
import android.content.Intent;
...
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Intent intent = new Intent("onConfigurationChanged");
intent.putExtra("newConfig", newConfig);
this.sendBroadcast(intent);
}
you can use it anywhere
import RNReactNativeLocale from 'react-native-locale-listener';
changeLayout(language) {
// Do what you need here
RNRestart.Restart();
}
componentDidMount () {
RNReactNativeLocale.addLocaleListener(this.changeLayout)
}
componentWillUnmount() {
// prevent leaking
RNReactNativeLocale.removeLocaleListener(this.changeLayout)
}
FAQs
The library allows you to listen to locale changes on your device. for example reloading the app when the locale changed. ## Getting started
The npm package react-native-locale-listener receives a total of 2 weekly downloads. As such, react-native-locale-listener popularity was classified as not popular.
We found that react-native-locale-listener demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.