Variables missing curly brackets in various strings

Variables missing curly brackets in various strings

על ידי Simon Coggins בתאריך
מספר תגובות: 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

בתגובה ל: Simon Coggins

Re: Variables missing curly brackets in various strings

על ידי 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.

בתגובה ל: David Mudrák

Re: Variables missing curly brackets in various strings

על ידי 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).

בתגובה ל: David Mudrák

Re: Variables missing curly brackets in various strings

על ידי 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

בתגובה ל: German Valero

Re: Variables missing curly brackets in various strings

על ידי 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...

בתגובה ל: German Valero

Re: Variables missing curly brackets in various strings

על ידי Nicolas Martignoni בתאריך
תמונה של Language pack maintainers

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:

  • gradeforstudent (core_grades)
  • hexanotallowed (qtype_calculated)

Nicolas