JSPM

@freesewing/i18n

0.8.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 37
  • Score
    100M100P100Q89889F
  • License MIT

Translations for the freesewing project

Package Exports

  • @freesewing/i18n

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@freesewing/i18n) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Freesewing logo

 freesewing
a library for made-to-measure sewing patterns

Travis build Version License Code coverage Chat on Gitter Become a Patron

i18n

These are the translation files for the Freesewing project.

We currently provide translation in 5 languages:

  • English
  • German
  • Spanish
  • French
  • Dutch

Install

npm install --save @freesewing/i18n

How to use these translations

We use these translations in our website repository to translate react components with react-intl:

import { strings } from "@freesewing/i18n";
import { IntlProvider } from "react-intl";

class Base extends React.Component {
  render() {
    const { language } = this.props;

    return (
      <IntlProvider locale={language} messages={strings[language]}>
        {...children}
      </IntlProvier>
    )
  }
}

Now all components below will be able to translate messages:

import React from "react";
import { FormattedMessage } from "react-intl";

const Example = props => {
  return <p><FormattedMessage id={"app.aboutFreesewing"} /></p>
};

export default Example;

For all details, please refer to the react-intl documentation.

We also use it in our backend repository to translate the emails we send out to users.