It would be nice to have the possibility to set the "PayPal login page language" individually for each language which is activated on a site hosting Ubercart. I have already implemented this feature in my contributed module: Adyen | Ubercart Payment.

How about adding it to the PayPal method delivered with the Ubercart core? I'll start working on a patch...

Attached screenshots of how this part looks in Ubercart now and how it looks in uc_adyen. Feedback welcome.

Comments

xibun’s picture

Status: Active » Needs work
StatusFileSize
new1.99 KB

here we go with a first shot.

but:
- I tried it with the PayPal sandbox and the sandbox always shows up in English. but that might be a sandbox problem?
- why do you currently use a dropdown menu to choose the language? PayPal actually offers more languages - I suggest a text box as used in uc_adyen. agree?

inki’s picture

Wonderful - this solved one of the annoying internationalizatioin issues at my site.
Thanks a lot.

This should definitely be integrated in the module.

Ingo

kingandy’s picture

Rather than manually picking up all the languages in the site and managing the settings for each, this should probably be done by setting the language as an Internationalized Variable. (If nothing else, when a language is deleted the variable will still exist in the system.)

UC_Paypal already has one i18n var, so it would be an easy matter to add a second...

/**
 * Implementation of hook_init().
 */
function uc_paypal_init() {
  global $conf;
  $conf['i18n_variables'][] = 'uc_paypal_wps_checkout_button';
  $conf['i18n_variables'][] = 'uc_paypal_wps_language';
}
kingandy’s picture

That said, personally, I've done this with a form_alter module:

function mymodule_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'uc_paypal_wps_form') {
    // Update the INTERFACE LANGUAGE to the currently-selected one...
    global $language;
    $x = strtoupper($language->language);
    if (in_array($x, array('AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'US'))) {
      $form['lc']['#value'] = $x;
    }
  }
}

The 'if(in_array())' is only there because I got the impression from uc_paypal that those were the only supported languages, if that's not the case (as indicated in #1 above) it could probably be removed.

Does anyone know what language codes PayPal supports, and what happens if they get an invalid one?

YK85’s picture

+1 subscribing
I was wondering if there has been any additional development with this? Thanks

chuckbar77’s picture

+1 subscribing

xibun’s picture

@yaz085: we are now accepting PayPal through Adyen - this solves the problem for us. (http://drupal.org/project/uc_adyen)

longwave’s picture

Status: Needs work » Closed (duplicate)
Enrique.Ruiz’s picture

Priority: Normal » Major
Status: Closed (duplicate) » Active

This is a different issue from #626536, and it was not being dealt with in it, so I reactivated it.

I am not programmer and I dont know how to apply the patch mentioned before. Can anyone post a patched version of uc_paypal please? Help would be appreciated.

I am finishing a multilanguage project (English/Spanish) with i10n and firewing1 solution, and after extensive work now I find that uc_paypal does not allow to use a user selected language with PayPal. It is difficult to believe that nobody has a multilanguage ubercart shop using PayPal. Can it be?

tr’s picture

Priority: Major » Normal
Status: Active » Closed (duplicate)

I fail to see how it is different than #626536: 'PayPal login page language' is incomplete. Regardless, we don't need two issues open. Please post your comments in that other issue, not here.