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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@preply/ds-i18n

v14.3.1

Published

Readme

@preply/ds-i18n

Contains the translations for the Design System.

Usage

Just get json from locales folder and merge it with host translations.

import dsMessages from '@preply/ds-i18n/locales/en.json';

const translations = {
  ...hostMessages,
  ...dsMessages,
};

<IntlProvider locale="en" messages={translations}>
  <App />
</IntlProvider>;

Usage (inside design-system repo)

Packages

For packages like @preply/ds-web-lib, we need to setup one of these tools:

Example for vite and babel-plugin-formatjs:

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

import { getPrefixedId } from '@preply/ds-i18n';

export default defineConfig({
  plugins: [
    react({
      babel: {
        plugins: ['formatjs'],
      },
    }),
  ],
  ...
});

Apps

In general, just wrapping the app with IntlProvider is enough.

<IntlProvider locale="en">
  <App />
</IntlProvider>

Also, check storybook implementation for more complex example to display actual translations in different locales.

Translation flow

  1. Use react-intl in your code
import { FormattedMessage } from 'react-intl';

const DEFAULT_REQUIRED_LABEL = (
  <FormattedMessage
    id="preply-ds.fieldLabel.required"
    defaultMessage="Required"
    description="Form field required label"
  />
);

Please prefix all your ids with preply-ds. to avoid collisions with host translations.

New strings will be automatically extracted and pushed to the design-system.json source file in preply-web-product Crowdin project.

  1. Request translations

See Localization at Preply for more details

  1. New translations will be pulled automatically

Pull Translations workflow will pull the translations from the Crowdin daily at 6:00 AM UTC. If there are any new translations, a PR will be created automatically.

Scripts

Note: In general, you're not supposed to run these scripts manually, they're run by the CI pipeline.

trans:extract

Extracts the translations from the source code into temporary tmp/design-system.json file.

This file contains additional context for the translators.

Example of a tmp/design-system.json file:

{
  "preply-ds.fieldLabel.required": {
    "defaultMessage": "Required",
    "description": "Form field required label"
  }
}

trans:push

Pushes the translations to the Crowdin.

trans:pull

Pulls the translations from the Crowdin into temporary tmp/crowdin folder.

Example of fetched translations:

{
  "preply-ds.fieldLabel.required": {
    "defaultMessage": "Required",
    "description": "Form field required label"
  }
}

trans:compile

Compiles the translations into simple key-value pairs in the locales folder.

Example of compiled translations:

{
  "preply-ds.fieldLabel.required": "Required"
}