> ## Documentation Index
> Fetch the complete documentation index at: https://anki.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Core Interface

The `core` module in the [translation site](https://i18n.ankiweb.net/projects)
uses a translations system called [Fluent](https://projectfluent.org/). It is
a recently-developed system that makes it easier for translators to deal with
plurals, and makes it easier for developers to provide useful comments to help
with translation.

Translations in the `core` module are divided up into multiple files, with each file
focusing on a particular topic, such as scheduling, deck options, and so on, as
can be seen [here](https://i18n.ankiweb.net/en-GB/core/).

## Simple Replacements

<img src="https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/simple-replacement@2x.png?fit=max&auto=format&n=4yLyWj6_UVW-sSDI&q=85&s=f4bde5751893b10073ba1f0ab1d8a376" alt="A simple translation string" width="786" height="634" data-path="media/simple-replacement@2x.png" />

When the text is a simple string, all you need to do is write the text in your
native language and click Save (or press the Enter key).

Under the English text, many strings will contain a comment to help you understand
where the string is being used, or to give an example of how it appears.

"Context" is the short name for this string, and may sometimes give you a hint
as to where it is used or what it is trying to represent.

## Variables

<img src="https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/variable@2x.png?fit=max&auto=format&n=4yLyWj6_UVW-sSDI&q=85&s=40873be72944084aca4e395d1b1e7f63" alt="A translation string with a variable" width="780" height="634" data-path="media/variable@2x.png" />

When you see `{$something}` in the English text, it means that that text will
be replaced with something else. You can change the position of `{$something}`
in your translation, but please don't change the text inside - you should not
attempt to translate the text inside the `{...}` part. You can click on the
`{$something}` part of the English text to automatically copy it into your
translation.

## Plurals

Many languages change words depending on number. For example, English uses
"1 cat", but "3 cats".

Some of the strings to translate will look like this:

<img src="https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/simple-plurals@2x.png?fit=max&auto=format&n=4yLyWj6_UVW-sSDI&q=85&s=132b24a85da647a89b266fcb8a3e5b5f" alt="A translation string with plural forms" width="782" height="886" data-path="media/simple-plurals@2x.png" />

In the top part, you can see there are two forms for English - the `one`
case (second), and the `other` case (seconds).

The bottom section shows the translation in Polish, which has four different
plural forms. In this case, the `few` case and `many` case have been translated
with the same translation.

The translation website should automatically show the appropriate number
of boxes for your language. Languages like Japanese that do not have separate
plural forms will only need to enter in a translation once.

## Advanced Plurals

The translation website supports an advanced mode for when you need more
flexibility. You can access the advanced mode by clicking on the FTL icon
on the bottom left. The previous example then looks like this:

<img src="https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals@2x.png?fit=max&auto=format&n=4yLyWj6_UVW-sSDI&q=85&s=bb9468cb34087769880c43fe5bf939ea" alt="Editing translation strings with advanced plurals" width="782" height="892" data-path="media/advanced-plurals@2x.png" />

The first line is the unique identifier for this message - it can also be
seen in the "CONTEXT" label near the comments.

The rest of the text means the following:

* Check the value of amount
* If the amount is `one`, show `{$amount} sekunda`
* If the amount is `few`, show `{$amount} sekundy`
* If the amount is `many`, show `{$amount} sekund`
* If the amount is `other`, show `{$amount} sekundy`

The definitions of few, many and other depend on
[your language](https://unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html).

The `*` character before other means that any unknown value should
match `other`. Since in this example `few` is the same as `other`, the
text could thus be shortened to:

```
time-span-seconds = { $amount ->
  [one]   { $amount } sekunda
  [many]  { $amount } sekund
 *[other] { $amount } sekundy
 }
```

As `few` is not listed here, it will be covered in the `other` case.
It's generally best to list out all cases however, as otherwise the
translation website will shown a warning that you may have forgotten
to translate a case.

When writing these rules manually, please make sure to add at least one
space to the start of each line except the first.

While there was little benefit from rewriting the text in this case, this
flexibility becomes useful when your language doesn't fit well with the
structure of the original English string.

For example, when viewing cards in the Browse screen in Anki, Anki shows
new cards with a number, such as "New #1", or "New #532". The English
doesn't use plurals in this case, but other languages may need to.

If you were translating this into Spanish, you'd see the following screen:

<img src="https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals2@2x.png?fit=max&auto=format&n=4yLyWj6_UVW-sSDI&q=85&s=b4d1442a7945916af2b7281fa77b7a38" alt="Editing a translation string to add plurals" width="776" height="650" data-path="media/advanced-plurals2@2x.png" />

To add a plural form, click the FTL button, and then change the text
to read:

```
due-for-new-card = { $number ->
  [one]   Nueva #{ $number }
 *[other] Nuevas #{ $number }
 }
```

Here's another example. In this case the English text is using plurals
as well, but only a small part needs to change. When translating to Polish,
the "used by" portion needs to change as well. So the default editing
screen is not sufficient:

<img src="https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals3@2x.png?fit=max&auto=format&n=4yLyWj6_UVW-sSDI&q=85&s=29887a0b3541200cbc41331efbb945fb" alt="Another example of plural forms" width="774" height="902" data-path="media/advanced-plurals3@2x.png" />

To fix this, we click on the FTL button to get a blank template:

<img src="https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals4@2x.png?fit=max&auto=format&n=4yLyWj6_UVW-sSDI&q=85&s=653adad58b8d07c5dd5a13dbbfc8b727" alt="Template view of plural forms" width="776" height="912" data-path="media/advanced-plurals4@2x.png" />

And then modify the template as required:

<img src="https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals5@2x.png?fit=max&auto=format&n=4yLyWj6_UVW-sSDI&q=85&s=90a893f825ccb67e244ee0e8bc16eac5" alt="Modifying the template view of plural forms" width="782" height="908" data-path="media/advanced-plurals5@2x.png" />

## Other Languages

If you're not sure how something should be translated, you can click on the
Locales tab on the right. You can see a summary of the translation on that
screen, or click on a particular language to see how it has translated
all its plural forms.

## Special Characters

When a translated string is more than one line long, please keep an eye
out for lines that start with `.` or `[`. Strings can start with these characters
on the first line, but if a translation stretches over multiple lines, these
characters will cause problems.

For example, the following is fine:

```
some-translation =
  This is a translation that occurs
  over ... two
  or three lines.
```

But the following will cause problems, because the second line starts with a `[`,
and the third starts with a `.`:

```
some-translation =
  [This is a translation that occurs over
  ...two
  or three lines.]
```

When you need to use a `[` or `.` character at the start of a a line
in a multi-line string, please escape it by wrapping it in `{"` and
`"}` - for example:

```
some-translation =
  {"["}This is a translation that occurs over
  {"."}.. two
  or three lines.]
```

## Testing

Each time a new Anki beta is released, it will include any translation
changes that were made since the last time. Please give the betas a try,
so you can see how your translations appear in the app. There's a beta
testing section on the support site that you can follow for beta
updates.

When translating, please try to keep the translations about the same
length as the original English text. If it is not possible, and you find
that text is not appearing properly in a beta (such as two labels
overlapping), please report the issue on the support site.

When testing the betas, if you notice that some text is not
translatable, please report this on the support site so it can be fixed.
