'mode'=>'Determine if existing translations are overwitten during import. Use "overwrite" to overwrite any existing translation, "replace" to replace previously imported translations but not overwrite edited strings, "keep" to keep any existing translation and only add new translations. Default value: keep'
),
),
);
);
return$commands;
return$commands;
...
@@ -102,8 +102,8 @@ function drush_l10n_update_validate() {
...
@@ -102,8 +102,8 @@ function drush_l10n_update_validate() {
// File not found occurs when a translation file is not yet available
// at the translation server. But also if a custom module or custom
// theme does not define the location of a translation file. By default
// the file is checked at the translation server, but it will not be
// found there.
watchdog('l10n_update','File not found: @uri.',array('@uri'=>$url));
returnTRUE;
case0:
watchdog('l10n_update','Error occurred when trying to check @remote: @errormessage.',array('@errormessage'=>$result->error,'@remote'=>$url),WATCHDOG_ERROR);
break;
default:
watchdog('l10n_update','HTTP error @errorcode occurred when trying to check @remote.',array('@errorcode'=>$result->code,'@remote'=>$url),WATCHDOG_ERROR);
break;
}
}
return$result;
}
}
/**
/**
...
@@ -297,7 +318,8 @@ function l10n_update_http_check($url, $headers = array()) {
...
@@ -297,7 +318,8 @@ function l10n_update_http_check($url, $headers = array()) {
* received.
* received.
* - redirect_code: If redirected, an integer containing the initial response
* - redirect_code: If redirected, an integer containing the initial response
* status code.
* status code.
* - redirect_url: If redirected, a string containing the redirection location.
* - redirect_url: If redirected, a string containing the URL of the redirect
* target.
* - error: If an error occurred, the error message. Otherwise not set.
* - error: If an error occurred, the error message. Otherwise not set.
* - headers: An array containing the response headers as name/value pairs.
* - headers: An array containing the response headers as name/value pairs.
* HTTP header names are case-insensitive (RFC 2616, section 4.2), so for
* HTTP header names are case-insensitive (RFC 2616, section 4.2), so for
drupal_set_message(t('The translation file %filename appears to have a missing or malformed header.',array('%filename'=>$file->filename)),'error');
drupal_set_message(t('The translation file %filename appears to have a missing or malformed header.',array('%filename'=>$file->filename)),'error');
}
}
// Clear cache and force refresh of JavaScript translations.
_locale_invalidate_js($langcode);
cache_clear_all('locale:','cache',TRUE);
// Rebuild the menu, strings may have changed.
menu_rebuild();
watchdog('locale','Imported %file into %locale: %number new strings added, %update updated and %delete removed.',array('%file'=>$file->filename,'%locale'=>$langcode,'%number'=>$additions,'%update'=>$updates,'%delete'=>$deletes));
watchdog('locale','Imported %file into %locale: %number new strings added, %update updated and %delete removed.',array('%file'=>$file->filename,'%locale'=>$langcode,'%number'=>$additions,'%update'=>$updates,'%delete'=>$deletes));
if($skips){
if($skips){
watchdog('locale','@count disallowed HTML string(s) in %file',array('@count'=>$skips,'%file'=>$file->uri),WATCHDOG_WARNING);
watchdog('locale','@count disallowed HTML string(s) in %file',array('@count'=>$skips,'%file'=>$file->uri),WATCHDOG_WARNING);
$translation=db_query("SELECT translation FROM {locales_target} WHERE lid = :lid AND language = :language",array(':lid'=>$lid,':language'=>$key))->fetchField();