Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Allow translation outside of React #172

Open
lhorie opened this issue Oct 9, 2018 · 0 comments
Open

Allow translation outside of React #172

lhorie opened this issue Oct 9, 2018 · 0 comments

Comments

@lhorie
Copy link
Contributor

lhorie commented Oct 9, 2018

Type of issue

feature

Description

Some internal Uber stakeholders rely on the ability to translate files from Redux actions. Currently there's no clean way to access the translation API from there.

Current behavior

Currently one needs to do something like this:

class Foo extends React.Component {
  doStuff() {
    this.props.doStuff(this.props.translate('foo'));
  }
  render() {
    return <button onClick={this.doStuff}>Click me</button>
  }
}
export default compose(
  withTranslations(['foo']),
  // ... other stuff
)(Foo)

Expected behavior

Some way to provide translations to actions without having to refactor all the components in an app

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant