## Using AMOS tool for language pack translation

### Variables missing curly brackets in various strings

Variables missing curly brackets in various strings

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

Re: Variables missing curly brackets in various strings

Thanks! I did the corrections for the german language pack.

Ralf

Re: Variables missing curly brackets in various strings

Well spotted Simon. Updated IT lang pack on all 2.x branches.

Re: Variables missing curly brackets in various strings

Thanks a lot Simon. Fixed in Dutch

Re: Variables missing curly brackets in various strings

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.

Re: Variables missing curly brackets in various strings

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:

{$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). Re: Variables missing curly brackets in various strings Correct. Moodle 2.0 contains these two bugs. They were fixed in MDL-27200 for 2.1 and higher. In your 2.0 language packs, you can fix the missing brackets if you prefer. Re: Variables missing curly brackets in various strings 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

Re: Variables missing curly brackets in various strings

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...

Re: Variables missing curly brackets in various strings

Just did the check for french, any 2.x version.

The english lang pack for 2.0 contains 2 strings with missing curly brackets around vars: