returnconfirm_form($form,t('Are you sure you want to delete the string "%source"?',array('%source'=>$source->source)),'admin/build/translate/search',t('Deleting the string will remove all translations of this string in all languages. This action cannot be undone.'),t('Delete'),t('Cancel'));
returnconfirm_form($form,t('Are you sure you want to delete the string "%source"?',array('%source'=>$source->source)),'admin/build/translate/translate',t('Deleting the string will remove all translations of this string in all languages. This action cannot be undone.'),t('Delete'),t('Cancel'));
}
/**
...
...
@@ -941,7 +1018,7 @@ function locale_translate_delete_form_submit($form, &$form_state) {
_locale_invalidate_js();
cache_clear_all('locale:','cache',TRUE);
drupal_set_message(t('The string has been removed.'));
@@ -1988,89 +2065,96 @@ function _locale_translate_seek() {
$output='';
// We have at least one criterion to match
if($query=_locale_translate_seek_query()){
$join="SELECT s.source, s.location, s.lid, s.textgroup, t.translation, t.language FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid ";
$arguments=array();
$limit_language=FALSE;
// Compute LIKE section
switch($query['translation']){
case'translated':
$where="WHERE (t.translation LIKE ?)";
$orderby="ORDER BY t.translation";
$arguments[]='%'.$query['string'].'%';
break;
case'untranslated':
$where="WHERE (s.source LIKE ? AND t.translation IS NULL)";
$orderby="ORDER BY s.source";
$arguments[]='%'.$query['string'].'%';
break;
case'all':
default:
$where="WHERE (s.source LIKE ? OR t.translation LIKE ?)";
$sql=$join." WHERE s.source LIKE ? $grouplimit ORDER BY s.source";
$arguments=array('%'.$query['string'].'%');// $where is not used, discard its arguments
if(!empty($grouplimit)){
$arguments[]=$query['group'];
}
break;
// Search in all languages
case"all":
$sql="$join$where$grouplimit$orderby";
break;
// Some different language
default:
$sql="$join AND t.language = ? $where$grouplimit$orderby";
array_unshift($arguments,$query['language']);
// Don't show translation flags for other languages, we can't see them with this search.
$limit_language=$query['language'];
}
if(!($query=_locale_translate_seek_query())){
$query=array(
'translation'=>'all',
'group'=>'all',
'language'=>'all',
'string'=>'',
);
}
$result=pager_query($sql,50,0,NULL,$arguments);
$join="SELECT s.source, s.location, s.lid, s.textgroup, t.translation, t.language FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid ";
@@ -32,7 +32,7 @@ function locale_help($path, $arg) {
case'admin/settings/language':
$output='<p>'.t("This page provides an overview of your site's enabled languages. If multiple languages are available and enabled, the text on your site interface may be translated, registered users may select their preferred language on the <em>My account</em> page, and site authors may indicate a specific language when creating posts. Languages will be displayed in the order you specify in places such as the language switcher block, or the language dropdown when creating or editing posts. The site's default language is used for anonymous visitors and for users who have not selected a preferred language.").'</p>';
$output.='<p>'.t('For each language available on the site, use the <em>edit</em> link to configure language details, including name, an optional language-specific path or domain, and whether the language is natively presented either left-to-right or right-to-left. These languages also appear in the <em>Language</em> selection when creating a post of a content type with multilingual support.').'</p>';
$output.='<p>'.t('Use the <a href="@add-language">add language page</a> to enable additional languages (and automatically import files from a translation package, if available), the <a href="@search">translate interface page</a> to locate strings for manual translation, or the <a href="@import">import page</a> to add translations from individual <em>.po</em> files. A number of contributed translation packages containing <em>.po</em> files are available on the <a href="@translations">Drupal.org translations page</a>.',array('@add-language'=>url('admin/settings/language/add'),'@search'=>url('admin/build/translate/search'),'@import'=>url('admin/build/translate/import'),'@translations'=>'http://drupal.org/project/translations')).'</p>';
$output.='<p>'.t('Use the <a href="@add-language">add language page</a> to enable additional languages (and automatically import files from a translation package, if available), the <a href="@search">translate interface page</a> to locate strings for manual translation, or the <a href="@import">import page</a> to add translations from individual <em>.po</em> files. A number of contributed translation packages containing <em>.po</em> files are available on the <a href="@translations">Drupal.org translations page</a>.',array('@add-language'=>url('admin/settings/language/add'),'@search'=>url('admin/build/translate/translate'),'@import'=>url('admin/build/translate/import'),'@translations'=>'http://drupal.org/project/translations')).'</p>';
$output.='<p>'.t('To rearrange languages, grab a drag-and-drop handle under the <em>English name</em> column and drag the item to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.').'</p>';
return$output;
case'admin/settings/language/add':
...
...
@@ -55,7 +55,7 @@ function locale_help($path, $arg) {
return$output;
case'admin/build/translate/export':
return'<p>'.t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (<em>.po</em>) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (<em>.pot</em>) form, which includes the original strings only (used to create new translations with a Gettext translation editor).').'</p>';
case'admin/build/translate/search':
case'admin/build/translate/translate':
return'<p>'.t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to <a href="@export">export</a> strings for offline editing in a desktop Gettext translation editor.) Searches may be limited to strings found within a specific text group or in a specific language.',array('@export'=>url('admin/build/translate/export'))).'</p>';
case'admin/build/block/configure':
if($arg[4]=='locale'&&$arg[5]==0){
...
...
@@ -124,8 +124,8 @@ function locale_menu() {
'weight'=>0,
'type'=>MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/build/translate/search']=array(
'title'=>'Search',
$items['admin/build/translate/translate']=array(
'title'=>'Translate',
'weight'=>10,
'type'=>MENU_LOCAL_TASK,
'page callback'=>'locale_translate_seek_screen',// search results and form concatenated
...
...
@@ -314,6 +314,9 @@ function locale_theme() {
'locale_languages_overview_form'=>array(
'arguments'=>array('form'=>array()),
),
'locale_translation_filters'=>array(
'arguments'=>array('form'=>array()),
),
);
}
...
...
@@ -596,3 +599,17 @@ function locale_block_view($delta = '') {