Languages

Language customization in 2.0

 
 
Picture of Joseph Rézeau
Language customization in 2.0
Group DevelopersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Hello,

Has anyone tried customizing a language in moodle 2.0 recently? Just tried to customize English today, using Moodle 2.0 (Build: 20101201).

When clicking on the Check out strings into translator button, nothing happens (well, the hard disk runs like mad) and after 3 minutes I get this error message:

Fatal error: Maximum execution time of 180 seconds exceeded in [moodle20]\lib\dml\mysqli_native_moodle_database.php on line 841

I have not found a report in the bug tracker but will report if people can report same problem in this forum.

Joseph

 
Average of ratings: -
Picture of Helen Foster
Re: Language customization in 2.0
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Joseph,

I've just tried the Check out strings into translator button on the QA Testing site and found everything working fine.

Hopefully David will notice this thread soon and suggest a diagnosis!

 
Average of ratings: -
Picture of David Mudrák
Re: Language customization in 2.0
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Translators

Hi Joseph,

when you press the checkout button, Moodle will search for all strings from the core and all plugins and will copy them to the database. The translation tool then works with the strings in the database and the customized strings can be then written back to the files in the local language folders.

The initial checkout when there are no strings registered yet in the database may take a longer time. Later checkouts are usually shorter as only the new and modified strings are updated.

At all sites I tested the new tool at, the initial checkout took reasonable amount of time - up to twenty seconds or so. At your machine, the script was not able to finish the complete checkout within the maximum execution time defined in your php.ini. The fact it took so long at your machine may indicate that your database performance is not very good and you should consider some performance tweaking. Sure, there could be a progress bar or something to indicate what is going on. And the script could even try to detect the upcoming maximum execution time deadline.

Anyway, please try to just re-run the checkout several times. If you have access to your database, try to get the count of already checked-out strings using

SELECT COUNT(*) FROM mdl_report_customlang;

You should see the increasing number of records after each run of the checkout and you need to reach almost 16000 records before the translation tool can be launched.

HTH

 
Average of ratings:Useful (3)
Picture of Joseph Rézeau
Re: Language customization in 2.0
Group DevelopersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Hi David,

I finally persisted and re-launched the Checkout strings into translator a few more times and after I think a total of 15 minutes (5 x 180 seconds max. execution time) I got all of the strings into the database!

There definitely ought to be a progress bar on that page plus maybe a warning telling users to try again ... and again if they get a timeout.

Thanks too for your suggestion to improve my mysql database performance. Since this is only a local test site on my computer I'd never bothered much about performance, but I have read with interest the Performance doc at http://docs.moodle.org/en/Performance

Unfortunately the performance script at moodle/admin/dbperformance.php does not work in Moodle 2.0; it needs re-writing.

Joseph

 
Average of ratings:Useful (1)
Picture of Doi Tran
Re: Language customization in 2.0
 

Yes, customize your system will solve this problem. I increase my memory limit for PHP. Referene: http://docs.moodle.org/20/en/Performance

 
Average of ratings:Useful (1)
Ali
Re: Language customization in 2.0
 

Hi everyone,

I'm facing a similar problem. The situation is the following. I'll be grateful for any help.

I setup Moodle 2.0 on my personal pc via "Moodle Windows Installer" and each time I try to translate the strings in 2.0 doing the following steps I get a blank page at the end.

 1- Language customization

 2- Choose the language. I get the following link:

 http://localhost/admin/report/customlang/index.php?section=reportcustomlang&lng=ar

 3- I click on Check out strings into translator

I get the following link but the page is blank and there is no strings to chheck.

http://localhost/admin/report/customlang/index.php

 Could anybody help to solve this problem. What could be wrong? I tried this with several browsers (I.E, Google Chrome, Firefox, and Safari) but no success.

Is it my PC or what?!

I would highly appreciate it if anybody could help with this so I will be able to continue translating moodle 2.0

 
Average of ratings: -
Picture of Joseph Rézeau
Re: Language customization in 2.0
Group DevelopersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Please go to admin and set debug mode on (PHP errors) and try again. Are you getting the timeout error message I mentioned in my original post?

Joseph

 
Average of ratings: -
Ali
Re: Language customization in 2.0
 

Thank Joseph. I am not getting anything except a blank page and in the status bar Done.

I'll try to follow what you suggested and update you.
cheers.

Ali

 
Average of ratings: -
Ali
Re: Language customization in 2.0
 

Hi Joseph,

The following is what I got:

Fatal error: Maximum execution time of 60 seconds exceeded in E:\Moodle\MoodleWindowsInstaller-latest\server\moodle\lib\dml\mysqli_native_moodle_database.php on line 841

 
Average of ratings: -
Picture of David Mudrák
Re: Language customization in 2.0
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Translators
Yes, the same issue as Joseph reported. Your maximum execution limit is not enough for Moodle to checkout all strings into the database. You can either increase the limit in php.ini or re-run the checkout as many times as needed to finish the job.

I shall come with a patch that would prevent throwing this error.
 
Average of ratings:Useful (2)
Ali
Re: Language customization in 2.0
 

Thanks it worked after taking so long time.

 
Average of ratings: -
Ali
Re: Language customization in 2.0
 

Hi David,

There is another error that needs your final magic touch.

After translating the strings I clicked save and continue. then I got the following screesn:

Language customization

عربي (ar)

There are 12 modified strings. You must check in them into disk to store them permanently.

There are two buttons: One says (

Check out strings into translator) the other (Check in strings into disk)

If you the first is clicked it goes back to the strings page.

If the second one is clicked it gives the following message:

(Coding error detected, it must be fixed by a programmer: Incorrect file location E:\Moodle\MoodleWindowsInstaller-latest\server\moodledata/lang/ar_local)

 

This same message appears if you click the button (Save and check in strings into file)

I created a folder and named "ar_local" moodle automatically deletes it.

 
Average of ratings: -
Picture of David Mudrák
Re: Language customization in 2.0
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Translators
Hi Ali,

please turn Debugging mode on and let me know the stack info and all other messages that appear when you try to check-in the customized strings.

During the check-in, the lang/xx_local/ is removed and repopulated from the database, normally.
 
Average of ratings: -
Picture of David Mudrák
Re: Language customization in 2.0
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Translators

Hi Ali,

this "coding error detected" problem was fixed yesterday - see MDL-25588 for details.

 
Average of ratings: -
Picture of Joseph Rézeau
Re: Language customization in 2.0
Group DevelopersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Hi David,

Still no patch to fix this "max execution time" problem?

Joseph

 
Average of ratings: -
Picture of David Mudrák
Re: Language customization in 2.0
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Translators
Sorry Joseph, no, this has not been fixed yet. Just try to load the strings into the translator several times and hopefully they will get there. As usually for all bugs that have known work-around, this did not have top priority on my TODO.txt list.
 
Average of ratings:Useful (1)
Picture of David Mudrák
Re: Language customization in 2.0
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Translators
Please note that a patch that fixes this has been just accepted by the integration team and it should appear in the next weekly build. See MDL-27293 for details.
 
Average of ratings:Useful (2)