Finding strings with invalid parameters

Re: Finding strings with invalid parameters

by Séverin Terrier -
Number of replies: 7

Hi German,

Here's what i just find now, with lot (but not all) of language files installed:

pt/taskchain.php:965:$string['sourcefilenotfound'] = 'Ficheiro de origem não encontrado (ou vazio): {$a';
gl/assign.php:171:$string['editsubmissionother'] = 'Editar entregas para {$a';
lv/assign.php:166:$string['gradeabovemaximum'] = 'Vērtējumam ir jābūt mazākam vai vienādam ar {$a).';
sk/choicegroup.php:126:<li><a href="{$a->linkgroups">spravovať skupiny kurzov</a></li>
sv_fi/grading.php:28:$string['activemethodinfonone'] = 'Ingen avancerad utvärderingsmetod är vald för området \'{$a->arUtvärdering med vitsord kommer att användas.';
ga/error.php:246:$string['groupunknown'] = 'Grúpa {$a{ gan bheith gaolmhar le cúrsa sainithe';
ga/question.php:359:$string['yourfileshoulddownload'] = 'Ba chóir go dtosódh do chomhad easpórtála ag íoslódail go gairid. "Mura dtarlaíonn sé, le do thoil <a href+”{$a”>cliceáil anseo</a>.';
ga/role.php:197:$string['inactiveformorethan'] = 'Neamhghníomhach le níos mó ná {$a->timeperiod)';
lt/assign.php:414:$string['submissioncopiedsmall'] = 'Jūs nukopijavote ankstesnės veiklos {$a->assignment) pateikimą';
lt/assign.php:415:$string['submissioncopiedtext'] = 'Jūs nukopijavote ankstesnės veiklos "{$a->assignment)" pateikimą
lt/calendar.php:101:$string['eventendtimewrapped'] = '{$a) (Pabaiga)';
lt/debug.php:45:$string['mustbeoveride'] = 'Abstraktusis {$a) metodas turi būti pakeistas.';
el/block_quickmail.php:51:$string['delete_confirm'] = 'Είστε σίγουροι για τη διαγραφή του μηνύματος με τις ακόλουθες λεπτομέρειες; {$a)';
de/tool_recyclebin.php:47:$string['eventitemdeleted_desc'] = 'Eintrag mit der ID {$a->objectid] gelöscht.';
da/error.php:155:$string['cannotupdaterecord'] = 'Kan ikke opdatere post-id {$a)';
ro/portfolio.php:167:$string['plugincouldnotpackage'] = 'Nu s-a putut realiza pachetul pentru exportul datelor dumneavoastră: eroarea originală a fost {$a';
zh_cn/mnet.php:88:$string['hostexists'] = '已有使用此主机名的主机记录(可以删除它)。<a href="{$a">点击这里</a>编辑此记录。';
ckb/backup.php:114:$string['error_block_for_module_not_found'] = 'ئۆرفان بلۆک بوونە ({id: {$a->bid) بۆ یەکەى کۆرس ({id: {$a->mid) دۆزرایەوە. ئەو بلۆکە نابێت بگەرێتەوە سەر';
ckb/backup.php:115:$string['error_course_module_not_found'] = 'کۆرسى مۆدل ئورفا دۆزرایەوە ({id: {$a) . ئەم مۆدلە پشتگیرى نەکراوە';
ckb/bulkusers.php:34:$string['confirmmessage'] = 'دلنیایى تۆ دەتەوێت ئەم پەیامەى سەرەوە بنێرى بۆئەم بەکارهێنەرانە؟{br />{$a>';
ckb/chat.php:69:$string['messageenter'] = '{$a تازە هاتە نێو ئەم چاتە';
ckb/chat.php:70:$string['messageexit'] = '{$a ئەم چاتەی جێهێشت';
km/assign.php:391:{$a->url';
is/plugin.php:42:$string['requiredby'] = 'Krafist af: {$a]';
he/quiz_overview.php:78:$string['studentingrouplong'] = '\'{$a-> coursestudent בקבוצה זאת';
he/workshopform_comments.php:28:$string['addmoredimensions'] = '{$a) אמות־מידה נוספות';
te/auth_mnet.php:38:$string['sso_mnet_login_refused'] = 'వినియోగదారు పేరు {$a->';
te/completion.php:38:$string['affectedactivities'] = 'ఈ మార్పులు క్రింది <b>{$a </b> కార్యకలాపాలు లేదా వనరులను ప్రభావితం చేస్తుంది:';
te/hvp.php:345:$string['welcomecommunity'] = 'మీరు H5P ను ఆనందిస్తారని మరియు మా పెరుగుతున్న సంఘంలో మా <a {$a->forums> ఫోరమ్స్ ద్వారా </a> నిమగ్నమవ్వాలని ఆశిస్తున్నాము.';
hu/assign.php:213:Megtekintheti a leadott munka mellett: {$a->url.';
pl/iassign.php:276:$string['import_file'] = 'Plik aktywności {$a lub skompresowany (zip):';
pl/moodle.php:1436:$string['numweek'] = '{$a{ tydzień';

Some lines don't include "$string[", these are strings defined on several lines, but they contain a problem too.

HTH,
Séverin

In reply to Séverin Terrier

Re: Finding strings with invalid parameters

by Séverin Terrier -

Hi,

And here's what i find today (on a Moodle 3.7 site), after installing and upgrading all language packs (by alphabetical order):

an/backup.php:208:$string['qcategory2coursefallback'] = 'La categoría de preguntas "{$a->name", orichinalment lo contexto de caegoría sistema/curso, serán creyadas en o contexto curso en estar restauradas.';
ckb/backup.php:114:$string['error_block_for_module_not_found'] = 'ئۆرفان بلۆک بوونە ({id: {$a->bid) بۆ یەکەى کۆرس ({id: {$a->mid) دۆزرایەوە. ئەو بلۆکە نابێت بگەرێتەوە سەر';
ckb/backup.php:115:$string['error_course_module_not_found'] = 'کۆرسى مۆدل ئورفا دۆزرایەوە ({id: {$a) . ئەم مۆدلە پشتگیرى نەکراوە';
ckb/bulkusers.php:34:$string['confirmmessage'] = 'دلنیایى تۆ دەتەوێت ئەم پەیامەى سەرەوە بنێرى بۆئەم بەکارهێنەرانە؟{br />{$a>';
ckb/chat.php:69:$string['messageenter'] = '{$a تازە هاتە نێو ئەم چاتە';
ckb/chat.php:70:$string['messageexit'] = '{$a ئەم چاتەی جێهێشت';
da/error.php:155:$string['cannotupdaterecord'] = 'Kan ikke opdatere post-id {$a)';
de/tool_recyclebin.php:47:$string['eventitemdeleted_desc'] = 'Eintrag mit der ID {$a->objectid] gelöscht.';
dz/role.php:265:$string['inactiveformorethan'] = '{$a->timeperiod ལས་ ལྷག་སྟེ་ ཤུགས་མེད།';
el/block_quickmail.php:51:$string['delete_confirm'] = 'Είστε σίγουροι για τη διαγραφή του μηνύματος με τις ακόλουθες λεπτομέρειες; {$a)';
el_wp/block_quickmail.php:50:$string['delete_confirm'] = 'Είστε σίγουροι για τη διαγραφή του μηνύματος με τις ακόλουθες λεπτομέρειες; {$a)';
es_mx/backup.php:278:$string['qcategory2coursefallback'] = 'La categoría de preguntas "{$a->name", originalmente dentro del contexto de categoría sistema/curso en el archivo de respaldo, será creada en el contexto de curso al ser restaurada.';
es_mx/offlinequiz.php:79:$string['cmmissing'] = 'Falta el módulo del curso para el examen fuera-de-línea con ID {$a';
ga/error.php:246:$string['groupunknown'] = 'Grúpa {$a{ gan bheith gaolmhar le cúrsa sainithe';
ga/question.php:359:$string['yourfileshoulddownload'] = 'Ba chóir go dtosódh do chomhad easpórtála ag íoslódail go gairid. "Mura dtarlaíonn sé, le do thoil <a href+”{$a”>cliceáil anseo</a>.';
ga/role.php:197:$string['inactiveformorethan'] = 'Neamhghníomhach le níos mó ná {$a->timeperiod)';
gl/assign.php:171:$string['editsubmissionother'] = 'Editar entregas para {$a';
he/quiz_overview.php:78:$string['studentingrouplong'] = '\'{$a-> coursestudent בקבוצה זאת';
he/workshopform_comments.php:28:$string['addmoredimensions'] = '{$a) אמות־מידה נוספות';
hu/assign.php:213:Megtekintheti a leadott munka mellett: {$a->url.';
is/plugin.php:42:$string['requiredby'] = 'Krafist af: {$a]';
km/assign.php:391:{$a->url';
lt/assign.php:414:$string['submissioncopiedsmall'] = 'Jūs nukopijavote ankstesnės veiklos {$a->assignment) pateikimą';
lt/assign.php:415:$string['submissioncopiedtext'] = 'Jūs nukopijavote ankstesnės veiklos "{$a->assignment)" pateikimą
lt/calendar.php:101:$string['eventendtimewrapped'] = '{$a) (Pabaiga)';
lt/debug.php:45:$string['mustbeoveride'] = 'Abstraktusis {$a) metodas turi būti pakeistas.';
lt_uni/debug.php:45:$string['mustbeoveride'] = 'Abstraktusis {$a) metodas turi būti pakeistas.';
lv/assign.php:166:$string['gradeabovemaximum'] = 'Vērtējumam ir jābūt mazākam vai vienādam ar {$a).';
no/capquiz.php:61:$string['level_stars'] = '{$a) Stjerner';
no/lightboxgallery.php:49:$string['displayinggallery'] = 'Viser album: {$a)';
no/qtype_ddimageortext.php:70:$string['summarisechoice'] = '{$a->no).{$a->text)';
pl/iassign.php:276:$string['import_file'] = 'Plik aktywności {$a lub skompresowany (zip):';
pl/moodle.php:1436:$string['numweek'] = '{$a{ tydzień';
pt/taskchain.php:965:$string['sourcefilenotfound'] = 'Ficheiro de origem não encontrado (ou vazio): {$a';
ro/portfolio.php:167:$string['plugincouldnotpackage'] = 'Nu s-a putut realiza pachetul pentru exportul datelor dumneavoastră: eroarea originală a fost {$a';
sk/choicegroup.php:126:<li><a href="{$a->linkgroups">spravovať skupiny kurzov</a></li>
sr_cr/oublog.php:187:* {$a->restrictposttext
sr_cr/oublog.php:190:* {$a->restrictblogtext
sr_lt/oublog.php:187:* {$a->restrictposttext
sr_lt/oublog.php:190:* {$a->restrictblogtext
sv_fi/grading.php:28:$string['activemethodinfonone'] = 'Ingen avancerad utvärderingsmetod är vald för området \'{$a->arUtvärdering med vitsord kommer att användas.';
te/auth_mnet.php:38:$string['sso_mnet_login_refused'] = 'వినియోగదారు పేరు {$a->';
te/completion.php:38:$string['affectedactivities'] = 'ఈ మార్పులు క్రింది <b>{$a </b> కార్యకలాపాలు లేదా వనరులను ప్రభావితం చేస్తుంది:';
te/hvp.php:345:$string['welcomecommunity'] = 'మీరు H5P ను ఆనందిస్తారని మరియు మా పెరుగుతున్న సంఘంలో మా <a {$a->forums> ఫోరమ్స్ ద్వారా </a> నిమగ్నమవ్వాలని ఆశిస్తున్నాము.';
zh_cn/mnet.php:88:$string['hostexists'] = '已有使用此主机名的主机记录(可以删除它)。<a href="{$a">点击这里</a>编辑此记录。';

If someone (or several people) is motivated to improve (all) these strings, it would be of help for the international community.

To generate this list, just go to the folder containing all installed language packs (moodledata/lang/) and launch this command:

grep -rne '{$a' . | grep -v '}' | sort | cut -c 3-

Perhaps someone better than me with bash commands/scripts can simplify or improve it...

And if you want to check all english strings (embedded with Moodle), just go to Moodle folder and launch this command:

for i in `find . -type f -name '*.php' | grep 'lang/en/'`; do grep -ne '{$a' $i | grep -v '}'; done

It should return nothing (and it's that) wink

Séverin

In reply to Séverin Terrier

Re: Finding strings with invalid parameters

by German Valero -
Picture of Language pack maintainers

Hi Séverin,

That is very useful information for many of us. I just fixed the 2 strings for my language pack (es_mx).

I think it would be very good if you (or someone else) can add the method to diagnose this problem in the Moodle documentation  at https://docs.moodle.org/dev/Translation_FAQ .

I am afraid I can not do more, as my School had just instructed me that I should not use working hours in moodle documentation, translation, testing, nor moodle forums sad

In reply to German Valero

Re: Finding strings with invalid parameters

by Séverin Terrier -

Hi German,

I really understand the difficulty you encouter, and feel it's a bad understanding of open source by our chiefs/responsible people.

They mainly use it because it's free (no paiment), but don't understand (or want) to contribute to the community. If i understand one could want to avoid paying, you can participate to the community by finding/declaring/fixing problems, documenting, communicating in your language (and international) community...

All things you (and i) do, and that helps for the needed work for your organisation.

I feel it's a bad decision from them, and hope you'll find a solution, and won't encouter to much frustration...

Séverin

In reply to Séverin Terrier

Re: Finding strings with invalid parameters

by koen roggemans -
Picture of Language pack maintainers

Thank you for that Severin.

It is to useful to leave it here in the code. I'll create 2 bugs: one for fixing the affected langauge pack and one for extending the amos check, which now checks for a few major problems like the separator strings from langconfig.php. 

In reply to koen roggemans

Re: Finding strings with invalid parameters

by koen roggemans -
Picture of Language pack maintainers
In reply to koen roggemans

Re: Finding strings with invalid parameters

by koen roggemans -
Picture of Language pack maintainers

All current broken strings are fixed (+ a few more things I've picked up along the way)


In reply to koen roggemans

Re: Finding strings with invalid parameters

by Séverin Terrier -

Hi Koen,

Thanks a lot for creating these tracker items, and making corrections smile

I really appreciate begining something, and having someone else do the following, perhaps knowing better what to do exactly, and how ; it's the power of a good community smile

Séverin