
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
@discord/intl
Advanced tools
Client runtime for managing messages and translations in a React project.
@discord/intl
Redefined internationalization support, created by Discord to manage millions of messages across multiple projects, multiple programming languages, and multiple client platforms. discord-intl supports an expanded message format that combines ICU MessageFormat syntax with Markdown to make authoring rich, stylized messages as clear and concise as possible.
This project was born out of a need for more flexibility with our translations, a desire for granular ownership, and a need to refactor to keep up with modern versions of intl-messageformat
and others that power the system.
You most likely only need to know about how to use defineMessages
to write new strings and string modules. A message
definition file must have the extension .messages.js
, and must have a default export that calls defineMessages
inline, like this:
// Import the defineMessages magic function from the package.
import { defineMessages } from '@discord/intl';
/**
* Meta information about the strings contained in this file. Each string will
* be tagged with this information by default, and it will be sent along to
* translators to help provide context, categorization, and some special
* features like hiding "secret" strings that shouldn't be bundled until a
* specific release date.
*
* Future additions would be able to specify visual context for each string
* (e.g. a screenshot image where the string is used) and more.
*/
export const meta = {
project: 'custom-status',
secret: true,
translate: true,
};
/**
* Messages are "defined" by creating a default export with `defineMessages`.
* This function provides the typeguards for the shape of each message, and
* ensures a consistent format for the external tooling to rely on when finding
* all messages in the codebase.
*
* This _must_ be defined inline as a default export, and will be transformed
* by bundlers both in development and production builds.
*/
export default defineMessages({
HELLO_WORLD: {
defaultMessage: 'Hello, world!',
description: 'The standard greeting for new computers.',
},
});
This project is managed with the intl-cli
:
# Compile the TypeScript source to distributable JavaScript once
pnpm intl-cli runtime build
# For development, run in watch mode to compile changes on the fly
pnpm intl-cli rt watch
FAQs
Client runtime for managing messages and translations in a React project.
The npm package @discord/intl receives a total of 4,147 weekly downloads. As such, @discord/intl popularity was classified as popular.
We found that @discord/intl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.