Skip to content
Permalink
Browse files

Rename project to react-native-localize

  • Loading branch information...
zoontek committed Jan 28, 2019
1 parent 1633c6b commit a1621801404c7c3aa020850b0b4a0c13b7b287e5
Showing with 212 additions and 212 deletions.
  1. +1 βˆ’1 .github/ISSUE_TEMPLATE.md
  2. +21 βˆ’21 README.md
  3. +1 βˆ’1 android/src/main/AndroidManifest.xml
  4. +4 βˆ’4 ...n/java/com/reactcommunity/{rnlanguages/RNLanguagesModule.java β†’ rnlocalize/RNLocalizeModule.java}
  5. +3 βˆ’3 ...java/com/reactcommunity/{rnlanguages/RNLanguagesPackage.java β†’ rnlocalize/RNLocalizePackage.java}
  6. +2 βˆ’2 example/android/app/BUCK
  7. +2 βˆ’2 example/android/app/build.gradle
  8. +1 βˆ’1 example/android/app/src/main/AndroidManifest.xml
  9. +2 βˆ’2 example/android/app/src/main/java/com/rnlanguagesexample/MainActivity.java
  10. +3 βˆ’3 example/android/app/src/main/java/com/rnlanguagesexample/MainApplication.java
  11. +1 βˆ’1 example/android/app/src/main/res/values/strings.xml
  12. +3 βˆ’3 example/android/settings.gradle
  13. +2 βˆ’2 example/app.json
  14. +59 βˆ’59 example/ios/RNLanguagesExample.xcodeproj/project.pbxproj
  15. +18 βˆ’18 example/ios/RNLanguagesExample.xcodeproj/xcshareddata/xcschemes/RNLanguagesExample-tvOS.xcscheme
  16. +12 βˆ’12 example/ios/RNLanguagesExample.xcodeproj/xcshareddata/xcschemes/RNLanguagesExample.xcscheme
  17. +1 βˆ’1 example/ios/RNLanguagesExample/AppDelegate.m
  18. +1 βˆ’1 example/ios/RNLanguagesExample/Base.lproj/LaunchScreen.xib
  19. +1 βˆ’1 example/ios/RNLanguagesExample/Info.plist
  20. +3 βˆ’3 example/package.json
  21. +14 βˆ’14 example/src/AsyncExample.js
  22. +14 βˆ’14 example/src/SyncExample.js
  23. +1 βˆ’1 example/yarn.lock
  24. +3 βˆ’3 index.d.ts
  25. +5 βˆ’5 index.js
  26. +1 βˆ’1 ios/{RNLanguages.h β†’ RNLocalize.h}
  27. +2 βˆ’2 ios/{RNLanguages.m β†’ RNLocalize.m}
  28. +1 βˆ’1 ios/{RNLanguages.podspec β†’ RNLocalize.podspec}
  29. +27 βˆ’27 ios/{RNLanguages.xcodeproj β†’ RNLocalize.xcodeproj}/project.pbxproj
  30. +3 βˆ’3 package.json
@@ -9,7 +9,7 @@ be closed if it doesn't provide the informations required.

### Describe your environment

- react-native-languages version
- react-native-localize version
- react-native version
- Target platform: iOS, Android, bothΒ ?
- Device (which one?), simulatorΒ ?
@@ -1,10 +1,10 @@
# 🌍  react-native-languages
# 🌍  react-native-localize

A toolbox for your app localization.

