--- uc_paypal.module_old	2009-06-11 15:04:03.000000000 +0200
+++ uc_paypal.module	2009-06-11 15:51:45.000000000 +0200
@@ -471,11 +471,23 @@
         '#default_value' => variable_get('uc_paypal_wps_currency', 'USD'),
       );
       $form['uc_paypal_wps_language'] = array(
-        '#type' => 'select',
-        '#title' => t('PayPal login page language'),
-        '#options' => drupal_map_assoc(array('AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'US')),
-        '#default_value' => variable_get('uc_paypal_wps_language', 'US'),
+        '#type' => 'fieldset',
+        '#title' => t('<strong>PayPal login page language</strong>'),
+        '#description' => t('Associate each language enabled in Drupal with a language available in PayPal.'),
       );
+      foreach (language_list() as $lang_code => $language) {
+        // Skip over any disabled languages.
+        if (!$language->enabled) {
+          continue;
+        }
+        $key = 'uc_paypal_wps_language_'.$lang_code;
+        $form['uc_paypal_wps_language'][$key] = array(
+          '#type' => 'select',
+          '#title' => t($language->name).' ('.$lang_code.')',
+          '#options' => drupal_map_assoc(array('AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'US')),
+          '#default_value' => variable_get($key, 'US'),
+        );
+      }
       $form['uc_paypal_wps_server'] = array(
         '#type' => 'select',
         '#title' => t('PayPal server'),
@@ -792,6 +804,8 @@
 
 // Returns the form elements for the Website Payments Standard form.
 function uc_paypal_wps_form($form_state, $order) {
+  global $language;
+
   $shipping = 0;
   foreach ($order->line_items as $item) {
     if ($item['type'] == 'shipping') {
@@ -869,7 +883,7 @@
     'business' => variable_get('uc_paypal_wps_email', ''),
     'upload' => 1,
 
-    'lc' => variable_get('uc_paypal_wps_language', 'US'),
+    'lc' => variable_get('uc_paypal_wps_language_'. $language->language, 'US'),
 
     // Prepopulating forms/address overriding
     'address1' => substr($order->{$address .'_street1'}, 0, 100),
