--- modules/locale/locale.module	2009-12-23 07:28:45.000000000 -0600
+++ modules/locale/locale.module.modified	2009-12-30 16:22:33.000000000 -0600
@@ -151,7 +151,7 @@ function locale_menu() {
     'file' => 'locale.inc',
     'file path' => 'includes',
   );
-  $items['admin/config/regional/language/edit/%'] = array(
+  $items['admin/config/regional/language/edit/%language'] = array(
     'title' => 'Edit language',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('locale_languages_edit_form', 5),
@@ -160,7 +160,7 @@ function locale_menu() {
     'file path' => 'includes',
     'type' => MENU_CALLBACK,
   );
-  $items['admin/config/regional/language/delete/%'] = array(
+  $items['admin/config/regional/language/delete/%language'] = array(
     'title' => 'Confirm',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('locale_languages_delete_form', 5),
@@ -213,7 +213,7 @@ function locale_menu() {
     'file' => 'locale.inc',
     'file path' => 'includes',
   );
-  $items['admin/config/regional/translate/edit/%'] = array(
+  $items['admin/config/regional/translate/edit/%translation'] = array(
     'title' => 'Edit string',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('locale_translate_edit_form', 5),
@@ -222,10 +222,10 @@ function locale_menu() {
     'file' => 'locale.inc',
     'file path' => 'includes',
   );
-  $items['admin/config/regional/translate/delete/%'] = array(
+  $items['admin/config/regional/translate/delete/%translation'] = array(
     'title' => 'Delete string',
-    'page callback' => 'locale_translate_delete_page',
-    'page arguments' => array(5),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('locale_translate_delete_form', 5),
     'access arguments' => array('translate interface'),
     'type' => MENU_CALLBACK,
     'file' => 'locale.inc',
@@ -243,7 +243,7 @@ function locale_menu() {
     'file' => 'locale.inc',
     'file path' => 'includes',
   );
-  $items['admin/config/regional/date-time/locale/%/edit'] = array(
+  $items['admin/config/regional/date-time/locale/%language/edit'] = array(
     'title' => 'Localize date formats',
     'description' => 'Configure date formats for each locale',
     'page callback' => 'drupal_get_form',
@@ -253,7 +253,7 @@ function locale_menu() {
     'file' => 'locale.inc',
     'file path' => 'includes',
   );
-  $items['admin/config/regional/date-time/locale/%/reset'] = array(
+  $items['admin/config/regional/date-time/locale/%language/reset'] = array(
     'title' => 'Reset date formats',
     'description' => 'Reset localized date formats to global defaults',
     'page callback' => 'drupal_get_form',
@@ -969,10 +969,13 @@ function locale_date_format_language_ove
 
 /**
  * Provide date localization configuration options to users.
+ *
+ * @param $language
+ *   A fully populated language object
  */
-function locale_date_format_form($form, &$form_state, $langcode) {
+function locale_date_format_form($form, &$form_state, $language) {
   $languages = locale_language_list('native');
-  $language_name = $languages[$langcode];
+  $language_name = $languages[$language->language];
 
   // Display the current language name.
   $form['language'] = array(
@@ -983,7 +986,7 @@ function locale_date_format_form($form, 
   );
   $form['langcode'] = array(
     '#type' => 'value',
-    '#value' => $langcode,
+    '#value' => $language->language,
   );
 
   // Get list of date format types.
@@ -999,7 +1002,7 @@ function locale_date_format_form($form, 
   }
 
   // Get configured formats for each language.
-  $locale_formats = system_date_format_locale($langcode);
+  $locale_formats = system_date_format_locale($language->language);
   // Display a form field for each format type.
   foreach ($types as $type => $type_info) {
     if (!empty($locale_formats) && in_array($type, array_keys($locale_formats))) {
@@ -1050,14 +1053,14 @@ function locale_date_format_form_submit(
 /**
  * Reset locale specific date formats to the global defaults.
  *
- * @param $langcode
- *   Language code, e.g. 'en'.
+ * @param $language
+ *   A fully populated language object
  */
-function locale_date_format_reset_form($form, &$form_state, $langcode) {
-  $form['langcode'] = array('#type' => 'value', '#value' => $langcode);
+function locale_date_format_reset_form($form, &$form_state, $language) {
+  $form['langcode'] = array('#type' => 'value', '#value' => $language->language);
   $languages = language_list();
   return confirm_form($form,
-    t('Are you sure you want to reset the date formats for %language to the global defaults?', array('%language' => $languages[$langcode]->name)),
+    t('Are you sure you want to reset the date formats for %language to the global defaults?', array('%language' => $languages[$language->language]->name)),
     'admin/config/regional/date-time/locale',
     t('Resetting will remove all localized date formats for this language. This action cannot be undone.'),
     t('Reset'), t('Cancel'));
@@ -1123,3 +1126,29 @@ function locale_form_comment_form_alter(
     $form['language']['#value'] = $language->language;
   }
 }
+
+/**
+ * Auto load language from url wildcard.
+ *
+ * @param $langcode
+ *   A Language code, e.g. 'en'.
+ *
+ * @return
+ *   A fully populated language object or false if no language is found.
+ */
+function language_load($langcode) {
+  return $language = db_query("SELECT * FROM {languages} WHERE language = :language", array(':language' => $langcode))->fetchObject();
+}
+
+/**
+ * Auto load a translation from url wildcard.
+ *
+ * @param $lid
+ *   Unique identifier of this string.
+ *
+ * @return
+ *   A fully populated translation source object or false if no source is found.
+ */
+function translation_load($lid) {
+  return $source = db_query('SELECT * FROM {locales_source} WHERE lid = :lid', array(':lid' => $lid))->fetchObject();
+}

--- includes/locale.inc	2009-12-09 09:35:48.000000000 -0600
+++ includes/locale.inc.modified	2010-01-04 13:40:18.000000000 -0600
@@ -226,11 +226,11 @@ function locale_languages_custom_form($f
 /**
  * Editing screen for a particular language.
  *
- * @param $langcode
- *   Language code of the language to edit.
+ * @param $language
+ *   A fully populated language object.
  */
-function locale_languages_edit_form($form, &$form_state, $langcode) {
-  if ($language = db_query("SELECT * FROM {languages} WHERE language = :language", array(':language' => $langcode))->fetchObject()) {
+function locale_languages_edit_form($form, &$form_state, $language) {
+  if ($language) {
     _locale_languages_common_controls($form, $language);
     $form['submit'] = array(
       '#type' => 'submit',
@@ -426,16 +426,19 @@ function locale_languages_edit_form_subm
 
 /**
  * User interface for the language deletion confirmation screen.
+ *
+ * @param $language
+ *   A fullly populated language object.
  */
-function locale_languages_delete_form($form, &$form_state, $langcode) {
+function locale_languages_delete_form($form, &$form_state, $language) {
 
   // Do not allow deletion of English locale.
-  if ($langcode == 'en') {
+  if ($language->language == 'en') {
     drupal_set_message(t('The English language cannot be deleted.'));
     drupal_goto('admin/config/regional/language');
   }
 
-  if (language_default('language') == $langcode) {
+  if (language_default('language') == $language->language) {
     drupal_set_message(t('The default language cannot be deleted.'));
     drupal_goto('admin/config/regional/language');
   }
@@ -443,13 +446,13 @@ function locale_languages_delete_form($f
   // For other languages, warn user that data loss is ahead.
   $languages = language_list();
 
-  if (!isset($languages[$langcode])) {
+  if (!isset($languages[$language->language])) {
     drupal_not_found();
     drupal_exit();
   }
   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/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'));
+    $form['langcode'] = array('#type' => 'value', '#value' => $language->language);
+    return confirm_form($form, t('Are you sure you want to delete the language %name?', array('%name' => t($languages[$language->language]->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'));
   }
 }
 
@@ -1376,14 +1379,11 @@ function locale_translate_export_po_form
 /**
  * User interface for string editing.
  */
-function locale_translate_edit_form($form, &$form_state, $lid) {
-  // Fetch source string, if possible.
-  $source = db_query('SELECT source, context, textgroup, location FROM {locales_source} WHERE lid = :lid', array(':lid' => $lid))->fetchObject();
+function locale_translate_edit_form($form, &$form_state, $source) {
   if (!$source) {
     drupal_set_message(t('String not found.'), 'error');
     drupal_goto('admin/config/regional/translate/translate');
   }
-
   // Add original text to the top and some values for form altering.
   $form['original'] = array(
     '#type'  => 'item',
@@ -1399,7 +1399,7 @@ function locale_translate_edit_form($for
   }
   $form['lid'] = array(
     '#type'  => 'value',
-    '#value' => $lid
+    '#value' => $source->lid
   );
   $form['textgroup'] = array(
     '#type'  => 'value',
@@ -1430,7 +1430,7 @@ function locale_translate_edit_form($for
   }
 
   // Fetch translations and fill in default values in the form.
-  $result = db_query("SELECT DISTINCT translation, language FROM {locales_target} WHERE lid = :lid AND language <> :omit", array(':lid' => $lid, ':omit' => $omit));
+  $result = db_query("SELECT DISTINCT translation, language FROM {locales_target} WHERE lid = :lid AND language <> :omit", array(':lid' => $source->lid, ':omit' => $omit));
   foreach ($result as $translation) {
     $form['translations'][$translation->language]['#default_value'] = $translation->translation;
   }
@@ -1532,26 +1532,22 @@ function locale_translate_edit_form_subm
  */
 
 /**
- * String deletion confirmation page.
+ * User interface for the string deletion confirmation screen.
+ *
+ * @param $source
+ *  Afully populated translation source object.
  */
-function locale_translate_delete_page($lid) {
-  if ($source = db_query('SELECT lid, source FROM {locales_source} WHERE lid = :lid', array(':lid' => $lid))->fetchObject()) {
-    return drupal_get_form('locale_translate_delete_form', $source);
+function locale_translate_delete_form($form, &$form_state, $source) {
+  if ($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/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'));
   }
   else {
-    return drupal_not_found();
+    return druapl_not_found();
   }
 }
 
 /**
- * User interface for the string deletion confirmation screen.
- */
-function locale_translate_delete_form($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/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'));
-}
-
-/**
  * Process string deletion submissions.
  */
 function locale_translate_delete_form_submit($form, &$form_state) {
@@ -3297,4 +3293,3 @@ function locale_get_localized_date_forma
 
   return $formats;
 }
-

--- modules/locale/locale.test	2009-12-26 10:50:09.000000000 -0600
+++ modules/locale/locale.test.modified	2010-01-04 16:11:37.000000000 -0600
@@ -247,8 +247,7 @@ class LocaleTranslationFunctionalTest ex
     // Assuming we don't have 999,999 strings already.
     $random_lid = 999999;
     $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/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
+    $this->assertText(t('Page not found'), t('Page not found.'));
     $this->drupalLogout();
 
     // Delete the language.
