Aklapper updated the task description. (Show Details)

CHANGES TO TASK DESCRIPTION
https://translatewiki.net/ contains source and translated messages for many projects, including MediaWiki and many extensions.

The source messages often contain syntax that must be preserved in the translated message, per https://translatewiki.net/wiki/Localisation_guidelines; [[https://www.mediawiki.org/wiki/Help:Extension:Translate/Components#Message_checkers|checkers]] are designed to prevent mistakes.

Translators occasionally either omit or corrupt the syntax in the translation.

This task is to find and fix one translated message in a Wikimedia repository that has incorrect syntax.

== UI search ==

https://translatewiki.net/wiki/Special:SearchTranslations helps find messages searching either the source or the translation, optionally filtered by language and/or repository.

https://translatewiki.net/wiki/Special:Search can be used for [[https://www.mediawiki.org/wiki/Help:CirrusSearch|regex search]] and can [[https://translatewiki.net/w/i.php?title=Special%3ASearch&profile="" for MediaWiki messages]].

== Manual search ==

To find syntax errors in translated messages, fetch the repository containing the translations.
Then use tools to look for problems. The simplest tools to use are generic text search programs like `grep`, or <a windows equivalent?>.

For example, `git clone https://github.com/wikimedia/mediawiki`.
In the [[https://github.com/wikimedia/mediawiki/tree/master/languages/i18n | languages/i18n ]] read the `en.json` (English) and `qqq.json` (Description) files to learn about each message. Look for syntax which might become broken by a translator.

The variable syntax is `$1`, `$2`, etc. Sometimes translators add a space in the middle, like `$ 1`

```
$ git grep '\$ 1'
azb.json: "blockedtext": "' 'ایستیفاده<U+200C>چی آدی و یا آی پی عنوانینیز قاباغی باغلانیب دیر.'\n\nسیزی باغلایان$ 1. الیله اولوب دیر \nباغلاماق سببی:' $ 2.\n\n* باغلانمانین باشلانان زامانی: $ 8\n* باغلانمانین قورتولان زامانی: $ 6\n* باغلانما مدتی: $ 7\n\nگؤستریلن سببه گؤره ائنگئللئنمئنیزین اویغون اولمادیغینی دوشونورسونوزسه، $ 1 یا دا باشقا بیر [[{{MediaWiki:Grouppage-sysop}}|مدیر]] ایله بو وضعیتی گؤروشه بیلرسینیز. [[Special:Preferences|ترجیح لرینیز]] قیسمینده اعتبارلی بیر ائ-پوچت اونوانی گیرمئدیسئنیز \"ایستیفاده<U+200C>چییه ائ-پوچت گؤندر\" خصوصیتینی ایستیفاده ائده، ترجیهلرینیز ایمیل عنوانینیزی علاوه ایمیل گؤندرمک حقوقونا صاحب اولاجاقسینیز.\nبو آنکی باغلانما عنوانینیز $ 3، ائنگئللئنمئ نؤمره<U+200C>نیز # $ 5.\nبیر ایداره<U+200C>چی<U+200C>لر وضعیتینیز حاقیندا معلومات آلماق ایستدیگینیزده و یا هر هانسی بیر سورگودا بو معلومات<U+200C>لار لازیم اولا<U+200C>جاق، خاهیش ائدیریک نوت ائدین.",
azb.json: "autoblockedtext": "\n' 'ایستیفاده<U+200C>چی آدی و یا آی پی عنوانینیز قاباغی باغلانیب دیر.'\n\nسیزی باغلایان$ 1. الیله اولوب دیر \nباغلاماق سببی:' $ 2.\n\n* باغلانمانین باشلانان زامانی: $ 8\n* باغلانمانین قورتولان زامانی: $ 6\n* باغلانما مدتی: $ 7\n\nگؤستریلن سببه گؤره ائنگئللئنمئنیزین اویغون اولمادیغینی دوشونورسونوزسه، $ 1 یا دا باشقا بیر [[{{MediaWiki:Grouppage-sysop}}|مدیر]] ایله بو وضعیتی گؤروشه بیلرسینیز. [[Special:Preferences|ترجیح لرینیز]] قیسمینده اعتبارلی بیر ائ-پوچت اونوانی گیرمئدیسئنیز \"ایستیفاده<U+200C>چییه ائ-پوچت گؤندر\" خصوصیتینی ایستیفاده ائده، ترجیهلرینیز ایمیل عنوانینیزی علاوه ایمیل گؤندرمک حقوقونا صاحب اولاجاقسینیز.\nبو آنکی باغلانما عنوانینیز $ 3، ائنگئللئنمئ نؤمره<U+200C>نیز # $ 5.\nبیر ایداره<U+200C>چی<U+200C>لر وضعیتینیز حاقیندا معلومات آلماق ایستدیگینیزده و یا هر هانسی بیر سورگودا بو معلومات<U+200C>لار لازیم اولا<U+200C>جاق، خاهیش ائدیریک نوت ائدین.",
azb.json: "file-info-png-repeat": "$1 {{PLURAL:$ 1|دفعه| دفعه}} اویناتیلدی",
khw.json: "databaseerror-function": "فنکشن: $ 1",
khw.json: "databaseerror-error": "خرابی: $ 1",
luz.json: "copyright": "مطلب دومن $ 1 هس نکه خلاف هونو ذکر وابی.",
ses.json: "hiddencategories": "Moɲoo woo {{PLURAL:$1|dumi tugante$ 1}} no m'a may:",
sq.json: "databaseerror-query": "\nPyetje: $ 1",
sq.json: "no-null-revision": "I pamundur krijimi rishikimi i ri për faqen bosh \"$ 1\"",
sw.json: "apihelp-no-such-module": "Moduli \"$ 1\" haikupatikana.",
ur.json: "databaseerror-function": "فنکشن: $ 1",
ur.json: "databaseerror-error": "خرابی: $ 1",
```

Another approach is to look for keywords.

For example, the source English message "viewcount" is `"This page has been accessed {{PLURAL:$1|once|$1 times}}."`, which uses the [[ https://www.mediawiki.org/wiki/Help:Magic_words | PLURAL magic word]] which implements [[https://en.wikipedia.org/wiki/Grammatical_number|grammatical number]]. See also [[https://translatewiki.net/wiki/Plural|Plural]] on translatewiki.net.

Using grep we can see all of the translations that have omitted the "PLURAL quickly:
```lang=bash
$ cd languages/i18n
$ grep '"viewcount"' *.json | egrep -v '(qqq.json|PLURAL)'
cv.json: "viewcount": "Ку страницăна $1 хут пăхнă.",
ff.json: "viewcount": "Ngoo hello yillaama laabi $1.",
gan-hans.json: "viewcount": "个页拖人眵嘞$1回。",
gan-hant.json: "viewcount": "箇頁拕人眵哩$1回。",
gn.json: "viewcount": "Esta página ha sido visitada $1 veces.",
hak.json: "viewcount": "邇隻頁面已經分人瀏覽過$1次。",
kk-arab.json: "viewcount": "بۇل بەت $1 رەت قاتىنالعان.",
kk-latn.json: "viewcount": "Bul bet $1 ret qatınalğan.",
lzh.json: "viewcount": "此頁$1閱矣",
nan.json: "viewcount": "Chit ia̍h kàu taⁿ, hō͘ lâng khoàⁿ $1 pái.",
th.json: "viewcount": "มีการเข้าถึงหน้านี้ $1 ครั้ง",
to.json: "viewcount": "Naʻe laua he pēsí ni tuʻo $1.",
wuu.json: "viewcount": "箇頁望過$1垡。",
yue.json: "viewcount": "呢一頁已經有$1人次睇過。",
zh-hans.json: "viewcount": "本页面已经被访问过$1次。",
zh-hant.json: "viewcount": "此頁面已被檢視過 $1 次。",
```
Some of these languages may not have need to use PLURAL support for this message. See http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for the official list of plural rules for all languages.

== Unofficial language information ==

More information about each language can be found on the Wikipedia article about the language .

If Wikipedia doesn't have the answer, you might look for information about languages on the [[http://linguistics.stackexchange.com/ | Linguistics StackExchange]], such as [[http://linguistics.stackexchange.com/questions/16860/languages-without-plural-markings | this discussion about South-East Asian plurals]]. If you can't find an existing question on Linguistics StackExchange relating to your problem, you can ask a new question on Linguistics StackExchange.

== Examples ==
These are examples of this task being done:
* https://translatewiki.net/w/i.php?title=MediaWiki%3APagetitle-view-mainpage%2Fkri&type=revision&diff=7138660&oldid=3536925
* https://translatewiki.net/w/i.php?title=MediaWiki:Tagline/sat&diff=prev&oldid=7189500

list of tools that can help to find these problem:

http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/index.html#quality-assurance
https://github.com/willkg/dennis - PO files only
The source messages often contain syntax that must be preserved in the translated message, per [localisation guidelines](https://translatewiki.net/wiki/Localisation_guidelines); [checkers](https://www.mediawiki.org/wiki/Help:Extension:Translate/Components#Message_checkers) are designed to prevent mistakes.

Translators occasionally either omit or corrupt the syntax in the translation.

This task is to find and fix two translated messages in a Wikimedia repository that has incorrect syntax.

== UI search ==

* https://translatewiki.net/wiki/Special:SearchTranslations helps find messages searching either the source or the translation, optionally filtered by language and/or repository.
* https://translatewiki.net/wiki/Special:Search can be used for [regex](https://en.wikipedia.org/wiki/Regular_expression) search (via [MediaWiki's CirrusSearch extension](https://www.mediawiki.org/wiki/Help:CirrusSearch) and can [filter for MediaWiki messages](https://translatewiki.net/w/i.php?title=Special%3ASearch&profile="" for MediaWiki messages).
* https://codesearch.wmflabs.org/ by using some smart regexes. Examples:
** [[ https://codesearch.wmflabs.org/search/?q=%5C%7B%5C%7B%20*(GRAMMAR%7CGENDER%7CPLURAL)%20*%5B%5E%20%3A%5D&i=nope&files=i18n&repos= | `\{\{ *(GRAMMAR|GENDER|PLURAL) *[^ :]` ]]
** [[ https://codesearch.wmflabs.org/search/?q=%5C%7B%5C%7B%20*PLURAL%20*%3A%20*(%5B%5E%20%24%7D%5D%7C%5C%24%5B%5E0-9%5D%7C%5C%24%5B0-9%5D%2B%20*%5B%5E%20%7C0-9%5D)&i=nope&files=i18n&repos= | `\{\{ *PLURAL *: *([^ $}]|\$[^0-9]|\$[0-9]+ *[^ |0-9])` ]]
** [[ https://codesearch.wmflabs.org/search/?q=%5C%7B%5C%7B%20*GENDER%20*%3A%20*(%5B%5E%20%7B%7C%24%5D%7C%5C%24%5B%5E0-9%5D%7C%5C%24%5B0-9%5D%2B%20*%5B%5E%20%7C0-9%5D)&i=nope&files=i18n&repos= | `\{\{ *GENDER *: *([^ {|$]|\$[^0-9]|\$[0-9]+ *[^ |0-9])` ]]
** [[ https://codesearch.wmflabs.org/search/?q=%5C%7B%5C%7B%20*GRAMMAR%20*%3A%20*%5B%7C%24%5D&i=nope&files=i18n&repos= | `\{\{ *GRAMMAR *: *[|$]` ]]

== Manual search ==

To find syntax errors in translated messages, [`git clone`](https://www.mediawiki.org/wiki/Gerrit/Tutorial) the repository containing the translations.
Then use tools to look for problems. The simplest tools to use are generic text search programs like `grep`, or [a Windows equivalent](https://stackoverflow.com/questions/87350/what-are-good-grep-tools-for-windows/3478164).

For example, `git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git` (for an anonymous checkout).
In the [languages/i18n](https://phabricator.wikimedia.org/source/mediawiki/browse/master/languages/i18n), read the `en.json` (English) and `qqq.json` (Description) files to learn about each message. Look for syntax which might become broken by a translator.

The variable syntax is `$1`, `$2`, etc. Sometimes translators add a space in the middle, like `$ 1`

```
$ git grep '\$ 1'
azb.json: "blockedtext": "' 'ایستیفاده<U+200C>چی آدی و یا آی پی عنوانینیز قاباغی باغلانیب دیر.'\n\nسیزی باغلایان$ 1. الیله اولوب دیر \nباغلاماق سببی:' $ 2.\n\n* باغلانمانین باشلانان زامانی: $ 8\n* باغلانمانین قورتولان زامانی: $ 6\n* باغلانما مدتی: $ 7\n\nگؤستریلن سببه گؤره ائنگئللئنمئنیزین اویغون اولمادیغینی دوشونورسونوزسه، $ 1 یا دا باشقا بیر [[{{MediaWiki:Grouppage-sysop}}|مدیر]] ایله بو وضعیتی گؤروشه بیلرسینیز. [[Special:Preferences|ترجیح لرینیز]] قیسمینده اعتبارلی بیر ائ-پوچت اونوانی گیرمئدیسئنیز \"ایستیفاده<U+200C>چییه ائ-پوچت گؤندر\" خصوصیتینی ایستیفاده ائده، ترجیهلرینیز ایمیل عنوانینیزی علاوه ایمیل گؤندرمک حقوقونا صاحب اولاجاقسینیز.\nبو آنکی باغلانما عنوانینیز $ 3، ائنگئللئنمئ نؤمره<U+200C>نیز # $ 5.\nبیر ایداره<U+200C>چی<U+200C>لر وضعیتینیز حاقیندا معلومات آلماق ایستدیگینیزده و یا هر هانسی بیر سورگودا بو معلومات<U+200C>لار لازیم اولا<U+200C>جاق، خاهیش ائدیریک نوت ائدین.",
azb.json: "autoblockedtext": "\n' 'ایستیفاده<U+200C>چی آدی و یا آی پی عنوانینیز قاباغی باغلانیب دیر.'\n\nسیزی باغلایان$ 1. الیله اولوب دیر \nباغلاماق سببی:' $ 2.\n\n* باغلانمانین باشلانان زامانی: $ 8\n* باغلانمانین قورتولان زامانی: $ 6\n* باغلانما مدتی: $ 7\n\nگؤستریلن سببه گؤره ائنگئللئنمئنیزین اویغون اولمادیغینی دوشونورسونوزسه، $ 1 یا دا باشقا بیر [[{{MediaWiki:Grouppage-sysop}}|مدیر]] ایله بو وضعیتی گؤروشه بیلرسینیز. [[Special:Preferences|ترجیح لرینیز]] قیسمینده اعتبارلی بیر ائ-پوچت اونوانی گیرمئدیسئنیز \"ایستیفاده<U+200C>چییه ائ-پوچت گؤندر\" خصوصیتینی ایستیفاده ائده، ترجیهلرینیز ایمیل عنوانینیزی علاوه ایمیل گؤندرمک حقوقونا صاحب اولاجاقسینیز.\nبو آنکی باغلانما عنوانینیز $ 3، ائنگئللئنمئ نؤمره<U+200C>نیز # $ 5.\nبیر ایداره<U+200C>چی<U+200C>لر وضعیتینیز حاقیندا معلومات آلماق ایستدیگینیزده و یا هر هانسی بیر سورگودا بو معلومات<U+200C>لار لازیم اولا<U+200C>جاق، خاهیش ائدیریک نوت ائدین.",
azb.json: "file-info-png-repeat": "$1 {{PLURAL:$ 1|دفعه| دفعه}} اویناتیلدی",
khw.json: "databaseerror-function": "فنکشن: $ 1",
khw.json: "databaseerror-error": "خرابی: $ 1",
luz.json: "copyright": "مطلب دومن $ 1 هس نکه خلاف هونو ذکر وابی.",
ses.json: "hiddencategories": "Moɲoo woo {{PLURAL:$1|dumi tugante$ 1}} no m'a may:",
sq.json: "databaseerror-query": "\nPyetje: $ 1",
sq.json: "no-null-revision": "I pamundur krijimi rishikimi i ri për faqen bosh \"$ 1\"",
sw.json: "apihelp-no-such-module": "Moduli \"$ 1\" haikupatikana.",
ur.json: "databaseerror-function": "فنکشن: $ 1",
ur.json: "databaseerror-error": "خرابی: $ 1",
```

Another approach is to look for keywords.

For example, the source English message "viewcount" is `"This page has been accessed {{PLURAL:$1|once|$1 times}}."`, which uses the [PLURAL magic word](https://www.mediawiki.org/wiki/Help:Magic_words) which implements [grammatical number](https://en.wikipedia.org/wiki/Grammatical_number). See also [Plural](https://translatewiki.net/wiki/Plural).

Using `grep` we can see all of the translations that have omitted the `PLURAL` quickly:
```lang=bash
$ cd languages/i18n
$ grep '"viewcount"' *.json | egrep -v '(qqq.json|PLURAL)'
cv.json: "viewcount": "Ку страницăна $1 хут пăхнă.",
ff.json: "viewcount": "Ngoo hello yillaama laabi $1.",
gan-hans.json: "viewcount": "个页拖人眵嘞$1回。",
gan-hant.json: "viewcount": "箇頁拕人眵哩$1回。",
gn.json: "viewcount": "Esta página ha sido visitada $1 veces.",
hak.json: "viewcount": "邇隻頁面已經分人瀏覽過$1次。",
kk-arab.json: "viewcount": "بۇل بەت $1 رەت قاتىنالعان.",
kk-latn.json: "viewcount": "Bul bet $1 ret qatınalğan.",
lzh.json: "viewcount": "此頁$1閱矣",
nan.json: "viewcount": "Chit ia̍h kàu taⁿ, hō͘ lâng khoàⁿ $1 pái.",
th.json: "viewcount": "มีการเข้าถึงหน้านี้ $1 ครั้ง",
to.json: "viewcount": "Naʻe laua he pēsí ni tuʻo $1.",
wuu.json: "viewcount": "箇頁望過$1垡。",
yue.json: "viewcount": "呢一頁已經有$1人次睇過。",
zh-hans.json: "viewcount": "本页面已经被访问过$1次。",
zh-hant.json: "viewcount": "此頁面已被檢視過 $1 次。",
```
Some of these languages may not have need to use PLURAL support for this message. See http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for the official list of plural rules for all languages.

== Unofficial language information ==

More information about each language can be found on the Wikipedia article about the language.

If Wikipedia doesn't have the answer, you might look for information about languages on the [Linguistics StackExchange](https://linguistics.stackexchange.com), such as [this discussion about South-East Asian plurals](https://linguistics.stackexchange.com/questions/16860/languages-without-plural-markings). If you can't find an existing question on Linguistics StackExchange relating to your problem, you can ask a new question on Linguistics StackExchange.

== Examples ==
These are examples of this task being done:
* https://translatewiki.net/w/i.php?title=MediaWiki%3APagetitle-view-mainpage%2Fkri&type=revision&diff=7138660&oldid=3536925
* https://translatewiki.net/w/i.php?title=MediaWiki:Tagline/sat&diff=prev&oldid=7189500

List of tools that can help to find these problems:

* http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/index.html#quality-assurance
* https://github.com/willkg/dennis - PO files only

TASK DETAIL
https://phabricator.wikimedia.org/T148121

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Aklapper
Cc: Ebe123, matej_suchanek, Liuxinyu970226, MtDu, PratyyaGhosh, Xqt, pywikibot-bugs-list, Psychoslave, Nikerabbit, Nemo_bis, jayvdb, Aklapper, Wonnral, Bright1055, Baloch007, Toppole69, Mine0901, harikiran, Jayprakash12345, SacredWKnight, Beeyan, D3r1ck01, Srdjan_m, MuhammadShuaib, LNDDYL, Gryllida, Shizhao, Arrbee, KartikMistry, Jay8g
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to