Update docs.en.md

This commit is contained in:
aalpatkina 2019-10-10 16:53:47 +03:00 committed by GitHub
parent ae19ae012d
commit c755786e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,10 @@ visible: true
* [What do plural forms mean?](#plurals)
* [Where can you learn about the number of plural forms?](#where-to-learn)
* [Plurals in AdGuard translations](#translations)
* [Strings with `singular`, `dual`, `plural` keys](#1type)
* [Plural word forms separated by commas](#2type)
* [Crowdin supported patterns](#3type)
* [Strings with templates](#4type)
* [Short summary](#summary)
<a name="intro"></a>
@ -18,25 +22,25 @@ visible: true
It is no secret, that there are a lot of differences between the worlds languages. One of these differences is the use of plural forms that can cause huge difficulties when it comes to localization issue.
While grammar rule of a language can state the existence of only singular and plural numbers, there can be a great variety of plural forms of words. That is why we strongly recommend you to properly read this article and to learn more about plural forms in different languages and about how they are being used in AdGuard translations.
We strongly recommend you to properly read this article to learn more about plural forms and about how they are being used in AdGuard translations.
<a name="plurals"></a>
## What do plural forms mean?
In different languages, there can be multiple forms of words depending on certain numbers that qualify them. As you might have already guessed, we will talk about the nouns.
Nouns in different languages can have several plural word forms. Their use depends on the specific number that goes before the word to indicate the number of items expressed by the word.
In English, for example, you can notice the change of a word ending when speaking about the same subject in different numbers, like *'one star'* or *'two stars'*. It doesnt matter if you say five, twenty-six or even five hundred thirty-two stars the ending 's' will remain. And it happens because the English words have only two plural forms for the singular number and for the plural one.
For instance, the English words have two word forms when speaking about something in different numbers, like *'one star'* or *'two stars'*. It doesnt matter if you say five, twenty-six or even five hundred thirty-two stars the ending 's' will remain the same. And it happens because the English nouns have only two plural forms for the singular number and for the plural one.
But some languages can have only one or, conversely, many more forms of a particular word.
But some languages can contain only one or, conversely, many more plural forms.
The Polish language in contrast to English has three plural forms of words. One of them is used when speaking about something in the Singular, another form is used in the Plural but with numbers ending in 2-4,excluding 12-14, and the third form for words in the Plural determined by other numbers.
In contrast to English the Polish language has three plural forms of nouns. One of them is used when speaking about something in the Singular, another form is used in the Plural but with numbers ending in 2-4, excluding 12-14, and the third form for words with other numbers in front of them.
Lets have a look at this picture. Here you can see the groups of numerals which determine a word form when standing before it.
Lets have a look at this picture. Here you can see the groups of numerals which determine a word form when standing in front of it.
![](Polish.png)
You can find such examples with numerals which define plural forms of words in your language [here](https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals).
>Find other examples [here](https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals).
Lets draw a small parallel between English and Polish for better understanding:
@ -48,100 +52,142 @@ Lets draw a small parallel between English and Polish for better understandin
Now it is clear that the Polish *'godzinę'* (hour) has three different forms, whereas the English word changes its form with given numbers only twice.
There are a lot of other languages that have three plural forms too, such as Russian, Serbian, Slovak, Czech etc. But not all of them can obey the same rule. As an example is the Romanian language that in contrast to Polish has various plural forms of words defined by the following numbers:
![](Romanian.png)
Among the worlds languages there are ones with four, five and even six plural forms (like Arabic).
Except for Polish, there are a lot of other languages that have three plural forms and more, such as Russian, Serbian, Slovak, Czech etc. But not all of them obey the same rule. That's why it is so important to know how many plural forms your language contains and how you can apply them.
<a name="where-to-learn"></a>
## Where can you learn about the number of plural forms?
When you are faced with a translation that requires the use of plurals, you may not be able to realize right away how many word forms one or another language includes. Fortunately, there are enough sources of information nowadays and some of them are listed below.
When you are faced with a translation that requires the use of plurals, you may not be able to realize right away how many word forms one or another language provides. Fortunately, there are a lot of sources of information and some of them are listed below.
First of all, we would like to advise you to refer to the information of Mozillas [Localizations and Plurals](https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals) article. There you will find different plural form rules that contain different numbers of forms and show what languages are involved. One of this articles advantages is the opportunity to see what specific numbers define plural forms in different languages.
First of all, we would like to advise you to refer to the information of Mozillas [Localizations and Plurals](https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals) article. There you will find different plural form rules and the languages that obey these rules.
But despite this article is (or at least supposed to be) quite informative and comprehensible, it doesnt contain the whole list of worlds languages. Thats why we also advise you to turn to the [Localization Guide](http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html), where the wider list of languages is represented, but in another manner. The number of plural forms for different languages is identified here with 'nplurals=2', 'nplurals=4' and so on. The numeral after the Equals sign '=' means the number of plural forms of the respective language. Besides, here you can see different formulas which can help you identify what form to use in each particular case.
But despite this article is (or at least supposed to be) quite informative and comprehensible, it doesnt contain the whole list of worlds languages. Thats why we also advise you to turn to the [Localization Guide](http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html), where the wider list of languages is represented, but in another manner. The number of plural forms for different languages is shown this way: 'nplurals=2', 'nplurals=4' and so on. The numeral after the Equals sign '=' means the number of plural forms of the respective language. Besides, here you can see different formulas which can help you identify what form to use in each particular case.
Also, you can get information about plural forms in the [Unicode Common Locale Data Repository](http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#rules)(CLDR). The CLDR Plural Rules indicate an additional word form for decimal numbers (1, 5; 2,3; 100,1…) and as a result of which some languages are supposed to have more plural forms. However, we dont use decimal numbers in AdGuard translations yet.
Also, you can get information about plural forms in the [Unicode Common Locale Data Repository](http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#rules)(CLDR). The CLDR Plural Rules indicate an additional word form for decimal numbers (1,5; 2,3; 100,1…) but we dont use them in AdGuard translations.
<a name="translations"></a>
## Plurals in AdGuard translations
First of all, you need to understand, that not every AdGuard translation involves the use of different plural forms.
First of all, you need to understand, that not every AdGuard translation requires the use of plural forms.
To identify phrases which translations require the use of plural forms you should pay your attention to the presence of a vertical bar sign between the sentences and **%count%** placeholders in original phrases.
Currently, we have 4 types of strings on Crowdin that involve the use of plurals.
![](sign%26placeholders.png)
Let's take a closer look at them.
Besides, almost all such strings have a yellow note above them which аttracts your attention to the proper use of plural forms.
<a name="1type"></a>
#### 1. **Phrases with string keys ending in `.singular`, `.dual`, `.plural`**
Now, lets imagine — you are faced with such phrase: **"Standard license for %count% computer|Standard license for %count% computers"**.
![crowdin](https://cdn.adguard.com/public/Adguard/kb/en/plurals/dual_it.png)
What should you know in order to translate it correctly?
Most of them are in the `AdGuard for Windows` project and consist of only one or two words:
The first thing you should understand is that the sentences which are divided by a vertical bar sign are called **'templates'** because they serve as templates for phrases with different numbers. The templates count usually starts with '0'.
- `days;`
- `extensions;`
- `hours`
Please pay attention to the string keys when you meet such phrases on Crowdin and to the "context" field where you can see some important notes about plurals.
<a name="2type"></a>
#### 2. **Strings with singular and plural nouns separated by commas**
This kind of strings is mostly concentrated in the `AdGuard for Android` project.
Please look at the example:
![crowdin](https://cdn.adguard.com/public/Adguard/kb/en/plurals/android_fr.png)
If there are 3 plural forms of nouns in your language (like in Polish), please write all plural forms separated by commas.
`hour, hours --> godzinę, godziny, godzin`
In case a noun has only 2 forms, there is no need to write the same form twice (*typically only for this type of strings with plurals!*). However, it won't be a mistake if you repeat the form twice.
<a name="3type"></a>
#### 3. **Strings that use the Crowdin-developed pattern**
This is the most user-friendly scheme of translating strings with plurals.
Crowdin suggests users to translate the certain amount of phrases with different plural forms.
If your language provides only one plural form, then you will see only one phrase to translate. If you have three forms, Crowdin will provide you with the string divided into other two or three strings to translate.
For example:
![crowdin](https://cdn.adguard.com/public/Adguard/kb/en/plurals/crowdin_scheme.png)
Please be attentive when translating these strings and approving them. If you have no idea what the "Other" field means, then just paste the same form as it is in the "Many" field. The "Many" and "Other" fields' contents can be the same.
<a name="4type"></a>
#### 4. **Strings with templates separated by the vertical bar sign**
This is the most complicated type of AdGuard strings which is mostly used in `AdGuard Websites` project (namely in `"adguard.com"` folder).
To identify phrases which translations require the use of plural forms you should pay your close attention to the presence of a vertical bar sign between the sentences and **%count%** placeholders in original phrases.
![crowdin](https://cdn.adguard.com/public/Adguard/kb/en/plurals/plurals_site.png)
Now, lets imagine — you are faced with such phrase: *"Standard license for %count% computer|Standard license for %count% computers"*.
What should you know to translate it correctly?
Let's call sentences which are divided by a vertical bar sign the ***"templates"***, because actually they serve as templates for phrases with different numbers.
Coming back to the example, as the English language includes only two plural forms, there should be two templates respectively:
**Template 0** Standard license for *%count%* computer
**Template 1** Standard license for *%count%* computers
`**Standard license for *%count%* computer|Standard license for *%count%* computers**`
where **Template 1** is Standard license for *%count%* computer,
and **Template 2** is Standard license for *%count%* computers
Another important thing you should pay your attention to is **%count%** placeholders that, as usual, take place before the words they define. Instead of **%count%** here will appear different numbers depending on which templates are being chosen.
How does it work during localization process?
For the English language, in this case, the following rule will function:
If **%count%** of computers is 1 use **'Template 0'**;
If **%count%** of computers is more than 1 (5, 13 or 1149) use **'Template 1'**
In a situation with another language that has, lets say, three plural forms, there should be three templates with two vertical bar signs between them.
For example, we would like to translate this phrase ("Standard license for *%count%* computer|Standard license for *%count%* computers") into Slovak, that according to the rule of [Localizations and Plurals](https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals) article has three different forms of words to use with following numbers:
For example, we would like to translate the above mentioned phrase into Slovak, that according to the rule of [Localizations and Plurals](https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals) article has three plural forms of words to use with following numbers:
![](Slovak.png)
Then the translation from English into Slovak should be:
- Štandartná licencia pre *%count%* počítač|Štandartná licencia pre *%count%* počítače|Štandartná licencia pre *%count%* počítačov
`**Štandartná licencia pre *%count%* počítač|Štandartná licencia pre *%count%* počítače|Štandartná licencia pre *%count%* počítačov**`
In this case, we see three templates which contain three plural forms of the word *'počítač'* (computer) in Slovak.
In this case, we see three templates which contain three plural forms of the word *"počítač"* (computer) in Slovak.
And again, this rule will function during localization proces:
**If we ignore one of the forms and use only two templates for Slovak instead of three, the system wont be able to take an appropriate template for certain numbers** and, as a result, we will have grammar mistakes in sentences, like in English: *Standard license for 5 computer*.
If **%count%** of computers is 1 use **'Template 0'** Štandartná licencia pre *%count%* počítač;
If **%count%** of computers is more than 1 but less than 5 (2, 3 or 4) use **'Template 1'** Štandartná licencia pre *%count%* počítače;
If **%count%** of computers is 5 or more than 5 use **'Template 2'** Štandartná licencia pre *%count%* počítačov.
If we ignore one of the forms and use only two templates for Slovak instead of three, the system wont be able to take an appropriate template for certain numbers and, as a result, we will have grammatical mistakes in sentences, like in English "I have five star".
But in some languages there can be words (lets call them exclusions) that have fewer plural forms than the common rule of language states words should have. And that can cause some confusion.
But in some languages there can be words (lets call them exclusions) that have fewer plural forms than the language itself. And that can cause some confusion.
The Serbian word *'računar'* (computer), for example, has only two forms: *'računar'* - for 1, 21, 31 (and other numbers ending in 1, excluding 11) computers and *'računara'* - for other numbers of computers. But in spite of this fact, there should be three templates in AdGuard translations according to the general rule (which states that there are three plural forms of words in Serbian):
![](Serbian.png)
Thus, the translation from English ("Standard license for *%count%* computer|Standard license for *%count%* computers") into Serbian in this case should be:
Thus, the translation from English into Serbian should be:
- Standardna licenca za *%count%* računar|Standardna licenca za *%count%* računara|Standardna licenca za *%count%* računara
`**Standardna licenca za *%count%* računar|Standardna licenca za *%count%* računara|Standardna licenca za *%count%* računara**`
Although it is obvious that the last two templates have no differences, it is very important to keep the rule: ***The number of templates should reflect the number of plural forms of the respective language!***
Although it is obvious that the last two templates have no differences, it is very important to keep the rule: ***The number of templates should reflect the number of plural forms of the respective language!*** (typically for this type of strings with plurals).
<a name="summary"></a>
## Short summary
## Short summary
When translating AdGuard projects pay your close attention to the original phrases with two important elements: the vertical bar sign(s) and **%count%** placeholders. Also, do not ignore the yellow textboxes (notes) above the original phrases.
When translating AdGuard projects pay your close attention to phrases which require the use of plural forms.
Before translating such strings, please refer to the plural rule of a language into which you translate and remember:
While first three types of such strings are less or more easy to perform, the fourth type demands more vigilance.
+ The number of your templates should be consistent with the number of plural forms of words in a certain language, even in cases when some words have fewer forms themselves 2 plural forms of words in a language 2 templates in translations; 5 plural forms 5 templates etc.;
And again: if you meet an original phrase with two important elements: **the vertical bar sign** and **%count%** placeholders, please do the following:
+ Do not forget to use a vertical bar sign between templates without any space before and after it;
+ Refer to the plural rule of a language you translate into;
+ Keep the exact number of templates;
>The number of your templates should be consistent with the number of plural forms your language includes, even in cases some words have fewer forms themselves. Two plural forms two templates in translations; five plural forms five templates, etc.
+ Do not forget to use a vertical bar sign between templates without any space before and after it (as an exception is strings whose original phrases contain spaces);
+ Do not translate, fill in or delete **%count%** placeholders.
By using these simple rules you will help AdGuard developers avoid a lot of unnecessary complications during the localization process. Thank you!
Using these simple rules you will help AdGuard developers avoid a lot of unnecessary complications during the localization process. Thank you!