# @prezly/themes-intl-messages

> Translations for Prezly themes

Latest version **1.17.1** (published 2023-09-25) · GNU GPL v3 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @prezly/themes-intl-messages
pnpm add @prezly/themes-intl-messages
yarn add @prezly/themes-intl-messages
bun add @prezly/themes-intl-messages
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.17.1 |
| Published | 2023-09-25 |
| First published | 2021-11-23 |
| Weekly downloads | 0 |
| License | GNU GPL v3 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 14.x |
| Dependencies | 1 |
| Unpacked size | 438.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Prezly Team |
| Maintainers | mohammadxali, francis-prezly, pestaa, kudlik, digitalbase, e1npm, satoav, makanda |

## Links

- npm: https://www.npmjs.com/package/@prezly/themes-intl-messages
- Repository: https://github.com/prezly/themes-intl-messages
- Homepage: https://github.com/prezly/themes-intl-messages#readme
- Issues: https://github.com/prezly/themes-intl-messages/issues
- npm.io page: https://npm.io/package/@prezly/themes-intl-messages

## Dependencies (1)

- [@formatjs/intl](https://npm.io/package/@formatjs/intl.md) ^1.16.0

## Recent versions

- 1.17.1 (latest) — 2023-09-25
- 1.16.0-3 (preview) — 2023-04-24
- 1.17.0 — 2023-06-19
- 1.16.0 — 2023-04-24
- 1.16.0-2 — 2023-04-24
- 1.16.0-1 — 2023-04-24
- 1.16.0-0 — 2023-04-24
- 1.15.4 — 2023-03-22
- 1.15.3 — 2022-12-09
- 1.15.2 — 2022-10-17
- 1.15.1 — 2022-10-04
- 1.15.0 — 2022-08-03
- 1.14.0 — 2022-07-25
- 1.13.0 — 2022-06-22
- 1.12.0 — 2022-05-31
- … 25 more at https://npm.io/package/@prezly/themes-intl-messages/versions

## README

# Translations for Prezly Themes

![Version](https://img.shields.io/npm/v/@prezly/themes-intl-messages)
![License](https://img.shields.io/npm/l/@prezly/themes-intl-messages)
[![Crowdin](https://badges.crowdin.net/prezly-themes/localized.svg)](https://crowdin.com)

This repo is a supplementary package for Prezly themes that need multi-language support.
It has two main exports:
- Translation files in ICU synthax compiled to work seamlessly with [react-intl] library and Crowdin.
- Typed message descriptors to use in [react-intl] `FormattedMessage` components and `formatMessage` helpers.

## Getting started



### npm
```Shell
npm install react-intl @prezly/themes-intl-messages
```

### Usage in the application

1) Import the messages for your desired locale. `localeIsoCode` refers to a ISO hyphen-code. You can check which locale codes are supported in the [theme-kit-nextjs](https://github.com/prezly/theme-kit-nextjs/blob/main/src/intl/locale.ts#L10-L57) repo.
```ts
const messages = await import(`@prezly/themes-intl-messages/messages/${localeIsoCode}.json`);
```

2) Pass the messages to the `IntlProvider` wrapper component. It should be at the top of your component tree to work properly.
```tsx
<IntlProvider
    locale={localeIsoCode}
    defaultLocale="en"
    messages={messages}
>
  {/* Your application code */}
</IntlProvider>
```

3) Use the message descriptor to render the message in your component. Your IDE should give hints on the messages structure.
```tsx
import translations from '@prezly/themes-intl-messages';
import { FormattedMessage } from 'react-intl';

function Component() {
  return <FormattedMessage {...translations.actions.download} />
}

```

You can check an example on how to import messages in a Next.js theme in the [Prezly Bea Theme repo](https://github.com/prezly/theme-nextjs-bea/blob/main/utils/lang.ts).

### Message descriptors structure

- `actions` -> Labels for buttons or links that trigger a specific action
- `content` -> Mostly titles for various sections of a site that are related to the displayed content in some way
- `errors` -> Messages for error pages (404/500) and form validation errors
- `search` -> Messages related to the Search module
- `subscription` -> Messages related to the Subscription module
- `misc` -> Messages not suiting in any of the above categories

---

### Documentation on updating the translations (Prezly internal)
The process of adding new translations to Prezly Themes is described in the [Notion article](https://www.notion.so/prezly/Themes-Translations-i18n-4ae8aa613db146168623dfc65d9e8359)

----

Brought to you by [Prezly](https://www.prezly.com/?utm_source=github&utm_campaign=@prezly/themes-intl-messages).

[react-intl]: https://formatjs.io/docs/react-intl

---
_Source: https://npm.io/package/@prezly/themes-intl-messages · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
