Index: uc_ogone_payment.module
===================================================================
--- uc_ogone_payment.module
+++ uc_ogone_payment.module
@@ -222,9 +222,9 @@
   );
   $form['ogone_language'] = array(
     '#type' => 'textfield',
-    '#title' => t('Language'),
+    '#title' => t('Default language'),
     '#default_value' => variable_get('ogone_language', 'en_US'),
-    '#description' => t('Use "en_US" notation for language. See Ogone documentation for details.'),
+    '#description' => t('The default value is used if the language can not be determined. Use "en_US" notation for language. See Ogone documentation for details.'),
   );
   //Layout
   $form['ogone_layout_title'] = array(
@@ -388,7 +388,7 @@
     'EXCEPTIONURL' => $redirect_exceptionurl,
     'FONTTYPE' => $layout_fonttype,
     'HOMEURL' => $url_base,
-    'LANGUAGE' => $language,
+    'LANGUAGE' => _uc_ogone_payment_language(),
     'LOGO' => $layout_logo,
     'ORDERID' => $orderid,
     'OWNERADDRESS' => $customer_address,
@@ -563,4 +563,32 @@
   uc_ogone_return_ok(TRUE);
 }
 
+/**
+ * Dynamicaly set the language variable for the call to Ogone.
+ * 
+ * @param string $lang The languagecode of the language used in drupal that should be used on the Ogone page.
+ */
+function _uc_ogone_payment_language($lang = NULL) {
+  // If no language code is given, get the language code from global.
+  if (!isset($lang)) {
+    global $language;
+    $lang = $language->language;
+  }
+  // Map the drupal language codes with the supported Ogone codes.
+  $code = array(
+    'en' => 'en_US',
+    'fr' => 'fr_FR',
+    'nl' => 'nl_BE',
+    'it' => 'it_IT',
+    'de' => 'de_DE',
+    'es' => 'es_ES',
+    'no' => 'no_NO',
+    'tr' => 'tr_TR',
+  );
+  // If no language is mapped, use the default value.
+  if (!($lang = $code[$lang])) {
+    $lang = filter_xss(variable_get('ogone_language', 'en_US'));
+  }
+  return $lang;
+}
 ?>
\ No newline at end of file
