locale_refresh_cache
modules/locale/locale.module, строка 224
- Версии
- 5
locale_refresh_cache()
Refreshes database stored cache of translations.
We only store short strings to improve performance and consume less memory.
Код
<?php
function locale_refresh_cache() {
$languages = locale_supported_languages();
foreach (array_keys($languages['name']) as $locale) {
$result = db_query("SELECT s.source, t.translation, t.locale FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid WHERE t.locale = '%s' AND LENGTH(s.source) < 75", $locale);
$t = array();
while ($data = db_fetch_object($result)) {
$t[$data->source] = (empty($data->translation) ? TRUE : $data->translation);
}
cache_set("locale:$locale", 'cache', serialize($t));
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии