Query to get languages Installed

Query to get languages Installed

by Edgar Conrado Hernandez -
Number of replies: 4

Hello 


I am looking for a query for MySql to get languages installed in Moodle, any advice?

Moodle Version 2.7


Regards

Average of ratings: -
In reply to Edgar Conrado Hernandez

Re: Query to get languages Installed

by Richard Oelmann -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Why use an SQL? You'll still need to upload the language files themselves.

There's a perfectly good tool in the front end for adding language packs to your moodle site

In reply to Edgar Conrado Hernandez

Re: Query to get languages Installed

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Edgar,

You don't need to use MySQL for this. Moodle has an API specifically for this purpose.

     $langs = get_string_manager()->get_list_of_translations();

You'll find an example of this in the lang_menu() function found in moodle/lib/outputrenderers.php file.

Best regards,

     Michael Milette

Average of ratings: Useful (3)