Errors when changing translations. No variable substitution.

Errors when changing translations. No variable substitution.

by Jens Jahnke -
Number of replies: 3

Hi,

I just tried to modify the german translation of moodle. I changed several words in the text and uploaded the files into moodledata/lang/de_local folder.

Afterwards the changes that I made are displayed correctly but every output that includes variables e.g. $a->firstname $a->lastname is no longer translated/working.

To stay with the above example: Instead of gettings "Joe Bob" I just get "$a->firstname $a->lastname". sad

Any ideas?

Regards,

Jens

Average of ratings: -
In reply to Jens Jahnke

Re: Errors when changing translations. No variable substitution.

by Jasmin Klindzic -
Picture of Testers Picture of Translators

Hello Jens,

isn't the new syntax {$a} - so maybe you just need a pair of brackets?

Average of ratings: Useful (3)
In reply to Jasmin Klindzic

Re: Errors when changing translations. No variable substitution.

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

As Jasmin points, from Moodle 2.0, the curly brackets are compulsory for value placeholders (they work for Moodle 1.x, too). Try

Hello {$a->firstname}, how are you?
Average of ratings: Useful (1)
In reply to David Mudrák

Re: Errors when changing translations. No variable substitution. (solved)

by Jens Jahnke -

Thanks for pointing out. I worked on the wrong language pack version (1.x while using moodle 2).