Code Monkey home page Code Monkey logo

react-intl-phraseapp's Introduction

react-intl-phraseapp

Build Status

react-intl-phraseapp is an addon for react-intl that lets you connect localized react applications to the Phrase In-Context Editor.

Prerequisites

To use react-intl-phraseapp with your application you have to:

Demo

You can find a demo project on GitHub.

Installation

via NPM

npm install react-intl-phraseapp

Build from source

You can also build it directly from source to get the latest and greatest:

npm run dist

Development

npm install

Configure

let config = {
  projectId: '<YOUR_PROJECT_ID>',
  phraseEnabled: true,
  prefix: "[[__",
  suffix: "__]]",
  fullReparse: true
};

You can find the Project-ID in the Project overview in the PhraseApp Translation Center

JavaScript snippet

Add the following snippet to your react app.

import {initializePhraseAppEditor} from 'react-intl-phraseapp'

let config = {
  projectId: '<YOUR_PROJECT_ID>',
  phraseEnabled: true,
  prefix: "[[__",
  suffix: "__]]",
  fullReparse: true
};

initializePhraseAppEditor(config);

If this does not work for you, you can also integrate the JavaScript snippet manually.

Import from react-intl-phrasapp rather than from react-intl

Find all imports of FormattedMessage, FormattedHTMLMessage and change the source from react-intl to react-intl-phrasapp.

import {FormattedMessage} from 'react-intl-phraseapp'

Browser support

This library might not work out of the box for some older browser or IE11. We recommend to add Babel to the build pipeline if those browser need to be supported.

How does it work

The library inherits common components of the react-intl packages. In case you enabled Phrase by calling initializePhraseAppEditor the behaviour of the components will be changed.

Support

Question? Contact us at: phrase.com/contact

Issue? use GitHub issues and share the problem

Test

Run unit tests using jest:

npm test

react-intl-phraseapp's People

Contributors

thesoenke avatar dependabot[bot] avatar frsgit avatar timleers avatar simon2k avatar llimllib avatar iamjoshellis avatar docstun avatar kradl avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.