Country names are now translatable

Country names are now translatable

by Martin Dougiamas -
Number of replies: 3
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Country names are now translatable - there is a new file lang/xx/countries.php that replaces the old lib/countries.php.

Programmers can get a list of countries in the current language using get_list_of_countries() or a single country with get_string("AU", "countries").
Average of ratings: -
In reply to Martin Dougiamas

Re: Country names are now translatable

by kera mchugh -

so how does this apply to the following error in SCHEDULER

Fatal error: Call to undefined function: get_list_of_countries() in /home/opt-inst/public_html/elearn/mod/scheduler/view.php on line 429

i suspect i messed up somewhere along the line whilst trying to update the scheduler module... have retrieved the countries.php for EN, which i don't appear to have had previously... but so far no joy.

thanks for your help

In reply to kera mchugh

Re: Country names are now translatable

by kera mchugh -

decided to just comment out the line that looks for the country... that fixed it!

if someone can illuminate me on how that may adversely affect the functionality, i'd be happy to know in advance, but at this point i don't see it's necessity for our speficic purposes. (though, i 'spose if i could have seen the results, i may have a different opinion).

In reply to kera mchugh

Re: Country names are now translatable

by Rudy Scott -

As far as I can tell, the get_list_of_countries() function is used solely to retrieve information for the print_user() function (which I also had to remark out to get full compatbility with the stable release of  moodle).  It also appears that the fetching of the countries has been built into that function in newer moodle work so that call won't be required in the future anyway.

The only adverse effect of remarking out those two lines I can see is that there isn't a box with the a picture and information about the person who created the scheduler object at the top of the scheduler view.  This wasn't required functionality for me, so I also decided to remark it out. 

If it is desired for someone else, I think a little hacking in of current code from the weblib.php and moodlelib.php from the nightly build (namely print_user(..), fullname(..),get_list_of_countries(...)), and adding the countries.php to the lang directory would probably get it working. 

--Rudy