function drush_language_translations_refresh in Drush Language Commands 7
Refresh translations from one or more locale groups.
@option array $groups Comma separated list of locale groups. Defaults to 'all'. @option bool $delete Delete left over strings.
Return value
void
1 string reference to 'drush_language_translations_refresh'
- language_translations_drush_command in ./
language_translations.drush.inc - Implements of hook_drush_command().
File
- ./
language_translations.drush.inc, line 326 - Drush language commands related to translations.
Code
function drush_language_translations_refresh() {
// Parse arguments and options.
$groups = explode(',', drush_get_option('groups', 'all'));
$groups = _drush_language_translations_groups_filter($groups);
if (empty($groups)) {
drush_log(dt("drush language: could not parse arguments or groups"), 'error');
return;
}
// Perform batch operations
if (!empty($groups)) {
module_load_include('admin.inc', 'i18n_string');
// Should left over strings be deleted?
$delete = drush_get_option('delete') ? TRUE : FALSE;
$batch = i18n_string_refresh_batch($groups, $delete);
batch_set($batch);
drush_backend_batch_process();
drush_log(dt('Strings refreshed'), 'success');
}
}