Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions developer_manual/basics/translations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,32 @@ JS Example:
/* BEST: Simple string with undefined plural not using any number in the string */
t('myapp', 'Import calendars')

.. important::
General rule: Whenever a variable with varying values (numbers) is part of a string, the plural form must be used.

There are languages with multi-plural forms. See https://en.wikipedia.org/wiki/Plural#Use_in_systems_of_grammatical_number

Example

.. code-block:: php

"Vault will be locked in %1$d seconds"

This means that even though the value ‘seconds’ is always greater than 1, translators on Transifex are unable to produce valid translations in the plural form for some languages.

Bad: Only one string provided

.. code-block:: php

"Vault will be locked in %1$d seconds"

Good: Two strings in source code.

.. code-block:: php

"Vault will be locked in %1$d second"
"Vault will be locked in %1$d seconds"

.. _improving-translations:

Improving your translations
Expand Down
Loading