Skip to content

Instantly share code, notes, and snippets.

@niclashoyer
Last active September 15, 2016 09:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niclashoyer/9881255 to your computer and use it in GitHub Desktop.
Save niclashoyer/9881255 to your computer and use it in GitHub Desktop.
L20n mixin for react.js (UNTESTED!)
###*
@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