Skip to content
Snippets Groups Projects
Commit 7d3e5829 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #851308 by andypost: make locale cache configurable.

parent 0de52de6
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -145,6 +145,7 @@ function locale_uninstall() {
variable_del('locale_js_directory');
variable_del('javascript_parsed');
variable_del('locale_field_language_fallback');
variable_del('locale_cache_length');
foreach (language_types() as $type) {
variable_del("language_negotiation_$type");
......
......@@ -650,7 +650,7 @@ function locale($string = NULL, $context = NULL, $langcode = NULL) {
// Refresh database stored cache of translations for given language.
// We only store short strings used in current version, to improve
// performance and consume less memory.
$result = db_query("SELECT s.source, s.context, t.translation, t.language FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.textgroup = 'default' AND s.version = :version AND LENGTH(s.source) < 75", array(':language' => $langcode, ':version' => VERSION));
$result = db_query("SELECT s.source, s.context, t.translation, t.language FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.textgroup = 'default' AND s.version = :version AND LENGTH(s.source) < :length", array(':language' => $langcode, ':version' => VERSION, ':length' => variable_get('locale_cache_length', 75)));
foreach ($result as $data) {
$locale_t[$langcode][$data->context][$data->source] = (empty($data->translation) ? TRUE : $data->translation);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment