Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/infinitered/ignite-ir-boile…
Browse files Browse the repository at this point in the history
…rplate-bowser

# Conflicts:
#	boilerplate/package.json.ejs
  • Loading branch information
nirre7 committed Sep 27, 2018
2 parents 05cd449 + 62e816e commit df7537a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
3 changes: 2 additions & 1 deletion boilerplate/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"mobx-react": "5.1.2",
"mobx-state-tree": "2.0.5",
"ramda": "0.25.0",
"react-native-i18n": "2.0.15",
"react-native-languages": "^3.0.0",
"i18n-js": "^3.0.11",
"react-native-keychain": "3.0.0",
"react-native-splash-screen": "3.1.1",
"react-navigation": "2.16.0",
Expand Down
8 changes: 5 additions & 3 deletions boilerplate/src/i18n/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import I18n from "react-native-i18n"
import RNLanguages from "react-native-languages"
import i18n from "i18n-js"

const en = require("./en")
const ja = require("./ja")

I18n.fallbacks = true
I18n.translations = { en, ja }
i18n.locale = RNLanguages.language
i18n.fallbacks = true
i18n.translations = { en, ja }
6 changes: 3 additions & 3 deletions boilerplate/src/i18n/translate.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import I18n from "react-native-i18n"
import i18n from "i18n-js"

/**
* Translates text.
*
* @param key The i18n key.
*/
export function translate(key: string) {
return key ? I18n.t(key) : null
return key ? i18n.t(key) : null
}

/**
Expand All @@ -16,5 +16,5 @@ export function translate(key: string) {
* @param vars Additional values sure to replace.
*/
export function translateWithVars(key: string, vars: object) {
return key ? I18n.t(key, vars) : null
return key ? i18n.t(key, vars) : null
}
13 changes: 8 additions & 5 deletions boilerplate/src/services/reactotron/reactotron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@ if (__DEV__) {
} else {
// attach a mock so if things sneaky by our __DEV__ guards, we won't crash.
console.tron = {
benchmark: noop,
clear: noop,
close: noop,
configure: noop,
connect: noop,
use: noop,
useReactNative: noop,
clear: noop,
log: noop,
logImportant: noop,
display: noop,
error: noop,
image: noop,
log: noop,
logImportant: noop,
reportError: noop,
use: noop,
useReactNative: noop,
warn: noop,
}
}

Expand Down
2 changes: 1 addition & 1 deletion boilerplate/test/mock-i18n.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jest.mock("react-native-i18n", () => {
jest.mock("i18n-js", () => {
return {
t: key => `${key}.test`,
}
Expand Down

0 comments on commit df7537a

Please sign in to comment.