Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Andert martinandert

  • Germany
View GitHub Profile
@martinandert
martinandert / example.js
Created Sep 19, 2016
New react-translate-component API
View example.js
// 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" }} />
View controlled_input.js
"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 };
View translate
me@home ~ $ translate
Usage: translate SOURCE_LANG TARGET_LANG TEXT...
me@home ~ $ translate de en Bank
bank
bench
seat
pew
settle
form
You can’t perform that action at this time.