mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-26804 core_string_manager::get_list_of_translations() can use a cache again
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.
This commit is contained in:
parent
92a387b467
commit
a9cbd19bff
7 changed files with 67 additions and 17 deletions
|
@ -246,7 +246,6 @@ $string['configjabberpassword'] = 'The password to use when connecting to the Ja
|
|||
$string['configjabberport'] = 'The port to use when connecting to the Jabber server';
|
||||
$string['configkeeptagnamecase'] = 'Check this if you want tag names to keep the original casing as entered by users who created them';
|
||||
$string['configlang'] = 'Choose a default language for the whole site. Users can override this setting using the language menu or the setting in their personal profile.';
|
||||
$string['configlangcache'] = 'Cache the language menu. Saves a lot of memory and processing power. If you enable this, the menu takes a few minutes to update after you have added or removed languages.';
|
||||
$string['configlangstringcache'] = 'Caches all the language strings into compiled files in the data directory. If you are translating Moodle or changing strings in the Moodle source code then you may want to switch this off. Otherwise leave it on to see performance benefits.';
|
||||
$string['configlangdir'] = 'Most languages are printed left-to-right, but some, like Arabic and Hebrew, are printed right-to-left.';
|
||||
$string['configlanglist'] = 'Leave this blank to allow users to choose from any language you have in this installation of Moodle. However, you can shorten the language menu by entering a comma-separated list of language codes that you want. For example: en,es_es,fr,it';
|
||||
|
@ -632,6 +631,7 @@ $string['jabberport'] = 'Jabber port';
|
|||
$string['keeptagnamecase'] = 'Keep tag name casing';
|
||||
$string['lang'] = 'Default language';
|
||||
$string['langcache'] = 'Cache language menu';
|
||||
$string['langcache_desc'] = 'Cache the language menu. If enabled, the list of available translations is cached. The cache is automatically refreshed when you install or delete a language pack via the in-built language packs management tool. If you install a new language pack manually, you have to use Purge all caches feature to refresh the cached list.';
|
||||
$string['langedit'] = 'Language editing';
|
||||
$string['langimport'] = 'Language import utility';
|
||||
$string['langimportdisabled'] = 'Language import feature has been disabled. You have to update your language packs manually at the file-system level.';
|
||||
|
|
|
@ -61,7 +61,6 @@ $string['cannotdeletecourse'] = 'You do not have the permission to delete this c
|
|||
$string['cannotdeletecustomfield'] = 'Error deleting custom field data';
|
||||
$string['cannotdeletedir'] = 'Cannot delete ({$a})';
|
||||
$string['cannotdeletefile'] = 'Cannot delete this file';
|
||||
$string['cannotdeletelangcache'] = 'Language cache cannot be deleted, please fix permissions in dataroot/cache/languages!';
|
||||
$string['cannotdeleterole'] = 'It cannot be deleted, because {$a}';
|
||||
$string['cannotdeleterolewithid'] = 'Could not delete role with ID {$a}';
|
||||
$string['cannotdeletethisrole'] = 'You cannot delete this role because it is used by the system, or because it is the last role with administrator capabilities.';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue