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

@clerk/localizations

v2.2.0

Published

Localizations for the Clerk components

Downloads

125,009

Readme

@clerk/localizations

Chat on Discord Clerk documentation Follow on Twitter

Changelog · Report a Bug · Request a Feature · Ask a Question


⚠️ Important Notice:

Clerk officially maintains only the en-US (English - United States) locale. All other language translations provided within this package are community contributions.

Overview

Clerk offers the ability to override the strings for all of the elements in each of the Clerk Components. This allows you to provide localization for your users or change the wording to suit your brand.

@clerk/localizations contains localized strings for applications using Clerk. If you found a typo, inaccuracies, or want to contribute a new language, please submit a PR and follow the contributing guide.

Getting Started

Prerequisites

  • Clerk

Installation

npm install @clerk/localizations

Build

npm run build

Usage

@clerk/localizations contains predefined localizations you can use:

import React from 'react';
import { ClerkProvider } from '@clerk/clerk-react';
import { frFR } from '@clerk/localizations';

function App() {
  return (
    <ClerkProvider localization={frFR}>
      <div>Hello from clerk</div>
    </ClerkProvider>
  );
}

export default App;

You can also provide your own localization:

import React from 'react';
import { ClerkProvider } from '@clerk/clerk-react';

const localization = {
  socialButtonsBlockButton: 'Sign In with {{provider|titleize}}',
};

function App() {
  return (
    <ClerkProvider localization={localization}>
      <div>Hello from clerk</div>
    </ClerkProvider>
  );
}

export default App;

Support

You can get in touch with us in any of the following ways:

Contributing

We're open to all community contributions! If you'd like to contribute in any way, please read our contribution guidelines.

Adding a new localization key

  1. Open the types/src/localization.ts file to add a new key to the _LocalizationResource type.

    Naming things is hard, so try these things first: Has the component that should contain the new key already other localizations? If yes, see how they are named and if you could follow that pattern. For example, the <SignIn /> component has keys with signIn.start.title, then I'd make sense to follow the signIn. pattern. If you're not sure, take your best guess and the maintainers will comment on the PR!

    An exception to that are any errors that might be returned from the Frontend API. They need to go into the unstable__errors object inside each localization.

  2. Run npm build to compile types with your new key

  3. Open the localizations/src/en-US.ts file and add your new key to the object. en-US is the default language. If you feel comfortable adding your message in another language than English, feel free to also edit other files.

  4. Use the new localization key inside the component. There are two ways:

    • The string is inside a component like <Text>:

      - <Text>Role</Text>
      + <Text localizationKey={localizationKeys('formFieldLabel__role')} />
    • The string is used in a function call:

      + const { t } = useLocalizations();
      
      - card.setError('Some Error')
      + card.setError(t(localizationKeys('some_error')))

    You'll need to import localizationKeys and useLocalizations when using them.

Updating a localization key

  1. Open the localizations/src/en-US.ts file and search for the text you want to update.

  2. Update the text inside en-US. If possible, also update other languages.

Adding a new localization language

  1. Create a new file that follows the IETF language tag format

  2. Copy the contents of the en-US.ts file and translate all keys where necessary. Empty strings can stay empty. You don't need to translate things word by word, adjust where necessary as long as the same meaning is conveyed.

Security

@clerk/localizations follows good practices of security, but 100% security cannot be assured.

@clerk/localizations is provided "as is" without any warranty. Use at your own risk.

For more information and to report security issues, please refer to our security documentation.

License

This project is licensed under the MIT license.

See LICENSE for more information.