mirror of
https://github.com/moodle/moodle.git
synced 2025-03-09 02:10:00 +01:00
This patch reimplements the internal cache that was used to store the list of available translations in Moodle 1.x. By default, the method get_list_of_translations() still uses the file moodledata/cache/languages to store the list of available translations. The location of that file can be redefined in config.php. The internal format of the cache file is JSON now (used to be a plain text list). The patch also fixes a usage of the global $CFG in translation_exists() methods where the internal property should be used instead.
26 lines
1.9 KiB
PHP
26 lines
1.9 KiB
PHP
<?php
|
|
|
|
// This file defines settingpages and externalpages under the "appearance" category
|
|
|
|
if ($hassiteconfig) {
|
|
|
|
// "languageandlocation" settingpage
|
|
$temp = new admin_settingpage('langsettings', get_string('languagesettings', 'admin'));
|
|
$temp->add(new admin_setting_configcheckbox('autolang', get_string('autolang', 'admin'), get_string('configautolang', 'admin'), 1));
|
|
$temp->add(new admin_setting_configselect('lang', get_string('lang', 'admin'), get_string('configlang', 'admin'), current_language(), get_string_manager()->get_list_of_translations())); // $CFG->lang might be set in installer already, default en is in setup.php
|
|
$temp->add(new admin_setting_configcheckbox('langmenu', get_string('langmenu', 'admin'), get_string('configlangmenu', 'admin'), 1));
|
|
$temp->add(new admin_setting_langlist());
|
|
$temp->add(new admin_setting_configcheckbox('langcache', get_string('langcache', 'admin'), get_string('langcache_desc', 'admin'), 1));
|
|
$temp->add(new admin_setting_configcheckbox('langstringcache', get_string('langstringcache', 'admin'), get_string('configlangstringcache', 'admin'), 1));
|
|
$temp->add(new admin_setting_configtext('locale', get_string('localetext', 'admin'), get_string('configlocale', 'admin'), '', PARAM_FILE));
|
|
$temp->add(new admin_setting_configselect('latinexcelexport', get_string('latinexcelexport', 'admin'), get_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
|
|
|
|
$ADMIN->add('language', $temp);
|
|
|
|
$ADMIN->add('language', new admin_externalpage('langimport', get_string('langpacks', 'admin'), "$CFG->wwwroot/$CFG->admin/langimport.php"));
|
|
|
|
// Hidden multilang upgrade page.
|
|
$ADMIN->add('language', new admin_externalpage('multilangupgrade', get_string('multilangupgrade', 'admin'), $CFG->wwwroot.'/'.$CFG->admin.'/multilangupgrade.php', 'moodle/site:config', !empty($CFG->filter_multilang_converted)));
|
|
|
|
} // end of speedup
|