Variables missing curly brackets in various strings

Variables missing curly brackets in various strings

by Simon Coggins -
Number of replies: 10

I was doing some automated checking of our language packs and I noticed there are quite a few strings that have variable references which don't have the curly brackets in the right place - i.e. $a instead of {$a}.

This was a fresh 2.2 install with various lang packs installed via moodle.org. The attached file contains all the files/strings that have errors (87 strings in total).

The command I used to find them was:

grep -Ri '$a[^-}]\|[^{]$a' *

It might be worth running this on all language packs as I only had 13 packs installed.

Simon

In reply to Simon Coggins

Re: Variables missing curly brackets in various strings

by David Mudrák -
Language pack maintainers బొమ్మ

Very useful hint! Note that a similar regex can be used in AMOS translator's filter directly, too. Just select a single version, select all standard components and in the "substring" field, type

\$a[^-}]|[^{]\$a

and check the "regex" checkbox.

In reply to David Mudrák

Re: Variables missing curly brackets in various strings

by German Valero -
Language pack maintainers బొమ్మ

Thanks for a very useful hint .

But the two strings I found in the 2.0 branch seem to be wrong in the original english language:

2.0 [gradeforstudent,core_grades]

{$a->student}<br />{$a->item}$a->feedback
 
2.0 [hexanotallowed,qtype_calculated]
Dataset <strong>{$a->name}</strong> hexadecimal format value $a->value is not allowed

Does it mean that David Mudrák might have to have those strings updated? or did I just misinterpreted the syntax spelling (I am just a veterinarian, not an engeneer).

In reply to David Mudrák

Re: Variables missing curly brackets in various strings

by German Valero -
Language pack maintainers బొమ్మ

Hi,

I just did an "AMOS translator's filter directly, too. Just selected a single version (2.6), selected all standard components and in the "substring" field, typed

\$a[^-}]|[^{]\$a

and check the "regex" checkbox."

 

... and found a few missing curly brackets in my language pack విచారం

Would the other translators kindly see if they also have missing curly brackets ?

TIA

In reply to German Valero

Re: Variables missing curly brackets in various strings

by koen roggemans -
Language pack maintainers బొమ్మ

Thanks for this - I found one in Dutch: editverbose,core_grades, which was originally wrong in English and I marked it as up to date after it was fixed - probably didn't notice the change...

Seems like a good thing to check before a release or so...