[![npm version](https://badge.fury.io/js/react-native-languages.svg)](https://badge.fury.io/js/react-native-languages) [![npm](https://img.shields.io/npm/dt/react-native-languages.svg)](https://www.npmjs.org/package/react-native-languages) ![Platform - Android and iOS](https://img.shields.io/badge/platform-Android%20%7C%20iOS-yellow.svg) ![MIT](https://img.shields.io/dub/l/vibe-d.svg) [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![npm version](https://badge.fury.io/js/react-native-localize.svg)](https://badge.fury.io/js/react-native-localize) [![npm](https://img.shields.io/npm/dt/react-native-localize.svg)](https://www.npmjs.org/package/react-native-localize) ![Platform - Android and iOS](https://img.shields.io/badge/platform-Android%20%7C%20iOS-yellow.svg) ![MIT](https://img.shields.io/dub/l/vibe-d.svg) [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

<img width="400" height="auto" src="https://github.com/react-community/react-native-languages/blob/4.0.0/docs/ios-screenshot.png?raw=true" />
<img width="400" height="auto" src="https://github.com/react-community/react-native-localize/blob/4.0.0/docs/ios-screenshot.png?raw=true" />

## Support

@@ -18,17 +18,17 @@ A toolbox for your app localization.
#### Using yarn

```bash
$ npm install --save react-native-languages
$ npm install --save react-native-localize
# --- or ---
$ yarn add react-native-languages
$ yarn add react-native-localize
```

## Linking

#### Using react-native-cli (recommended)

```bash
$ react-native link react-native-languages
$ react-native link react-native-localize
```

_NB: If you use a Cocoapods and have a `Podfile`, `react-native link` will only add this library as a dependency, and you'll need to run `pod install`._
@@ -37,7 +37,7 @@ _NB: If you use a Cocoapods and have a `Podfile`, `react-native link` will only

```ruby
# add this line in your Podfile
pod 'RNLanguages', :path => '../node_modules/react-native-languages/ios'
pod 'RNLocalize', :path => '../node_modules/react-native-localize/ios'
```

```bash
@@ -47,31 +47,31 @@ $ pod install
#### Manual (iOS)

1. In the XCode's "Project navigator", right click on your project's Libraries folder ➜ `Add Files to <...>`
2. Go to `node_modules` ➜ `react-native-languages` ➜ `ios` ➜ select `RNLanguages.xcodeproj`
3. Add `RNLanguages.a` to `Build Phases -> Link Binary With Libraries`
2. Go to `node_modules` ➜ `react-native-localize` ➜ `ios` ➜ select `RNLocalize.xcodeproj`
3. Add `RNLocalize.a` to `Build Phases -> Link Binary With Libraries`

#### Manual (Android)

1. Add the following lines to `android/settings.gradle`:

```gradle
include ':react-native-languages'
project(':react-native-languages').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-languages/android')
include ':react-native-localize'
project(':react-native-localize').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-localize/android')
```

2. Add the compile line to the dependencies in `android/app/build.gradle`:

```gradle
dependencies {
// ...
compile project(':react-native-languages')
compile project(':react-native-localize')
}
```

3. Add the import and link the package in `MainApplication.java`:

```java
import com.reactcommunity.rnlanguages.RNLanguagesPackage; // <-- Add the RNLanguages import
import com.reactcommunity.rnlocalize.RNLocalizePackage; // <-- Add the RNLocalize import
public class MainApplication extends Application implements ReactApplication {
@@ -82,7 +82,7 @@ public class MainApplication extends Application implements ReactApplication {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
// ...
new RNLanguagesPackage() // <-- Add it to the packages list
new RNLocalizePackage() // <-- Add it to the packages list
);
}
@@ -93,17 +93,17 @@ public class MainApplication extends Application implements ReactApplication {
## Basic usage

```javascript
import RNLanguages from "react-native-languages";
import RNLocalize from "react-native-localize";
// User preferred languages list (in order)
console.log("languages", RNLanguages.languages);
console.log("languages", RNLocalize.languages);
// User preferred currencies (in order)
console.log("currencies", RNLanguages.currencies);
console.log("currencies", RNLocalize.currencies);
// Listening for languages changes (on Android)
RNLanguages.addListener("configDidChange", () => {
// RNLanguages exported constants changed
RNLocalize.addListener("configDidChange", () => {
// RNLocalize exported constants changed
// Do languages related things
});
```
@@ -124,8 +124,8 @@ RNLanguages.addListener("configDidChange", () => {

## Add project's supported localizations (iOS)

![](https://github.com/react-community/react-native-languages/blob/master/docs/xcode-adding-locales.png?raw=true)
![](https://github.com/react-community/react-native-localize/blob/master/docs/xcode-adding-locales.png?raw=true)

## Examples with [i18n-js](https://github.com/fnando/i18n-js)

Browse the files in the [/example](https://github.com/react-community/react-native-languages/tree/master/example) directory.
Browse the files in the [/example](https://github.com/react-community/react-native-localize/tree/master/example) directory.
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reactcommunity.rnlanguages">
package="com.reactcommunity.rnlocalize">
</manifest>
@@ -1,4 +1,4 @@
package com.reactcommunity.rnlanguages;
package com.reactcommunity.rnlocalize;

import android.content.BroadcastReceiver;
import android.content.Context;
@@ -29,7 +29,7 @@

import javax.annotation.Nullable;

public class RNLanguagesModule extends ReactContextBaseJavaModule implements LifecycleEventListener {
public class RNLocalizeModule extends ReactContextBaseJavaModule implements LifecycleEventListener {

private static final List<String> USES_FAHRENHEIT_UNIT =
Arrays.asList("BS", "BZ", "KY", "PR", "PW", "US");
@@ -41,7 +41,7 @@
private boolean applicationIsPaused = false;
private boolean emitChangeOnResume = false;

public RNLanguagesModule(ReactApplicationContext reactContext) {
public RNLocalizeModule(ReactApplicationContext reactContext) {
super(reactContext);

IntentFilter filter = new IntentFilter();
@@ -62,7 +62,7 @@ public void onReceive(Context context, Intent intent) {

@Override
public String getName() {
return "RNLanguages";
return "RNLocalize";
}

@Override
@@ -1,4 +1,4 @@
package com.reactcommunity.rnlanguages;
package com.reactcommunity.rnlocalize;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
@@ -9,11 +9,11 @@
import java.util.Collections;
import java.util.List;

public class RNLanguagesPackage implements ReactPackage {
public class RNLocalizePackage implements ReactPackage {

@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(new RNLanguagesModule(reactContext));
return Arrays.<NativeModule>asList(new RNLocalizeModule(reactContext));
}

@Override
@@ -35,12 +35,12 @@ android_library(

android_build_config(
name = "build_config",
package = "com.rnlanguagesexample",
package = "com.rnlocalizeexample",
)

android_resource(
name = "res",
package = "com.rnlanguagesexample",
package = "com.rnlocalizeexample",
res = "src/main/res",
)

@@ -98,7 +98,7 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
applicationId "com.rnlanguagesexample"
applicationId "com.rnlocalizeexample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
@@ -135,7 +135,7 @@ android {

dependencies {
implementation project(':react-native-fs')
implementation project(':react-native-languages')
implementation project(':react-native-localize')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rnlanguagesexample">
package="com.rnlocalizeexample">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
@@ -1,4 +1,4 @@
package com.rnlanguagesexample;
package com.rnlocalizeexample;

import com.facebook.react.ReactActivity;

@@ -10,6 +10,6 @@
*/
@Override
protected String getMainComponentName() {
return "RNLanguagesExample";
return "RNLocalizeExample";
}
}
@@ -1,4 +1,4 @@
package com.rnlanguagesexample;
package com.rnlocalizeexample;

import android.app.Application;

@@ -9,7 +9,7 @@
import com.facebook.soloader.SoLoader;

import com.rnfs.RNFSPackage;
import com.reactcommunity.rnlanguages.RNLanguagesPackage;
import com.reactcommunity.rnlocalize.RNLocalizePackage;

import java.util.Arrays;
import java.util.List;
@@ -27,7 +27,7 @@ public boolean getUseDeveloperSupport() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNFSPackage(),
new RNLanguagesPackage()
new RNLocalizePackage()
);
}

@@ -1,3 +1,3 @@
<resources>
<string name="app_name">RNLanguagesExample</string>
<string name="app_name">RNLocalizeExample</string>
</resources>
@@ -1,9 +1,9 @@
rootProject.name = 'RNLanguagesExample'
rootProject.name = 'RNLocalizeExample'

include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')

include ':react-native-languages'
project(':react-native-languages').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-languages/android')
include ':react-native-localize'
project(':react-native-localize').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-localize/android')

include ':app'
@@ -1,4 +1,4 @@
{
"name": "RNLanguagesExample",
"displayName": "RNLanguagesExample"
"name": "RNLocalizeExample",
"displayName": "RNLocalizeExample"
}

0 comments on commit a162180

Please sign in to comment.
You can’t perform that action at this time.