-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Translations): update translations based on preferences
- Loading branch information
plondon
committed
Jun 6, 2018
1 parent
96ffcfb
commit 3a21f30
Showing
13 changed files
with
61 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/blockchain-wallet-v4-frontend/src/data/preferences/sagaRegister.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { takeLatest } from 'redux-saga/effects' | ||
import * as AT from './actionTypes' | ||
import sagas from './sagas' | ||
|
||
export default () => { | ||
const preferencesSagas = sagas() | ||
|
||
return function * () { | ||
yield takeLatest(AT.SET_LANGUAGE, preferencesSagas.setLanguage) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/blockchain-wallet-v4-frontend/src/data/preferences/sagas.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { put } from 'redux-saga/effects' | ||
import * as actions from '../actions.js' | ||
import * as C from 'services/AlertService' | ||
|
||
export default () => { | ||
const logLocation = 'preferences/sagas' | ||
|
||
const setLanguage = function * () { | ||
try { | ||
yield put(actions.alerts.displaySuccess(C.LANGUAGE_UPDATE_SUCCESS)) | ||
} catch (e) { | ||
yield put(actions.logs.logErrorMessage(logLocation, 'updateLanguage', e)) | ||
yield put(actions.alerts.displayError(C.LANGUAGE_UPDATE_ERROR)) | ||
} | ||
} | ||
|
||
return { | ||
setLanguage | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 2 additions & 9 deletions
11
...ges/blockchain-wallet-v4-frontend/src/scenes/Settings/Preferences/WalletLanguage/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
...blockchain-wallet-v4-frontend/src/scenes/Settings/Preferences/WalletLanguage/selectors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
import { selectors } from 'data' | ||
import { createDeepEqualSelector } from 'services/ReselectHelper' | ||
|
||
export const getData = state => selectors.core.settings.getLanguage(state) | ||
export const getData = (state) => createDeepEqualSelector( | ||
[selectors.preferences.getLanguage], | ||
(language) => { | ||
const locale = language || 'en' | ||
return { locale } | ||
} | ||
)(state) |
27 changes: 0 additions & 27 deletions
27
...chain-wallet-v4-frontend/src/scenes/Settings/Preferences/WalletLanguage/template.error.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.
25 changes: 0 additions & 25 deletions
25
...ain-wallet-v4-frontend/src/scenes/Settings/Preferences/WalletLanguage/template.loading.js
This file was deleted.
Oops, something went wrong.