Commit 1f1734af authored by Dries's avatar Dries

- Patch #552958 by Gábor Hojtsy: create 'regional and language' section in...

- Patch #552958 by Gábor Hojtsy: create 'regional and language' section in 'configuration and modules'.
parent 2a123f0a
......@@ -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'),
);
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -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');
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment