function l10n_update_check_projects_local in Localization update 7.2
Check and store the status and timestamp of local po files.
Only po files in the local file system are checked. Any remote translation files will be ignored.
Projects may contain a server_pattern option containing a pattern of the path to the po source files. If no server_pattern is defined the default translation directory is checked for the po file. When a server_pattern is defined the specified location is checked. The server_pattern can be set in the module's .info.yml file or by using hook_l10n_update_projects_alter().
Parameters
array $projects: Array of project names for which to check the state of translation files. Defaults to all translatable projects.
array $langcodes: Array of language codes. Defaults to all translatable languages.
1 call to l10n_update_check_projects_local()
- l10n_update_check_projects in ./
l10n_update.compare.inc - Check for the latest release of project translations.
File
- ./
l10n_update.compare.inc, line 380 - The API for comparing project translation status with available translation.
Code
function l10n_update_check_projects_local($projects = array(), $langcodes = array()) {
$projects = l10n_update_get_projects($projects);
$langcodes = $langcodes ? $langcodes : array_keys(l10n_update_translatable_language_list());
// For each project and each language we check if a local po file is
// available. When found the source object is updated with the appropriate
// type and timestamp of the po file.
foreach ($projects as $name => $project) {
foreach ($langcodes as $langcode) {
$source = l10n_update_source_build($project, $langcode);
if ($file = l10n_update_source_check_file($source)) {
l10n_update_status_save($name, $langcode, L10N_UPDATE_LOCAL, $file);
}
}
}
}