Skip to content

Instantly share code, notes, and snippets.

View martinandert's full-sized avatar

Martin Andert martinandert

View GitHub Profile
@martinandert
martinandert / example.js
Created September 19, 2016 06:32
New react-translate-component API
// Before:
// All interpolations are provided directly as props.
<Translate content="greeting" firstName="Peter" />
// After:
// Interpolations are provided via the new `with` prop.
<Translate content="greeting" with={{ firstName: "Peter" }} />
"use strict";
var ControlledInput = (function() {
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
return React.createClass({
displayName: "ControlledInput",
getInitialState: function getInitialState() {
return { value: this.props.value };
@martinandert
martinandert / translate
Last active August 29, 2015 14:23
Translator
me@home ~ $ translate
Usage: translate SOURCE_LANG TARGET_LANG TEXT...
me@home ~ $ translate de en Bank
bank
bench
seat
pew
settle
form