- Patch #552958 by Gábor Hojtsy: create 'regional and language' section in 'configuration and modules'.
parent
2a123f0ac9
commit
1f1734af01
|
@ -89,7 +89,7 @@ function theme_locale_languages_overview_form($form) {
|
|||
array('data' => drupal_render($form['enabled'][$key]), 'align' => 'center'),
|
||||
drupal_render($form['site_default'][$key]),
|
||||
drupal_render($form['weight'][$key]),
|
||||
l(t('edit'), 'admin/config/international/language/edit/' . $key) . (($key != 'en' && $key != $default->language) ? ' ' . l(t('delete'), 'admin/config/international/language/delete/' . $key) : '')
|
||||
l(t('edit'), 'admin/config/regional/language/edit/' . $key) . (($key != 'en' && $key != $default->language) ? ' ' . l(t('delete'), 'admin/config/regional/language/delete/' . $key) : '')
|
||||
),
|
||||
'class' => 'draggable'
|
||||
);
|
||||
|
@ -142,7 +142,7 @@ function locale_languages_overview_form_submit($form, &$form_state) {
|
|||
// Changing the language settings impacts the interface.
|
||||
cache_clear_all('*', 'cache_page', TRUE);
|
||||
|
||||
$form_state['redirect'] = 'admin/config/international/language';
|
||||
$form_state['redirect'] = 'admin/config/regional/language';
|
||||
return;
|
||||
}
|
||||
/**
|
||||
|
@ -345,7 +345,7 @@ function locale_languages_predefined_form_submit($form, &$form_state) {
|
|||
batch_set($batch);
|
||||
}
|
||||
|
||||
$form_state['redirect'] = 'admin/config/international/language';
|
||||
$form_state['redirect'] = 'admin/config/regional/language';
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -391,7 +391,7 @@ function locale_languages_edit_form_submit($form, &$form_state) {
|
|||
}
|
||||
variable_set('language_default', $default);
|
||||
}
|
||||
$form_state['redirect'] = 'admin/config/international/language';
|
||||
$form_state['redirect'] = 'admin/config/regional/language';
|
||||
return;
|
||||
}
|
||||
/**
|
||||
|
@ -411,12 +411,12 @@ function locale_languages_delete_form(&$form_state, $langcode) {
|
|||
// Do not allow deletion of English locale.
|
||||
if ($langcode == 'en') {
|
||||
drupal_set_message(t('The English language cannot be deleted.'));
|
||||
drupal_goto('admin/config/international/language');
|
||||
drupal_goto('admin/config/regional/language');
|
||||
}
|
||||
|
||||
if (language_default('language') == $langcode) {
|
||||
drupal_set_message(t('The default language cannot be deleted.'));
|
||||
drupal_goto('admin/config/international/language');
|
||||
drupal_goto('admin/config/regional/language');
|
||||
}
|
||||
|
||||
// For other languages, warn user that data loss is ahead.
|
||||
|
@ -427,7 +427,7 @@ function locale_languages_delete_form(&$form_state, $langcode) {
|
|||
}
|
||||
else {
|
||||
$form['langcode'] = array('#type' => 'value', '#value' => $langcode);
|
||||
return confirm_form($form, t('Are you sure you want to delete the language %name?', array('%name' => t($languages[$langcode]->name))), 'admin/config/international/language', t('Deleting a language will remove all interface translations associated with it, and posts in this language will be set to be language neutral. This action cannot be undone.'), t('Delete'), t('Cancel'));
|
||||
return confirm_form($form, t('Are you sure you want to delete the language %name?', array('%name' => t($languages[$langcode]->name))), 'admin/config/regional/language', t('Deleting a language will remove all interface translations associated with it, and posts in this language will be set to be language neutral. This action cannot be undone.'), t('Delete'), t('Cancel'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -460,7 +460,7 @@ function locale_languages_delete_form_submit($form, &$form_state) {
|
|||
// Changing the language settings impacts the interface:
|
||||
cache_clear_all('*', 'cache_page', TRUE);
|
||||
|
||||
$form_state['redirect'] = 'admin/config/international/language';
|
||||
$form_state['redirect'] = 'admin/config/regional/language';
|
||||
return;
|
||||
}
|
||||
/**
|
||||
|
@ -500,7 +500,7 @@ function locale_languages_configure_form() {
|
|||
function locale_languages_configure_form_submit($form, &$form_state) {
|
||||
variable_set('language_negotiation', $form_state['values']['language_negotiation']);
|
||||
drupal_set_message(t('Language negotiation configuration saved.'));
|
||||
$form_state['redirect'] = 'admin/config/international/language';
|
||||
$form_state['redirect'] = 'admin/config/regional/language';
|
||||
return;
|
||||
}
|
||||
/**
|
||||
|
@ -687,7 +687,7 @@ function locale_translation_filter_form_submit($form, &$form_state) {
|
|||
break;
|
||||
}
|
||||
|
||||
$form_state['redirect'] = 'admin/config/international/translate/translate';
|
||||
$form_state['redirect'] = 'admin/config/regional/translate/translate';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -777,11 +777,11 @@ function locale_translate_import_form_submit($form, &$form_state) {
|
|||
}
|
||||
else {
|
||||
drupal_set_message(t('File to import not found.'), 'error');
|
||||
$form_state['redirect'] = 'admin/config/international/translate/import';
|
||||
$form_state['redirect'] = 'admin/config/regional/translate/import';
|
||||
return;
|
||||
}
|
||||
|
||||
$form_state['redirect'] = 'admin/config/international/translate';
|
||||
$form_state['redirect'] = 'admin/config/regional/translate';
|
||||
return;
|
||||
}
|
||||
/**
|
||||
|
@ -886,7 +886,7 @@ function locale_translate_edit_form(&$form_state, $lid) {
|
|||
$source = db_query('SELECT source, context, textgroup, location FROM {locales_source} WHERE lid = :lid', array(':lid' => $lid))->fetchObject();
|
||||
if (!$source) {
|
||||
drupal_set_message(t('String not found.'), 'error');
|
||||
drupal_goto('admin/config/international/translate/translate');
|
||||
drupal_goto('admin/config/regional/translate/translate');
|
||||
}
|
||||
|
||||
// Add original text to the top and some values for form altering.
|
||||
|
@ -1024,7 +1024,7 @@ function locale_translate_edit_form_submit($form, &$form_state) {
|
|||
_locale_invalidate_js();
|
||||
cache_clear_all('locale:', 'cache', TRUE);
|
||||
|
||||
$form_state['redirect'] = 'admin/config/international/translate/translate';
|
||||
$form_state['redirect'] = 'admin/config/regional/translate/translate';
|
||||
return;
|
||||
}
|
||||
/**
|
||||
|
@ -1053,7 +1053,7 @@ function locale_translate_delete_page($lid) {
|
|||
*/
|
||||
function locale_translate_delete_form(&$form_state, $source) {
|
||||
$form['lid'] = array('#type' => 'value', '#value' => $source->lid);
|
||||
return confirm_form($form, t('Are you sure you want to delete the string "%source"?', array('%source' => $source->source)), 'admin/config/international/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'));
|
||||
return confirm_form($form, t('Are you sure you want to delete the string "%source"?', array('%source' => $source->source)), 'admin/config/regional/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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1070,7 +1070,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.'));
|
||||
$form_state['redirect'] = 'admin/config/international/translate/translate';
|
||||
$form_state['redirect'] = 'admin/config/regional/translate/translate';
|
||||
}
|
||||
/**
|
||||
* @} End of "locale-translate-delete"
|
||||
|
@ -2303,8 +2303,8 @@ function _locale_translate_seek() {
|
|||
array('data' => check_plain(truncate_utf8($string['source'], 150, FALSE, TRUE)) . '<br /><small>' . $string['location'] . '</small>'),
|
||||
$string['context'],
|
||||
array('data' => _locale_translate_language_list($string['languages'], $limit_language), 'align' => 'center'),
|
||||
array('data' => l(t('edit'), "admin/config/international/translate/edit/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'),
|
||||
array('data' => l(t('delete'), "admin/config/international/translate/delete/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'),
|
||||
array('data' => l(t('edit'), "admin/config/regional/translate/edit/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'),
|
||||
array('data' => l(t('delete'), "admin/config/regional/translate/delete/$lid", array('query' => drupal_get_destination())), 'class' => 'nowrap'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,40 +26,40 @@ function locale_help($path, $arg) {
|
|||
$output .= '<p>' . t('Translations may be provided by:') . '</p>';
|
||||
$output .= '<ul><li>' . t("translating the original text via the locale module's integrated web interface, or") . '</li>';
|
||||
$output .= '<li>' . t('importing files from a set of existing translations, known as a translation package. A translation package enables the display of a specific version of Drupal in a specific language, and contain files in the Gettext Portable Object (<em>.po</em>) format. Although not all languages are available for every version of Drupal, translation packages for many languages are available for download from the <a href="@translations">Drupal translation page</a>.', array('@translations' => 'http://drupal.org/project/translations')) . '</li></ul>';
|
||||
$output .= '<p>' . t('If an existing translation package does not meet your needs, the Gettext Portable Object (<em>.po</em>) files within a package may be modified, or new <em>.po</em> files may be created, using a desktop Gettext editor. The locale module\'s <a href="@import">import</a> feature allows the translated strings from a new or modified <em>.po</em> file to be added to your site. The locale module\'s <a href="@export">export</a> feature generates files from your site\'s translated strings, that can either be shared with others or edited offline by a Gettext translation editor.', array('@import' => url('admin/config/international/translate/import'), '@export' => url('admin/config/international/translate/export'))) . '</p>';
|
||||
$output .= '<p>' . t('If an existing translation package does not meet your needs, the Gettext Portable Object (<em>.po</em>) files within a package may be modified, or new <em>.po</em> files may be created, using a desktop Gettext editor. The locale module\'s <a href="@import">import</a> feature allows the translated strings from a new or modified <em>.po</em> file to be added to your site. The locale module\'s <a href="@export">export</a> feature generates files from your site\'s translated strings, that can either be shared with others or edited offline by a Gettext translation editor.', array('@import' => url('admin/config/regional/translate/import'), '@export' => url('admin/config/regional/translate/export'))) . '</p>';
|
||||
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@locale">Locale module</a>.', array('@locale' => 'http://drupal.org/handbook/modules/locale/')) . '</p>';
|
||||
return $output;
|
||||
case 'admin/config/international/language':
|
||||
case 'admin/config/regional/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/config/international/language/add'), '@search' => url('admin/config/international/translate/translate'), '@import' => url('admin/config/international/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/config/regional/language/add'), '@search' => url('admin/config/regional/translate/translate'), '@import' => url('admin/config/regional/translate/import'), '@translations' => 'http://drupal.org/project/translations')) . '</p>';
|
||||
$output .= '<p>' . t('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/config/international/language/add':
|
||||
case 'admin/config/regional/language/add':
|
||||
return '<p>' . t('Add all languages to be supported by your site. If your desired language is not available in the <em>Language name</em> drop-down, click <em>Custom language</em> and provide a language code and other details manually. When providing a language code manually, be sure to enter a standardized language code, since this code may be used by browsers to determine an appropriate display language.') . '</p>';
|
||||
case 'admin/config/international/language/configure':
|
||||
case 'admin/config/regional/language/configure':
|
||||
$output = '<p>' . t("Language negotiation settings determine the site's presentation language. Available options include:") . '</p>';
|
||||
$output .= '<ul><li>' . t('<strong>None.</strong> The default language is used for site presentation, though users may (optionally) select a preferred language on the <em>My Account</em> page. (User language preferences will be used for site e-mails, if available.)') . '</li>';
|
||||
$output .= '<li>' . t('<strong>Path prefix only.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the default language is used. <em>Example: "example.com/de/contact" sets presentation language to German based on the use of "de" within the path.</em>') . '</li>';
|
||||
$output .= '<li>' . t("<strong>Path prefix with language fallback.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the display language is determined by the user's language preferences from the <em>My Account</em> page, or by the browser's language settings. If a presentation language cannot be determined, the default language is used.") . '</li>';
|
||||
$output .= '<li>' . t('<strong>Domain name only.</strong> The presentation language is determined by examining the domain used to access the site, and comparing it to the language domain (if any) specified for each language. If a match is not identified, the default language is used. <em>Example: "http://de.example.com/contact" sets presentation language to German based on the use of "http://de.example.com" in the domain.</em>') . '</li></ul>';
|
||||
$output .= '<p>' . t('The path prefix or domain name for a language may be set by editing the <a href="@languages">available languages</a>. In the absence of an appropriate match, the site is displayed in the <a href="@languages">default language</a>.', array('@languages' => url('admin/config/international/language'))) . '</p>';
|
||||
$output .= '<p>' . t('The path prefix or domain name for a language may be set by editing the <a href="@languages">available languages</a>. In the absence of an appropriate match, the site is displayed in the <a href="@languages">default language</a>.', array('@languages' => url('admin/config/regional/language'))) . '</p>';
|
||||
return $output;
|
||||
case 'admin/config/international/translate':
|
||||
case 'admin/config/regional/translate':
|
||||
$output = '<p>' . t('This page provides an overview of available translatable strings. Drupal displays translatable strings in text groups; modules may define additional text groups containing other translatable strings. Because text groups provide a method of grouping related strings, they are often used to focus translation efforts on specific areas of the Drupal interface.') . '</p>';
|
||||
$output .= '<p>' . t('Review the <a href="@languages">languages page</a> for more information on adding support for additional languages.', array('@languages' => url('admin/config/international/language'))) . '</p>';
|
||||
$output .= '<p>' . t('Review the <a href="@languages">languages page</a> for more information on adding support for additional languages.', array('@languages' => url('admin/config/regional/language'))) . '</p>';
|
||||
return $output;
|
||||
case 'admin/config/international/translate/import':
|
||||
case 'admin/config/regional/translate/import':
|
||||
$output = '<p>' . t('This page imports the translated strings contained in an individual Gettext Portable Object (<em>.po</em>) file. Normally distributed as part of a translation package (each translation package may contain several <em>.po</em> files), a <em>.po</em> file may need to be imported after offline editing in a Gettext translation editor. Importing an individual <em>.po</em> file may be a lengthy process.') . '</p>';
|
||||
$output .= '<p>' . t('Note that the <em>.po</em> files within a translation package are imported automatically (if available) when new modules or themes are enabled, or as new languages are added. Since this page only allows the import of one <em>.po</em> file at a time, it may be simpler to download and extract a translation package into your Drupal installation directory and <a href="@language-add">add the language</a> (which automatically imports all <em>.po</em> files within the package). Translation packages are available for download on the <a href="@translations">Drupal translation page</a>.', array('@language-add' => url('admin/config/international/language/add'), '@translations' => 'http://drupal.org/project/translations')) . '</p>';
|
||||
$output .= '<p>' . t('Note that the <em>.po</em> files within a translation package are imported automatically (if available) when new modules or themes are enabled, or as new languages are added. Since this page only allows the import of one <em>.po</em> file at a time, it may be simpler to download and extract a translation package into your Drupal installation directory and <a href="@language-add">add the language</a> (which automatically imports all <em>.po</em> files within the package). Translation packages are available for download on the <a href="@translations">Drupal translation page</a>.', array('@language-add' => url('admin/config/regional/language/add'), '@translations' => 'http://drupal.org/project/translations')) . '</p>';
|
||||
return $output;
|
||||
case 'admin/config/international/translate/export':
|
||||
case 'admin/config/regional/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/config/international/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/config/international/translate/export'))) . '</p>';
|
||||
case 'admin/config/regional/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/config/regional/translate/export'))) . '</p>';
|
||||
case 'admin/structure/block/configure':
|
||||
if ($arg[4] == 'locale' && $arg[5] == 0) {
|
||||
return '<p>' . t('This block is only shown if <a href="@languages">at least two languages are enabled</a> and <a href="@configuration">language negotiation</a> is set to something other than <em>None</em>.', array('@languages' => url('admin/config/international/language'), '@configuration' => url('admin/config/international/language/configure'))) . '</p>';
|
||||
return '<p>' . t('This block is only shown if <a href="@languages">at least two languages are enabled</a> and <a href="@configuration">language negotiation</a> is set to something other than <em>None</em>.', array('@languages' => url('admin/config/regional/language'), '@configuration' => url('admin/config/regional/language/configure'))) . '</p>';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -70,35 +70,26 @@ function locale_help($path, $arg) {
|
|||
*/
|
||||
function locale_menu() {
|
||||
// Manage languages
|
||||
$items['admin/config/international'] = array(
|
||||
'title' => 'International',
|
||||
'description' => 'Localization and translation.',
|
||||
'position' => 'left',
|
||||
'weight' => -7,
|
||||
'page callback' => 'system_admin_menu_block_page',
|
||||
'access callback' => 'system_admin_menu_block_access',
|
||||
'access arguments' => array('admin/config/international', 'access administration pages'),
|
||||
);
|
||||
$items['admin/config/international/language'] = array(
|
||||
$items['admin/config/regional/language'] = array(
|
||||
'title' => 'Languages',
|
||||
'description' => 'Configure languages for content and the user interface.',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('locale_languages_overview_form'),
|
||||
'access arguments' => array('administer languages'),
|
||||
);
|
||||
$items['admin/config/international/language/overview'] = array(
|
||||
$items['admin/config/regional/language/overview'] = array(
|
||||
'title' => 'List',
|
||||
'weight' => 0,
|
||||
'type' => MENU_DEFAULT_LOCAL_TASK,
|
||||
);
|
||||
$items['admin/config/international/language/add'] = array(
|
||||
$items['admin/config/regional/language/add'] = array(
|
||||
'title' => 'Add language',
|
||||
'page callback' => 'locale_languages_add_screen', // two forms concatenated
|
||||
'access arguments' => array('administer languages'),
|
||||
'weight' => 5,
|
||||
'type' => MENU_LOCAL_TASK,
|
||||
);
|
||||
$items['admin/config/international/language/configure'] = array(
|
||||
$items['admin/config/regional/language/configure'] = array(
|
||||
'title' => 'Configure',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('locale_languages_configure_form'),
|
||||
|
@ -106,14 +97,14 @@ function locale_menu() {
|
|||
'weight' => 10,
|
||||
'type' => MENU_LOCAL_TASK,
|
||||
);
|
||||
$items['admin/config/international/language/edit/%'] = array(
|
||||
$items['admin/config/regional/language/edit/%'] = array(
|
||||
'title' => 'Edit language',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('locale_languages_edit_form', 5),
|
||||
'access arguments' => array('administer languages'),
|
||||
'type' => MENU_CALLBACK,
|
||||
);
|
||||
$items['admin/config/international/language/delete/%'] = array(
|
||||
$items['admin/config/regional/language/delete/%'] = array(
|
||||
'title' => 'Confirm',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('locale_languages_delete_form', 5),
|
||||
|
@ -122,25 +113,25 @@ function locale_menu() {
|
|||
);
|
||||
|
||||
// Translation functionality
|
||||
$items['admin/config/international/translate'] = array(
|
||||
$items['admin/config/regional/translate'] = array(
|
||||
'title' => 'Translate interface',
|
||||
'description' => 'Translate the built in interface and optionally other text.',
|
||||
'page callback' => 'locale_translate_overview_screen', // not a form, just a table
|
||||
'access arguments' => array('translate interface'),
|
||||
);
|
||||
$items['admin/config/international/translate/overview'] = array(
|
||||
$items['admin/config/regional/translate/overview'] = array(
|
||||
'title' => 'Overview',
|
||||
'weight' => 0,
|
||||
'type' => MENU_DEFAULT_LOCAL_TASK,
|
||||
);
|
||||
$items['admin/config/international/translate/translate'] = array(
|
||||
$items['admin/config/regional/translate/translate'] = array(
|
||||
'title' => 'Translate',
|
||||
'weight' => 10,
|
||||
'type' => MENU_LOCAL_TASK,
|
||||
'page callback' => 'locale_translate_seek_screen', // search results and form concatenated
|
||||
'access arguments' => array('translate interface'),
|
||||
);
|
||||
$items['admin/config/international/translate/import'] = array(
|
||||
$items['admin/config/regional/translate/import'] = array(
|
||||
'title' => 'Import',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('locale_translate_import_form'),
|
||||
|
@ -148,21 +139,21 @@ function locale_menu() {
|
|||
'weight' => 20,
|
||||
'type' => MENU_LOCAL_TASK,
|
||||
);
|
||||
$items['admin/config/international/translate/export'] = array(
|
||||
$items['admin/config/regional/translate/export'] = array(
|
||||
'title' => 'Export',
|
||||
'page callback' => 'locale_translate_export_screen', // possibly multiple forms concatenated
|
||||
'access arguments' => array('translate interface'),
|
||||
'weight' => 30,
|
||||
'type' => MENU_LOCAL_TASK,
|
||||
);
|
||||
$items['admin/config/international/translate/edit/%'] = array(
|
||||
$items['admin/config/regional/translate/edit/%'] = array(
|
||||
'title' => 'Edit string',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('locale_translate_edit_form', 5),
|
||||
'access arguments' => array('translate interface'),
|
||||
'type' => MENU_CALLBACK,
|
||||
);
|
||||
$items['admin/config/international/translate/delete/%'] = array(
|
||||
$items['admin/config/regional/translate/delete/%'] = array(
|
||||
'title' => 'Delete string',
|
||||
'page callback' => 'locale_translate_delete_page',
|
||||
'page arguments' => array(5),
|
||||
|
@ -286,7 +277,7 @@ function locale_form_node_type_form_alter(&$form, &$form_state) {
|
|||
'#title' => t('Multilingual support'),
|
||||
'#default_value' => variable_get('language_content_type_' . $form['#node_type']->type, 0),
|
||||
'#options' => array(t('Disabled'), t('Enabled')),
|
||||
'#description' => t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the <a href="!languages">enabled languages</a>. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/config/international/language'))),
|
||||
'#description' => t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the <a href="!languages">enabled languages</a>. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/config/regional/language'))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,9 +49,9 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
|
|||
$edit = array(
|
||||
'langcode' => 'fr',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
|
||||
$this->assertText('fr', t('Language added successfully.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
|
||||
// Add custom language.
|
||||
// Code for the language.
|
||||
|
@ -69,15 +69,15 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertText($langcode, t('Language code found.'));
|
||||
$this->assertText($name, t('Name found.'));
|
||||
$this->assertText($native, t('Native found.'));
|
||||
$this->assertText($native, t('Test language added.'));
|
||||
|
||||
// Check if we can change the default language.
|
||||
$path = 'admin/config/international/language';
|
||||
$path = 'admin/config/regional/language';
|
||||
$this->drupalGet($path);
|
||||
$this->assertFieldChecked('edit-site-default-en', t('English is the default language.'));
|
||||
// Change the default language.
|
||||
|
@ -86,12 +86,12 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
|
|||
);
|
||||
$this->drupalPost($path, $edit, t('Save configuration'));
|
||||
$this->assertNoFieldChecked('edit-site-default-en', t('Default language updated.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
|
||||
// Ensure we can't delete the default language.
|
||||
$path = 'admin/config/international/language/delete/' . $langcode;
|
||||
$path = 'admin/config/regional/language/delete/' . $langcode;
|
||||
$this->drupalGet($path);
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertText(t('The default language cannot be deleted.'), t('Failed to delete the default language.'));
|
||||
|
||||
// Check if we can disable a language.
|
||||
|
@ -112,33 +112,33 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
|
|||
$this->clickLink(t('edit'));
|
||||
$this->assertTitle(t('Edit language | Drupal'), t('Page title is "Edit language".'));
|
||||
// Edit a language.
|
||||
$path = 'admin/config/international/language/edit/' . $langcode;
|
||||
$path = 'admin/config/regional/language/edit/' . $langcode;
|
||||
$name = $this->randomName(16);
|
||||
$edit = array(
|
||||
'name' => $name,
|
||||
);
|
||||
$this->drupalPost($path, $edit, t('Save language'));
|
||||
$this->assertRaw($name, t('The language has been updated.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
|
||||
// Ensure 'delete' link works.
|
||||
$path = 'admin/config/international/language';
|
||||
$path = 'admin/config/regional/language';
|
||||
$this->drupalGet($path);
|
||||
$this->clickLink(t('delete'));
|
||||
$this->assertText(t('Are you sure you want to delete the language'), t('"delete" link is correct.'));
|
||||
// Delete the language.
|
||||
$path = 'admin/config/international/language/delete/' . $langcode;
|
||||
$path = 'admin/config/regional/language/delete/' . $langcode;
|
||||
$this->drupalGet($path);
|
||||
// First test the 'cancel' link.
|
||||
$this->clickLink(t('Cancel'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertRaw($name, t('The language was not deleted.'));
|
||||
// Delete the language for real. This a confirm form, we do not need any
|
||||
// fields changed.
|
||||
$this->drupalPost($path, array(), t('Delete'));
|
||||
// We need raw here because %locale will add HTML.
|
||||
$this->assertRaw(t('The language %locale has been removed.', array('%locale' => $name)), t('The test language has been removed.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
// Reload to remove $name.
|
||||
$this->drupalGet($path);
|
||||
$this->assertNoText($langcode, t('Language code not found.'));
|
||||
|
@ -146,9 +146,9 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
|
|||
$this->assertNoText($native, t('Native not found.'));
|
||||
|
||||
// Ensure we can't delete the English language.
|
||||
$path = 'admin/config/international/language/delete/en';
|
||||
$path = 'admin/config/regional/language/delete/en';
|
||||
$this->drupalGet($path);
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertText(t('The English language cannot be deleted.'), t('Failed to delete English language.'));
|
||||
|
||||
$this->drupalLogout();
|
||||
|
@ -205,7 +205,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
// Add string.
|
||||
t($name, array(), array('langcode' => $langcode));
|
||||
// Reset locale cache.
|
||||
|
@ -226,7 +226,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'all',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
// assertText() seems to remove the input field where $name always could be
|
||||
// found, so this is not a false assert. See how assertNoText succeeds
|
||||
// later.
|
||||
|
@ -236,7 +236,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
$this->clickLink(t('edit'));
|
||||
// We save the lid from the path.
|
||||
$matches = array();
|
||||
preg_match('!admin/config/international/translate/edit/(\d)+!', $this->getUrl(), $matches);
|
||||
preg_match('!admin/config/regional/translate/edit/(\d)+!', $this->getUrl(), $matches);
|
||||
$lid = $matches[1];
|
||||
// No t() here, it's surely not translated yet.
|
||||
$this->assertText($name, t('name found on edit screen.'));
|
||||
|
@ -245,23 +245,23 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
);
|
||||
$this->drupalPost(NULL, $edit, t('Save translations'));
|
||||
$this->assertText(t('The string has been saved.'), t('The string has been saved.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertTrue($name != $translation && t($name, array(), array('langcode' => $langcode)) == $translation, t('t() works.'));
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
// The indicator should not be here.
|
||||
$this->assertNoRaw($language_indicator, t('String is translated.'));
|
||||
|
||||
// Try to edit a non-existent string and ensure we're redirected correctly.
|
||||
// Assuming we don't have 999,999 strings already.
|
||||
$random_lid = 999999;
|
||||
$this->drupalGet('admin/config/international/translate/edit/' . $random_lid);
|
||||
$this->drupalGet('admin/config/regional/translate/edit/' . $random_lid);
|
||||
$this->assertText(t('String not found'), t('String not found.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->drupalLogout();
|
||||
|
||||
// Delete the language.
|
||||
$this->drupalLogin($admin_user);
|
||||
$path = 'admin/config/international/language/delete/' . $langcode;
|
||||
$path = 'admin/config/regional/language/delete/' . $langcode;
|
||||
// This a confirm form, we do not need any fields changed.
|
||||
$this->drupalPost($path, array(), t('Delete'));
|
||||
// We need raw here because %locale will add HTML.
|
||||
|
@ -281,22 +281,22 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'all',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
// Assume this is the only result, given the random name.
|
||||
$this->clickLink(t('delete'));
|
||||
$this->assertText(t('Are you sure you want to delete the string'), t('"delete" link is correct.'));
|
||||
// Delete the string.
|
||||
$path = 'admin/config/international/translate/delete/' . $lid;
|
||||
$path = 'admin/config/regional/translate/delete/' . $lid;
|
||||
$this->drupalGet($path);
|
||||
// First test the 'cancel' link.
|
||||
$this->clickLink(t('Cancel'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertRaw($name, t('The string was not deleted.'));
|
||||
// Delete the name string.
|
||||
$this->drupalPost('admin/config/international/translate/delete/' . $lid, array(), t('Delete'));
|
||||
$this->drupalPost('admin/config/regional/translate/delete/' . $lid, array(), t('Delete'));
|
||||
$this->assertText(t('The string has been removed.'), t('The string has been removed message.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertNoText($name, t('Search now can not find the name.'));
|
||||
}
|
||||
|
||||
|
@ -337,7 +337,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
// Add string.
|
||||
t($name, array(), array('langcode' => $langcode));
|
||||
// Reset locale cache.
|
||||
|
@ -347,10 +347,10 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'all',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
// Find the edit path.
|
||||
$content = $this->drupalGetContent();
|
||||
$this->assertTrue(preg_match('@(admin/config/international/translate/edit/[0-9]+)@', $content, $matches), t('Found the edit path.'));
|
||||
$this->assertTrue(preg_match('@(admin/config/regional/translate/edit/[0-9]+)@', $content, $matches), t('Found the edit path.'));
|
||||
$path = $matches[0];
|
||||
foreach ($bad_translations as $key => $translation) {
|
||||
$edit = array(
|
||||
|
@ -398,7 +398,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
// Add string.
|
||||
t($name, array(), array('langcode' => $langcode));
|
||||
// Reset locale cache.
|
||||
|
@ -413,7 +413,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'all',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
// assertText() seems to remove the input field where $name always could be
|
||||
// found, so this is not a false assert. See how assertNoText succeeds
|
||||
// later.
|
||||
|
@ -427,7 +427,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'translated',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertText(t('No strings found for your search.'), t("Search didn't find the string."));
|
||||
|
||||
// Ensure untranslated string appears if searching on 'only untranslated
|
||||
|
@ -438,7 +438,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'untranslated',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertNoText(t('No strings found for your search.'), t('Search found the string.'));
|
||||
|
||||
// Add translation.
|
||||
|
@ -446,7 +446,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
$this->clickLink(t('edit'));
|
||||
// We save the lid from the path.
|
||||
$matches = array();
|
||||
preg_match('!admin/config/international/translate/edit/(\d)+!', $this->getUrl(), $matches);
|
||||
preg_match('!admin/config/regional/translate/edit/(\d)+!', $this->getUrl(), $matches);
|
||||
$lid = $matches[1];
|
||||
$edit = array(
|
||||
"translations[$langcode]" => $translation,
|
||||
|
@ -461,7 +461,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'translated',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertNoText(t('No strings found for your search.'), t('Search found the translation.'));
|
||||
|
||||
// Ensure translated source string doesn't appear if searching on 'only
|
||||
|
@ -472,7 +472,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'untranslated',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertText(t('No strings found for your search.'), t("Search didn't find the source string."));
|
||||
|
||||
// Ensure translated string doesn't appear if searching on 'only
|
||||
|
@ -483,7 +483,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'untranslated',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertText(t('No strings found for your search.'), t("Search didn't find the translation."));
|
||||
|
||||
// Ensure translated string does appear if searching on the custom language.
|
||||
|
@ -493,7 +493,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'all',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertNoText(t('No strings found for your search.'), t('Search found the translation.'));
|
||||
|
||||
// Ensure translated string doesn't appear if searching on English.
|
||||
|
@ -503,7 +503,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'all',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertText(t('No strings found for your search.'), t("Search didn't find the translation."));
|
||||
|
||||
// Search for a string that isn't in the system.
|
||||
|
@ -514,7 +514,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'all',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertText(t('No strings found for your search.'), t("Search didn't find the invalid string."));
|
||||
}
|
||||
}
|
||||
|
@ -559,7 +559,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
|
|||
$this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 7, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported.'));
|
||||
|
||||
// Ensure we were redirected correctly.
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
|
||||
|
||||
// Try importing a .po file with invalid tags in the default text group.
|
||||
|
@ -585,12 +585,12 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
|
|||
|
||||
// Try importing a .po file which doesn't exist.
|
||||
$name = $this->randomName(16);
|
||||
$this->drupalPost('admin/config/international/translate/import', array(
|
||||
$this->drupalPost('admin/config/regional/translate/import', array(
|
||||
'langcode' => 'fr',
|
||||
'files[file]' => $name,
|
||||
'group' => 'custom',
|
||||
), t('Import'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/translate/import', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/translate/import', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->assertText(t('File to import not found.'), t('File to import not found message.'));
|
||||
|
||||
|
||||
|
@ -610,7 +610,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'translated',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertText(t('No strings found for your search.'), t('String not overwritten by imported string.'));
|
||||
|
||||
|
||||
|
@ -630,7 +630,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'translated',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertNoText(t('No strings found for your search.'), t('String overwritten by imported string.'));
|
||||
}
|
||||
|
||||
|
@ -656,7 +656,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
|
||||
// Ensure the translation file was automatically imported when language was
|
||||
// added.
|
||||
|
@ -669,7 +669,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
|
|||
'translation' => 'translated',
|
||||
'group' => 'all',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $search, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
|
||||
$this->assertNoText(t('No strings found for your search.'), t('String successfully imported.'));
|
||||
}
|
||||
|
||||
|
@ -699,7 +699,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
|
|||
$name = tempnam(file_directory_path('temporary'), "po_");
|
||||
file_put_contents($name, $contents);
|
||||
$options['files[file]'] = $name;
|
||||
$this->drupalPost('admin/config/international/translate/import', $options, t('Import'));
|
||||
$this->drupalPost('admin/config/regional/translate/import', $options, t('Import'));
|
||||
unlink($name);
|
||||
}
|
||||
|
||||
|
@ -845,14 +845,14 @@ class LocaleExportFunctionalTest extends DrupalWebTestCase {
|
|||
// This will also automatically enable the 'fr' language.
|
||||
$name = tempnam(file_directory_path('temporary'), "po_");
|
||||
file_put_contents($name, $this->getPoFile());
|
||||
$this->drupalPost('admin/config/international/translate/import', array(
|
||||
$this->drupalPost('admin/config/regional/translate/import', array(
|
||||
'langcode' => 'fr',
|
||||
'files[file]' => $name,
|
||||
), t('Import'));
|
||||
unlink($name);
|
||||
|
||||
// Get the French translations.
|
||||
$this->drupalPost('admin/config/international/translate/export', array(
|
||||
$this->drupalPost('admin/config/regional/translate/export', array(
|
||||
'langcode' => 'fr',
|
||||
), t('Export'));
|
||||
|
||||
|
@ -870,7 +870,7 @@ class LocaleExportFunctionalTest extends DrupalWebTestCase {
|
|||
// There are two 'Export' buttons on this page, but it somehow works. It'd
|
||||
// be better if we could use the submit button id like documented but that
|
||||
// doesn't work.
|
||||
$this->drupalPost('admin/config/international/translate/export', array(), t('Export'));
|
||||
$this->drupalPost('admin/config/regional/translate/export', array(), t('Export'));
|
||||
// Ensure we have a translation file.
|
||||
$this->assertRaw('# LANGUAGE translation of PROJECT', t('Exported translation template file.'));
|
||||
}
|
||||
|
@ -944,13 +944,13 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase {
|
|||
// Build the JavaScript translation file for French.
|
||||
$user = $this->drupalCreateUser(array('translate interface', 'access administration pages'));
|
||||
$this->drupalLogin($user);
|
||||
$this->drupalGet('admin/config/international/translate/translate');
|
||||
$this->drupalGet('admin/config/regional/translate/translate');
|
||||
$string = db_query('SELECT min(lid) AS lid FROM {locales_source} WHERE location LIKE :location AND textgroup = :textgroup', array(
|
||||
':location' => '%.js%',
|
||||
':textgroup' => 'default',
|
||||
))->fetchObject();
|
||||
$edit = array('translations[fr]' => 'french translation');
|
||||
$this->drupalPost('admin/config/international/translate/edit/' . $string->lid, $edit, t('Save translations'));
|
||||
$this->drupalPost('admin/config/regional/translate/edit/' . $string->lid, $edit, t('Save translations'));
|
||||
_locale_rebuild_js('fr');
|
||||
$file = db_query('SELECT javascript FROM {languages} WHERE language = :language', array(':language' => 'fr'))->fetchObject();
|
||||
$js_file = 'public://' . variable_get('locale_js_directory', 'languages') . '/fr_' . $file->javascript . '.js';
|
||||
|
@ -1058,14 +1058,14 @@ class LanguageSwitchingFunctionalTest extends DrupalWebTestCase {
|
|||
$edit = array(
|
||||
'langcode' => 'fr',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
|
||||
|
||||
// Set language negotiation.
|
||||
$edit = array(
|
||||
'language_negotiation' => LANGUAGE_NEGOTIATION_PATH_DEFAULT,
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/configure', $edit, t('Save settings'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/international/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
$this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
|
||||
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
|
||||
|
||||
// Assert that the language switching block is displayed on the frontpage.
|
||||
$this->drupalGet('');
|
||||
|
@ -1147,7 +1147,7 @@ class LocaleUserLanguageFunctionalTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
|
||||
// Add custom language and disable it.
|
||||
// Code for the language.
|
||||
|
@ -1165,12 +1165,12 @@ class LocaleUserLanguageFunctionalTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix_disabled,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
// Disable the language.
|
||||
$edit = array(
|
||||
'enabled[' . $langcode_disabled . ']' => FALSE,
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language', $edit, t('Save configuration'));
|
||||
$this->drupalPost('admin/config/regional/language', $edit, t('Save configuration'));
|
||||
$this->drupalLogout();
|
||||
|
||||
// Login as normal user and edit account settings.
|
||||
|
@ -1240,13 +1240,13 @@ class LocalePathFunctionalTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
|
||||
// Set language negotiation.
|
||||
$edit = array(
|
||||
'language_negotiation' => LANGUAGE_NEGOTIATION_PATH_DEFAULT,
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/configure', $edit, t('Save settings'));
|
||||
$this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
|
||||
|
||||
// Create a node.
|
||||
$node = $this->drupalCreateNode(array('type' => 'page'));
|
||||
|
@ -1326,7 +1326,7 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
|
||||
// Add disabled custom language.
|
||||
// Code for the language.
|
||||
|
@ -1344,9 +1344,9 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase {
|
|||
'prefix' => $prefix_disabled,
|
||||
'direction' => '0',
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
// Disable second custom language.
|
||||
$path = 'admin/config/international/language';
|
||||
$path = 'admin/config/regional/language';
|
||||
$edit = array(
|
||||
'enabled[' . $langcode_disabled . ']' => FALSE,
|
||||
);
|
||||
|
@ -1356,7 +1356,7 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase {
|
|||
$edit = array(
|
||||
'language_negotiation' => LANGUAGE_NEGOTIATION_PATH_DEFAULT,
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/configure', $edit, t('Save settings'));
|
||||
$this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
|
||||
|
||||
// Set page content type to use multilingual support.
|
||||
$this->drupalGet('admin/structure/node-type/page');
|
||||
|
@ -1495,7 +1495,7 @@ class UILanguageNegotiationTest extends DrupalWebTestCase {
|
|||
$language_string = "In $language In $language In $language";
|
||||
// Do a translate search of our target string.
|
||||
$edit = array( 'string' => $default_string);
|
||||
$this->drupalPost('admin/config/international/translate/translate', $edit, t('Filter'));
|
||||
$this->drupalPost('admin/config/regional/translate/translate', $edit, t('Filter'));
|
||||
// Should find the string and now click edit to post translated string.
|
||||
$this->clickLink('edit');
|
||||
$edit = array(
|
||||
|
@ -1561,7 +1561,7 @@ class UILanguageNegotiationTest extends DrupalWebTestCase {
|
|||
// Setup for domain negotiation, first configure the language to have domain
|
||||
// URL.
|
||||
$edit = array('prefix' => '', 'domain' => "http://$language_domain");
|
||||
$this->drupalPost("admin/config/international/language/edit/$language", $edit, t('Save language'));
|
||||
$this->drupalPost("admin/config/regional/language/edit/$language", $edit, t('Save language'));
|
||||
// Set the site to use domain language negotiation.
|
||||
variable_set('language_negotiation', LANGUAGE_NEGOTIATION_DOMAIN);
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ class PathLanguageTestCase extends DrupalWebTestCase {
|
|||
$edit = array();
|
||||
$edit['langcode'] = 'fr';
|
||||
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
|
||||
|
||||
// Set language negotiation to "Path prefix with fallback".
|
||||
variable_set('language_negotiation', LANGUAGE_NEGOTIATION_PATH);
|
||||
|
|
|
@ -1225,7 +1225,7 @@ class FormatDateUnitTest extends DrupalWebTestCase {
|
|||
'direction' => LANGUAGE_LTR,
|
||||
'prefix' => self::LANGCODE,
|
||||
);
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add custom language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
|
||||
|
||||
// Create a test user to carry out the tests.
|
||||
$test_user = $this->drupalCreateUser();
|
||||
|
|
|
@ -1580,7 +1580,7 @@ function system_rss_feeds_settings() {
|
|||
*/
|
||||
function system_regional_settings() {
|
||||
drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
|
||||
drupal_add_js(array('dateTime' => array('lookup' => url('admin/settings/regional-settings/lookup'))), 'setting');
|
||||
drupal_add_js(array('dateTime' => array('lookup' => url('admin/config/regional/settings/lookup'))), 'setting');
|
||||
|
||||
include_once DRUPAL_ROOT . '/includes/locale.inc';
|
||||
$countries = country_get_list();
|
||||
|
|
|
@ -1914,7 +1914,7 @@ function system_update_7013() {
|
|||
$timezone = 'UTC';
|
||||
}
|
||||
variable_set('date_default_timezone', $timezone);
|
||||
drupal_set_message('The default time zone has been set to <em>' . check_plain($timezone) . '</em>. Please check the ' . l('date and time configuration page', 'admin/settings/regional-settings') . ' to configure it correctly.', 'warning');
|
||||
drupal_set_message('The default time zone has been set to <em>' . check_plain($timezone) . '</em>. Please check the ' . l('date and time configuration page', 'admin/config/regional/settings') . ' to configure it correctly.', 'warning');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ function system_help($path, $arg) {
|
|||
$output .= '<li>' . t('support for enabling and disabling <a href="@themes">themes</a>, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the <a href="@drupal-themes">Drupal.org theme page</a>.', array('@themes' => url('admin/appearance'), '@drupal-themes' => 'http://drupal.org/project/themes')) . '</li>';
|
||||
$output .= '<li>' . t('a robust <a href="@cache-settings">caching system</a> that allows the efficient re-use of previously-constructed web pages and web page components. Drupal stores the pages requested by anonymous users in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, Drupal\'s caching system may significantly increase the speed of your site.', array('@cache-settings' => url('admin/config/development/performance'))) . '</li>';
|
||||
$output .= '<li>' . t('a set of routine administrative operations that rely on a correctly-configured <a href="@cron">cron maintenance task</a> to run automatically. A number of other modules, including the feed aggregator, and search also rely on <a href="@cron">cron maintenance tasks</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) . '</li>';
|
||||
$output .= '<li>' . t('basic configuration options for your site, including <a href="@regional-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@maintenance-mode">maintenance mode</a> for taking your site temporarily offline.', array('@regional-settings' => url('admin/settings/regional-settings'), '@file-system' => url('admin/config/media/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@maintenance-mode' => url('admin/config/development/maintenance'))) . '</li></ul>';
|
||||
$output .= '<li>' . t('basic configuration options for your site, including <a href="@regional-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@maintenance-mode">maintenance mode</a> for taking your site temporarily offline.', array('@regional-settings' => url('admin/config/regional/settings'), '@file-system' => url('admin/config/media/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@maintenance-mode' => url('admin/config/development/maintenance'))) . '</li></ul>';
|
||||
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system/')) . '</p>';
|
||||
return $output;
|
||||
case 'admin/by-module':
|
||||
|
@ -735,6 +735,29 @@ function system_menu() {
|
|||
'page arguments' => array('system_logging_settings'),
|
||||
'access arguments' => array('administer site configuration'),
|
||||
);
|
||||
$items['admin/config/regional'] = array(
|
||||
'title' => 'Regional and language',
|
||||
'description' => 'Regional settings, localization and translation.',
|
||||
'position' => 'left',
|
||||
'weight' => -7,
|
||||
'page callback' => 'system_admin_menu_block_page',
|
||||
'access callback' => 'system_admin_menu_block_access',
|
||||
'access arguments' => array('admin/config/regional', 'access administration pages'),
|
||||
);
|
||||
$items['admin/config/regional/settings'] = array(
|
||||
'title' => 'Regional settings',
|
||||
'description' => "Settings for how Drupal displays date and time, as well as the system's default time zone.",
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('system_regional_settings'),
|
||||
'access arguments' => array('administer site configuration'),
|
||||
'weight' => -10,
|
||||
);
|
||||
$items['admin/config/regional/settings/lookup'] = array(
|
||||
'title' => 'Date and time lookup',
|
||||
'type' => MENU_CALLBACK,
|
||||
'page callback' => 'system_date_time_lookup',
|
||||
'access arguments' => array('administer site configuration'),
|
||||
);
|
||||
|
||||
// Settings.
|
||||
$items['admin/settings/site-information'] = array(
|
||||
|
@ -751,19 +774,6 @@ function system_menu() {
|
|||
'page arguments' => array('system_rss_feeds_settings'),
|
||||
'access arguments' => array('administer site configuration'),
|
||||
);
|
||||
$items['admin/settings/regional-settings'] = array(
|
||||
'title' => 'Regional settings',
|
||||
'description' => "Settings for how Drupal displays date and time, as well as the system's default time zone.",
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('system_regional_settings'),
|
||||
'access arguments' => array('administer site configuration'),
|
||||
);
|
||||
$items['admin/settings/regional-settings/lookup'] = array(
|
||||
'title' => 'Date and time lookup',
|
||||
'type' => MENU_CALLBACK,
|
||||
'page callback' => 'system_date_time_lookup',
|
||||
'access arguments' => array('administer site configuration'),
|
||||
);
|
||||
$items['admin/settings/clean-urls'] = array(
|
||||
'title' => 'Clean URLs',
|
||||
'description' => 'Enable or disable clean URLs for your site.',
|
||||
|
|
|
@ -92,13 +92,13 @@ class TranslationTestCase extends DrupalWebTestCase {
|
|||
*/
|
||||
function addLanguage($language_code) {
|
||||
// Check to make sure that language has not already been installed.
|
||||
$this->drupalGet('admin/config/international/language');
|
||||
$this->drupalGet('admin/config/regional/language');
|
||||
|
||||
if (strpos($this->drupalGetContent(), 'enabled[' . $language_code . ']') === FALSE) {
|
||||
// Doesn't have language installed so add it.
|
||||
$edit = array();
|
||||
$edit['langcode'] = $language_code;
|
||||
$this->drupalPost('admin/config/international/language/add', $edit, t('Add language'));
|
||||
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
|
||||
|
||||
// Make sure we're not using a stale list.
|
||||
drupal_static_reset('language_list');
|
||||
|
|
|
@ -369,7 +369,7 @@ function user_update_7002(&$sandbox) {
|
|||
$ret[] = array('success' => TRUE, 'query' => "Migrate user time zones.");
|
||||
if ($sandbox['user_not_migrated'] > 0) {
|
||||
variable_set('empty_timezone_message', 1);
|
||||
drupal_set_message('Some user time zones have been emptied and need to be set to the correct values. Use the new ' . l('time zone options', 'admin/settings/regional-settings') . ' to choose whether to remind users at login to set the correct time zone.', 'warning');
|
||||
drupal_set_message('Some user time zones have been emptied and need to be set to the correct values. Use the new ' . l('time zone options', 'admin/config/regional/settings') . ' to choose whether to remind users at login to set the correct time zone.', 'warning');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue