npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-intl-phraseapp

v4.2.0

Published

The In-Context-Editor for react using react-intl

Downloads

7,883

Readme

react-intl-phraseapp

Build status

react-intl-phraseapp is the official library for integrating Phrase Strings In-Context Editor with react-intl in your React application.

:scroll: Documentation

Prerequisites

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

Demo

You can find a demo project in the examples/demo folder, just run yarn && yarn start

Installation

via NPM

npm install react-intl-phraseapp

via Yarn

yarn add react-intl-phraseapp

Build from source

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

yarn dist

Development

# install deps
yarn install

Configure

Add the following JavaScript snippet to your react app.

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

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

initializePhraseAppEditor(config);

You can find the Project-ID in the Project overview in the PhraseApp Translation Center. You can find the Account-ID in the Organization page in the PhraseApp Translation Center.

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

To use the old version of ICE, use option useOldICE: true in your PHRASEAPP_CONFIG or integration options

let config = {
  projectId: '<YOUR_PROJECT_ID>',
  phraseEnabled: true,
  useOldICE: true,
};

initializePhraseAppEditor(config);

Using the US Datacenter with ICE

In addition to the settings in your config, set the US datacenter to enable it working with the US endpoints.

  datacenter: 'us',

Import from react-intl-phraseapp rather than from react-intl

Find all available imports for react-intl by changing the source from react-intl to react-intl-phraseapp, such as FormattedMessage, useIntl, WrappedComponentProps, and injectIntl.

import { FormattedMessage } from 'react-intl-phraseapp' import { useIntl, WrappedComponentProps } from 'react-intl-phraseapp' import { injectIntl, WrappedComponentProps } 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.

Test

Run unit tests using jest:

npm test

:white_check_mark: Commits & Pull Requests

We welcome anyone who wants to contribute to our codebase, so if you notice something, feel free to open a Pull Request! However, we ask that you please use the Conventional Commits specification for your commit messages and titles when opening a Pull Request.

Example: chore: Update README

:question: Issues, Questions, Support

Please use GitHub issues to share your problem, and we will do our best to answer any questions or to support you in finding a solution.

:memo: Changelog

Detailed changes for each release are documented in the changelog.