separate out cross-browser i18n for extensions

feature/default_network_editable
Nick Doiron 7 years ago
parent 99898ac775
commit 7da52c5997
  1. 1
      ui/app/accounts/import/json.js
  2. 1
      ui/app/accounts/import/private-key.js
  3. 1
      ui/app/accounts/import/seed.js
  4. 1
      ui/app/accounts/new-account/create-form.js
  5. 1
      ui/app/accounts/new-account/index.js
  6. 1
      ui/app/components/account-menu/index.js
  7. 1
      ui/app/components/customize-gas-modal/index.js
  8. 1
      ui/app/components/dropdowns/components/account-dropdowns.js
  9. 1
      ui/app/components/dropdowns/network-dropdown.js
  10. 1
      ui/app/components/dropdowns/token-menu-dropdown.js
  11. 1
      ui/app/components/modals/account-details-modal.js
  12. 1
      ui/app/components/modals/account-modal-container.js
  13. 1
      ui/app/components/modals/buy-options-modal.js
  14. 1
      ui/app/components/modals/deposit-ether-modal.js
  15. 1
      ui/app/components/modals/edit-account-name-modal.js
  16. 1
      ui/app/components/modals/export-private-key-modal.js
  17. 1
      ui/app/components/modals/hide-token-confirmation-modal.js
  18. 1
      ui/app/components/modals/modal.js
  19. 1
      ui/app/components/modals/new-account-modal.js
  20. 1
      ui/app/components/pending-tx/confirm-deploy-contract.js
  21. 1
      ui/app/components/pending-tx/confirm-send-ether.js
  22. 1
      ui/app/components/pending-tx/confirm-send-token.js
  23. 8
      ui/app/first-time/init-menu.js
  24. 18
      ui/i18n.js

@ -4,6 +4,7 @@ const h = require('react-hyperscript')
const connect = require('react-redux').connect const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const FileInput = require('react-simple-file-input').default const FileInput = require('react-simple-file-input').default
const t = require('../../../i18n')
const HELP_LINK = 'https://support.metamask.io/kb/article/7-importing-accounts' const HELP_LINK = 'https://support.metamask.io/kb/article/7-importing-accounts'

@ -3,6 +3,7 @@ const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('react-redux').connect const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const t = require('../../../i18n')
module.exports = connect(mapStateToProps, mapDispatchToProps)(PrivateKeyImportView) module.exports = connect(mapStateToProps, mapDispatchToProps)(PrivateKeyImportView)

@ -2,6 +2,7 @@ const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('react-redux').connect const connect = require('react-redux').connect
const t = require('../../../i18n')
module.exports = connect(mapStateToProps)(SeedImportSubview) module.exports = connect(mapStateToProps)(SeedImportSubview)

