I append new file to lang pack but have an error

I append new file to lang pack but have an error

by Mohammad Mahmoudiyeh -
Number of replies: 8

I will change system calender for my website ( from gregorian to Jalali system that is Persian calender).

For this work I have a  new files in lang pack 
but I have Error   "  Invalid get_string() identifier: 'month6' or component File's Name

 this file has a line " $string['month6'] = sharivar ; "

When i run "Language customization" , this file's name not show in components box.
where is problem?
help me please.

Average of ratings: -
In reply to Mohammad Mahmoudiyeh

Re: I append new file to lang pack but have an error

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

the sting should be written like this...

$string['month6'] = 'sharivar' ;

you missed off the apostrophes from the word you added...see the highlighted sections below...

$string['month6'] = 'sharivar' ;

Mary

In reply to Mary Evans

Re: I append new file to lang pack but have an error

by Mohammad Mahmoudiyeh -

Thanks Mary,
The string  has the apostrophes, but exist Error.

I think in moodle 2   identifies of string ( here "'month6'") unknown for database, therefore create bugs.but this file be good in moodle 1.9.X.
there is a question When i run "Language customization" , this file ( It's  called "calender_system_jalaly.php"  ) not show in components box.

In reply to Mohammad Mahmoudiyeh

Re: I append new file to lang pack but have an error

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Mohammad,

I do not see any language file containing the string

$string['month6']

in any version of Moodle. In fact I do not understand what you are trying to do. Can you please explain which moodle language file you are trying to modify?

Joseph

In reply to Joseph Rézeau

Re: I append new file to lang pack but have an error

by Mohammad Mahmoudiyeh -

Hi Joseph,

Tanks for your attention. you're right. It's new.

I want to add new string in language file. when I added it and I did 'check out string into the translator' that I couldn't see my new string and it didn't add into db(mdl_report_customlang).

whenever I set 'Debugging message' to 'Developer'(at

  • Site administration -> Development -> Debugging

How can I do it? Plz help me.

In reply to Mohammad Mahmoudiyeh

Re: I append new file to lang pack but have an error

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
Firstly, please note I do not know what exactly you are trying to achieve but modifying standard Moodle lang files may not be the best way to go. Anyway, after you modify the PHP string files, you have to purge all caches via admin screens to force Moodle to regenerate the on-disk caches to take the new string into account. Only during Moodle upgrades, the caches are purged automatically.
Average of ratings: Useful (1)
In reply to David Mudrák

Re: I append new file to lang pack but have an error

by Mohammad Mahmoudiyeh -

Hi david,

I want to modify PHP string files or create new PHP string files.

I can't understand your mean about "purge all caches via admin screens" and "during moodle upgrades".

at least Plz help me how can I do it?

In reply to Mohammad Mahmoudiyeh

Re: I append new file to lang pack but have an error

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Mohammad,

To Purge all cache you need to go to Settings > Site Administration > Development > Purge all caches

Also, but I am not sure if this will work in this situation...go to Languages > Language packs and then 'update' all your current languages this should update the strings you added. But like I said I don't know if this is relevent in your case.

Also the language caches are in the Moodledate folders on your server, I have found that Purge caches does not always clear these caches so you might like to clear them manually.  ..server../moodledata/cache/lang/

I use custom $strings quite a bit when designing themes, but I add all mine to the theme's lang/en/theme_themename.php which works well for me.

Hope this helps?

Mary

In reply to Mohammad Mahmoudiyeh

Re: I append new file to lang pack but have an error

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators

The calender strings are pulled out of your operating system. Please check the FAQ

Average of ratings: Useful (3)