added language pack and screen went blank

added language pack and screen went blank

by Dave Maloney -
Number of replies: 5

I wanted to a new language for a particular course so I could edit some End of Lesson page text without affecting those same pages as used in other courses.

I thought I was following some instructions provided in another forum properly. I made a copy of the lang/en/en_utf8 folder. I renamed the copy lang/en/USPAPUpdate_utf8.

I checked my Admin/languages and saw that the new language was installed.

I went to the particular course and selected the replacement language USPAPUpdatge_utf8.

BUT - When I clicked on SAVE my screen went blank.

I cannot view the course now, so I cannot reset the language to the original en_utf8.

My other courses are working fine, but they are set to en_utf8.

But the one course set to USPAPUpdate_utf8 shows only a blank, white screen.

Any ideas of how to repair this?

Average of ratings: -
In reply to Dave Maloney

Re: added language pack and screen went blank

by Dave Maloney -

As a followup to the above goof:

I renamed USPAPUpdate_utf8 xxUSPAPUpdate_uxxtf8 on the server.

That caused the Course to appear, but with the course Language setting "Force language" now set to "Do not force." So, I assume it is now defaulting to en_utf8.

So, I suppose my question now is:  Are the steps I can follow properly to set up a new language so I can edit some of the lines in lesson.php that effect the End of Lesson page?

In reply to Dave Maloney

Re: added language pack and screen went blank

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
You don't need an entire copy of a language pack. You just need langconfig.php and in your case lesson.php. In langconfig.php you set parentlanguage to en.

Check first if that works without any changes to lesson.php. I advise you to use the moodle build in language pack editor to make the changes.
Average of ratings: Useful (1)
In reply to Dave Maloney

Re: added language pack and screen went blank

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
Hi Dave,

as Koen says - do not create a copy of the English lang pack.
  1. create the directory lang/en/USPAPUpdate_utf8 and copy langconfig.php to it
  2. set the parent language in langconfig.php to en_utf8
  3. the language should appear now in the menus
  4. copy lesson.php, remove all $string[] definitions but those you want to amend
This should help.

Your problem with blank screen is that that the copied pack produced an fatal error and your server is set not to show error messages. Enable Debugging mode if you can to view the error message.

Hope this helps
In reply to David Mudrák

Re: added language pack and screen went blank

by Dave Maloney -

Thanks, it worked! However, I noticed my langconfig.php file did not have a parentlanguage string, so I did not know how to change it to en_utf8 since the string was not there in the first place. I searched the Moodle docs a bit and found an added instruction and that was that I had to ADD the string myself. So, I added

$string['parentlanguage'] = 'en_utf8';

to langfoncif.php and all works well now.

Also, rather than removing all the string definitions other than the ones I wanted to ament, I commented-out (using the PHP comment-out codes /* and */ ) the ones I wanted left alone in case I want to return and amend them at a later date.

Thanks!

-Dave