How to use react-message-source - 3 common examples

To help you get started, we’ve selected a few react-message-source examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github netceteragroup / react-message-source / example / src / Greeting.js View on Github external
const { getMessage } = props;
  return <p>{getMessage('world')}</p>;
}

function LocalizedLabelWithNamedParamsComponent(props) {
  const { getMessageWithNamedParams } = props;
  return <p>{getMessageWithNamedParams('greeting.with.name', { name: 'John Doe' })}</p>
}

LocalizedLabelComponent.propTypes = propTypes;
PrefixedLocalizedLabelComponent.propTypes = propTypes;
LocalizedLabelWithNamedParamsComponent.propTypes = propTypes;

export const LocalizedLabel = withMessages(LocalizedLabelComponent);
export const LocalizedLabelCurried = withMessages()(LocalizedLabelComponent);
export const PrefixedLocalizedLabel = withMessages('hello')(PrefixedLocalizedLabelComponent);
export const LocalizedLabelWithNamedParams = withMessages(LocalizedLabelWithNamedParamsComponent);
github netceteragroup / react-message-source / example / src / Greeting.js View on Github external
return <p>{getMessage('world')}</p>;
}

function LocalizedLabelWithNamedParamsComponent(props) {
  const { getMessageWithNamedParams } = props;
  return <p>{getMessageWithNamedParams('greeting.with.name', { name: 'John Doe' })}</p>
}

LocalizedLabelComponent.propTypes = propTypes;
PrefixedLocalizedLabelComponent.propTypes = propTypes;
LocalizedLabelWithNamedParamsComponent.propTypes = propTypes;

export const LocalizedLabel = withMessages(LocalizedLabelComponent);
export const LocalizedLabelCurried = withMessages()(LocalizedLabelComponent);
export const PrefixedLocalizedLabel = withMessages('hello')(PrefixedLocalizedLabelComponent);
export const LocalizedLabelWithNamedParams = withMessages(LocalizedLabelWithNamedParamsComponent);
github netceteragroup / react-message-source / example / src / Greeting.js View on Github external
function PrefixedLocalizedLabelComponent(props) {
  const { getMessage } = props;
  return <p>{getMessage('world')}</p>;
}

function LocalizedLabelWithNamedParamsComponent(props) {
  const { getMessageWithNamedParams } = props;
  return <p>{getMessageWithNamedParams('greeting.with.name', { name: 'John Doe' })}</p>
}

LocalizedLabelComponent.propTypes = propTypes;
PrefixedLocalizedLabelComponent.propTypes = propTypes;
LocalizedLabelWithNamedParamsComponent.propTypes = propTypes;

export const LocalizedLabel = withMessages(LocalizedLabelComponent);
export const LocalizedLabelCurried = withMessages()(LocalizedLabelComponent);
export const PrefixedLocalizedLabel = withMessages('hello')(PrefixedLocalizedLabelComponent);
export const LocalizedLabelWithNamedParams = withMessages(LocalizedLabelWithNamedParamsComponent);

react-message-source

A library which aids with i18n of React applications

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular react-message-source functions