Skip to content

Commit

Permalink
Revert android breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Jul 18, 2018
1 parent b45bd67 commit 2404938
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 28 deletions.
34 changes: 14 additions & 20 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,25 @@ apply plugin: 'com.android.library'

def _ext = rootProject.ext

def _reactNativeVersion = _ext.has('reactNative') ? _ext.reactNative : '+'
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 27
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '27.0.3'
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 26
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '26.0.3'
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 27
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 26

android {
compileSdkVersion _compileSdkVersion
buildToolsVersion _buildToolsVersion
compileSdkVersion _compileSdkVersion
buildToolsVersion _buildToolsVersion

defaultConfig {
minSdkVersion _minSdkVersion
targetSdkVersion _targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion _minSdkVersion
targetSdkVersion _targetSdkVersion
}

lintOptions {
abortOnError false
}
}

dependencies {
//noinspection GradleDynamicVersion
compile "com.facebook.react:react-native:${_reactNativeVersion}"
compile "com.facebook.react:react-native:+" // From node_modules
}
2 changes: 2 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.AlexanderZaytsev.RNI18n">
<uses-sdk android:minSdkVersion="16" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ public String getName() {
}

private String toLanguageTag(Locale locale) {
String langTag;
String languageTag;

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
langTag = locale.toLanguageTag();
languageTag = locale.toLanguageTag();
} else {
StringBuilder builder = new StringBuilder();
builder.append(locale.getLanguage());
Expand All @@ -38,12 +39,17 @@ private String toLanguageTag(Locale locale) {
builder.append(locale.getCountry());
}

langTag = builder.toString();
languageTag = builder.toString();
}
if (langTag.matches("^(iw|in|ji).*")){
return langTag.replace("iw","he").replace("in","id").replace("ji","yi");

if (languageTag.matches("^(iw|in|ji).*")){
return languageTag
.replace("iw","he")
.replace("in","id")
.replace("ji","yi");
}
return langTag;

return languageTag;
}

private WritableArray getLocaleList() {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-i18n",
"version": "2.0.14",
"version": "2.0.15",
"description": "Provide I18n to your React Native application",
"license": "MIT",
"author": "Alexander Zaytsev",
Expand All @@ -16,6 +16,6 @@
"i18n"
],
"dependencies": {
"i18n-js": "^3.0.11"
"i18n-js": "3.0.11"
}
}
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


[email protected]:
version "3.0.11"
resolved "https://registry.yarnpkg.com/i18n-js/-/i18n-js-3.0.11.tgz#f9e96bdb641c5b9d6be12759d7c422089987ef02"

0 comments on commit 2404938

Please sign in to comment.