Last active
September 15, 2016 09:05
-
-
Save niclashoyer/9881255 to your computer and use it in GitHub Desktop.
L20n mixin for react.js (UNTESTED!)
This file contains hidden or 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
###* | |
@jsx React.DOM | |
### | |
L20nMixin = | |
propTypes: | |
context: React.PropTypes.any.isRequired | |
getInitialState: -> | |
if @props.getLocalizedEntities? | |
ids = @props.getLocalizedEntities() | |
@props.context.localize ids, (l10n) => | |
@setState {l10n} | |
return | |
return | |
l10n: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment