# Message Format support for localization

**URL:** https://meta.discourse.org/t/message-format-support-for-localization/7035
**Category:** Developer Guides
**Tags:** translation, reference
**Created:** [May 31, 2013, 1:17am UTC](https://meta.discourse.org/t/message-format-support-for-localization/7035 "2013-05-31T01:17:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [May 31, 2013, 1:17am UTC](https://meta.discourse.org/t/message-format-support-for-localization/7035/1 "2013-05-31T01:17:09Z")

</div>

## Guidelines for Translators

In Discourse all Message Format strings have a key that ends with “\_MF”. The Crowdin Editor has a preview that allows you to experiment with various values which is quite helpful for checking your translations.

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/7/b/a7b91176dd75dee0d8c8ffa79c59cc1c1c583e49.png)

**Important:** You need to modify the plural forms of your translation if your language uses forms other than “one” and “other”. You can add or remove forms within a `{ FOO, plural, ... }` block in order to make it work for your languages. The preview in the Crowdin Editor will show you a “Syntax error” in the preview when there’s a problem with your translation.

The available plural forms are:

- zero
- one
- two
- few
- many
- other (required — general plural form — also used for languages with no distinction between singular and plural forms)

Sometimes you might see an empty `=0 {}` block in an English source string which means that the variable can’t have a value of 0.

## Guidelines for Developers

Message Format strings are currently only available only for client-side translations. They are useful if your string contains more than one number or many variables which would lead to a high amount of permutations.

- The keys of Message Format strings need to end with “ **\_MF** ”

- Use the following format for **numbers** (`#` will be replaced with the number):

- Use the following format for **choices** :

- This is how you use it in JavaScript:

- 📢 **Recommendation:** If possible, use complex arguments as the outermost structure of a message, and write **full sentences** in their sub-messages. If you have nested select and plural arguments, place the **select** arguments (with their fixed sets of choices) on the **outside** and nest the plural arguments (hopefully at most one) inside. See [Formatting Messages | ICU Documentation](https://unicode-org.github.io/icu/userguide/format_parse/messages/)

- Make them **readable** – see existing examples in [client.en.yml](https://github.com/discourse/discourse/blob/main/config/locales/client.en.yml)

## Tools and further information

- [Online ICU Message Editor](https://format-message.github.io/icu-message-format-for-translators/editor.html) allows you to test a Message Format string in case there’s a problem with the Crowdin Editor. Please disable the “Parse simple xml/html tags” option, otherwise you might see an error message.

- [ICU Message Format for Translators](https://format-message.github.io/icu-message-format-for-translators/)

* * *

This document is version controlled - suggest changes [on github](https://github.com/discourse/discourse/blob/main/docs/developer-guides/docs/05-themes-components/27-message-format.md).
