Редактирование: Plural Form(s) in Translation(s)
Материал из Wiki.crossplatform.ru
Внимание: Вы не представились системе. Ваш IP-адрес будет записан в историю изменений этой страницы.
Правка может быть отменена. Пожалуйста, просмотрите сравнение версий, чтобы убедиться, что это именно те изменения, которые вас интересуют, и нажмите «Записать страницу», чтобы изменения вступили в силу.
Текущая версия | Ваш текст | ||
Строка 8: | Строка 8: | ||
- | === | + | ===What's the Problem with Plural Forms?=== |
+ | |||
+ | You have most probably seen programs that use the same string forsingular and plural, using parentheses to combine the singular andthe plural forms into one string (e.g., "6 occurrence(s)replaced"). | ||
- | |||
[[Image:qq19-linguist1.png|center]] | [[Image:qq19-linguist1.png|center]] | ||
- | + | Natually, it would be preferable to show "6 occurrences replaced"with an 's', and "1 occurrence replaced" with no 's'. Somedevelopers solve this problem through code that looks like this: | |
<source lang="cpp-qt"> | <source lang="cpp-qt"> | ||
tr("%1 item%2 replaced").arg(count) | tr("%1 item%2 replaced").arg(count) | ||
Строка 47: | Строка 48: | ||
|- | |- | ||
- | ! | + | !English |
- | ! | + | !French |
- | ! | + | !Polish |
- | + | ||
|- | |- | ||
|0 house'''s''' | |0 house'''s''' | ||
|0 maison | |0 maison | ||
|0 dom'''уw''' | |0 dom'''уw''' | ||
- | |||
|- | |- | ||
|1 house | |1 house | ||
|1 maison | |1 maison | ||
|1 dom | |1 dom | ||
- | |||
|- | |- | ||
|2 houses | |2 houses | ||
|2 maisons | |2 maisons | ||
|2 dom'''y''' | |2 dom'''y''' | ||
- | |||
|- | |- | ||
|3 houses | |3 houses | ||
|3 maisons | |3 maisons | ||
|3 dom'''y''' | |3 dom'''y''' | ||
- | |||
|- | |- | ||
|4 houses | |4 houses | ||
|4 maisons | |4 maisons | ||
|4 dom'''y''' | |4 dom'''y''' | ||
- | |||
|- | |- | ||
|5 houses | |5 houses | ||
|5 maisons | |5 maisons | ||
|5 domуw | |5 domуw | ||
- | |||
|- | |- | ||
|21 houses | |21 houses | ||
|21 maisons | |21 maisons | ||
|21 domуw | |21 domуw | ||
- | |||
|- | |- | ||
|22 houses | |22 houses | ||
|22 maisons | |22 maisons | ||
|22 dom'''y''' | |22 dom'''y''' | ||
- | |||
|- | |- | ||
|24 houses | |24 houses | ||
|24 maisons | |24 maisons | ||
|24 dom'''y''' | |24 dom'''y''' | ||
- | |||
|- | |- | ||
|30 houses | |30 houses | ||
|30 maisons | |30 maisons | ||
|30 domуw | |30 domуw | ||
- | |||
|} | |} | ||
Other languages have other rules: | Other languages have other rules: | ||
Строка 114: | Строка 104: | ||
This is just a partial list, but it clearly shows the complexity ofthe problem. | This is just a partial list, but it clearly shows the complexity ofthe problem. | ||
<div id="howdoesqt42addressthisproblem"></div> | <div id="howdoesqt42addressthisproblem"></div> | ||
- | |||
===How Does Qt 4.2 Address This Problem?=== | ===How Does Qt 4.2 Address This Problem?=== | ||
Строка 141: | Строка 130: | ||
|- | |- | ||
!Language | !Language | ||
- | ! | + | !Form 1 |
- | ! | + | !Form 2 |
- | ! | + | !Form 3 |
|- | |- | ||
|English | |English |