@ -3,6 +3,7 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const { connect } = require('react-redux') const { connect } = require('react-redux')
const actions = require('../../actions') const actions = require('../../actions')
const t = require('../../../i18n')
class NewAccountCreateForm extends Component { class NewAccountCreateForm extends Component {
constructor (props) { constructor (props) {

@ -3,6 +3,7 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('react-redux').connect const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const t = require('../../../i18n')
const { getCurrentViewContext } = require('../../selectors') const { getCurrentViewContext } = require('../../selectors')
const classnames = require('classnames') const classnames = require('classnames')

@ -6,6 +6,7 @@ const actions = require('../../actions')
const { Menu, Item, Divider, CloseArea } = require('../dropdowns/components/menu') const { Menu, Item, Divider, CloseArea } = require('../dropdowns/components/menu')
const Identicon = require('../identicon') const Identicon = require('../identicon')
const { formatBalance } = require('../../util') const { formatBalance } = require('../../util')
const t = require('../../../i18n')
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountMenu) module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountMenu)

@ -3,6 +3,7 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('react-redux').connect const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const t = require('../../../i18n')
const GasModalCard = require('./gas-modal-card') const GasModalCard = require('./gas-modal-card')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')

@ -10,6 +10,7 @@ const Identicon = require('../../identicon')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const copyToClipboard = require('copy-to-clipboard') const copyToClipboard = require('copy-to-clipboard')
const { formatBalance } = require('../../../util') const { formatBalance } = require('../../../util')
const t = require('../../../../i18n')
class AccountDropdowns extends Component { class AccountDropdowns extends Component {
constructor (props) { constructor (props) {

@ -6,6 +6,7 @@ const actions = require('../../actions')
const Dropdown = require('./components/dropdown').Dropdown const Dropdown = require('./components/dropdown').Dropdown
const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem
const NetworkDropdownIcon = require('./components/network-dropdown-icon') const NetworkDropdownIcon = require('./components/network-dropdown-icon')
const t = require('../../../i18n')
const R = require('ramda') const R = require('ramda')
// classes from nodes of the toggle element. // classes from nodes of the toggle element.

@ -3,6 +3,7 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('react-redux').connect const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const t = require('../../../i18n')
module.exports = connect(null, mapDispatchToProps)(TokenMenuDropdown) module.exports = connect(null, mapDispatchToProps)(TokenMenuDropdown)

@ -8,6 +8,7 @@ const { getSelectedIdentity } = require('../../selectors')
const genAccountLink = require('../../../lib/account-link.js') const genAccountLink = require('../../../lib/account-link.js')
const QrView = require('../qr-code') const QrView = require('../qr-code')
const EditableLabel = require('../editable-label') const EditableLabel = require('../editable-label')
const t = require('../../../i18n')
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {

@ -5,6 +5,7 @@ const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const { getSelectedIdentity } = require('../../selectors') const { getSelectedIdentity } = require('../../selectors')
const Identicon = require('../identicon') const Identicon = require('../identicon')
const t = require('../../../i18n')
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {

@ -4,6 +4,7 @@ const inherits = require('util').inherits
const connect = require('react-redux').connect const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const networkNames = require('../../../../app/scripts/config.js').networkNames const networkNames = require('../../../../app/scripts/config.js').networkNames
const t = require('../../../i18n')
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {

@ -5,6 +5,7 @@ const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const networkNames = require('../../../../app/scripts/config.js').networkNames const networkNames = require('../../../../app/scripts/config.js').networkNames
const ShapeshiftForm = require('../shapeshift-form') const ShapeshiftForm = require('../shapeshift-form')
const t = require('../../../i18n')
const DIRECT_DEPOSIT_ROW_TITLE = t('directDepositEther') const DIRECT_DEPOSIT_ROW_TITLE = t('directDepositEther')
const DIRECT_DEPOSIT_ROW_TEXT = t('directDepositEtherExplainer') const DIRECT_DEPOSIT_ROW_TEXT = t('directDepositEtherExplainer')

@ -4,6 +4,7 @@ const inherits = require('util').inherits
const connect = require('react-redux').connect const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const { getSelectedAccount } = require('../../selectors') const { getSelectedAccount } = require('../../selectors')
const t = require('../../../i18n')
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {

@ -7,6 +7,7 @@ const actions = require('../../actions')
const AccountModalContainer = require('./account-modal-container') const AccountModalContainer = require('./account-modal-container')
const { getSelectedIdentity } = require('../../selectors') const { getSelectedIdentity } = require('../../selectors')
const ReadOnlyInput = require('../readonly-input') const ReadOnlyInput = require('../readonly-input')
const t = require('../../../i18n')
const copyToClipboard = require('copy-to-clipboard') const copyToClipboard = require('copy-to-clipboard')
function mapStateToProps (state) { function mapStateToProps (state) {

@ -4,6 +4,7 @@ const inherits = require('util').inherits
const connect = require('react-redux').connect const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const Identicon = require('../identicon') const Identicon = require('../identicon')
const t = require('../../../i18n')
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {

@ -6,6 +6,7 @@ const FadeModal = require('boron').FadeModal
const actions = require('../../actions') const actions = require('../../actions')
const isMobileView = require('../../../lib/is-mobile-view') const isMobileView = require('../../../lib/is-mobile-view')
const isPopupOrNotification = require('../../../../app/scripts/lib/is-popup-or-notification') const isPopupOrNotification = require('../../../../app/scripts/lib/is-popup-or-notification')
const t = require('../../../i18n')
// Modal Components // Modal Components
const BuyOptions = require('./buy-options-modal') const BuyOptions = require('./buy-options-modal')

@ -3,6 +3,7 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const { connect } = require('react-redux') const { connect } = require('react-redux')
const actions = require('../../actions') const actions = require('../../actions')
const t = require('../../../i18n')
class NewAccountModal extends Component { class NewAccountModal extends Component {
constructor (props) { constructor (props) {

@ -9,6 +9,7 @@ const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN const BN = ethUtil.BN
const hexToBn = require('../../../../app/scripts/lib/hex-to-bn') const hexToBn = require('../../../../app/scripts/lib/hex-to-bn')
const { conversionUtil } = require('../../conversion-util') const { conversionUtil } = require('../../conversion-util')
const t = require('../../../i18n')
const { MIN_GAS_PRICE_HEX } = require('../send/send-constants') const { MIN_GAS_PRICE_HEX } = require('../send/send-constants')

@ -9,6 +9,7 @@ const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN const BN = ethUtil.BN
const hexToBn = require('../../../../app/scripts/lib/hex-to-bn') const hexToBn = require('../../../../app/scripts/lib/hex-to-bn')
const { conversionUtil, addCurrencies } = require('../../conversion-util') const { conversionUtil, addCurrencies } = require('../../conversion-util')
const t = require('../../../i18n')
const { MIN_GAS_PRICE_HEX } = require('../send/send-constants') const { MIN_GAS_PRICE_HEX } = require('../send/send-constants')

@ -6,6 +6,7 @@ const tokenAbi = require('human-standard-token-abi')
const abiDecoder = require('abi-decoder') const abiDecoder = require('abi-decoder')
abiDecoder.addABI(tokenAbi) abiDecoder.addABI(tokenAbi)
const actions = require('../../actions') const actions = require('../../actions')
const t = require('../../../i18n')
const clone = require('clone') const clone = require('clone')
const Identicon = require('../identicon') const Identicon = require('../identicon')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')

@ -6,17 +6,11 @@ const h = require('react-hyperscript')
const Mascot = require('../components/mascot') const Mascot = require('../components/mascot')
const actions = require('../actions') const actions = require('../actions')
const Tooltip = require('../components/tooltip') const Tooltip = require('../components/tooltip')
const t = require('../../i18n')
const getCaretCoordinates = require('textarea-caret') const getCaretCoordinates = require('textarea-caret')
let isSubmitting = false let isSubmitting = false
let t = chrome.i18n.getMessage || (function() {
let msg = require('../../../app/_locales/en/messages.json');
return (function(key) {
return msg[key].message;
});
})();
module.exports = connect(mapStateToProps)(InitializeMenuScreen) module.exports = connect(mapStateToProps)(InitializeMenuScreen)
inherits(InitializeMenuScreen, Component) inherits(InitializeMenuScreen, Component)

@ -0,0 +1,18 @@
// cross-browser connection to extension i18n API
var getMessage;
if ((chrome && chrome.i18n && chrome.i18n.getMessage) ||
(browser && browser.i18n && browser.i18n.getMessage)) {
getMessage = (chrome || browser).i18n.getMessage;
} else {
// fallback function
console.warn('browser.i18n API not available?');
let msg = require('../app/_locales/en/messages.json');
getMessage = function(key) {
return msg[key].message;
});
}
module.exports = getMessage;
Loading…
Cancel
Save