Jump to content

PayPal translation problem


Recommended Posts

PayPal in Checkout inserts text “Pay with your card or your PayPal account”

 

I’ve read a couple of threads and people have fixed the default English message by editing translations.xml and adding a section for a missing country code.

 

That will solve the translation for the default country only. It does nothing for a multi-language shop. This module in Prestashop version 1.5.20 seems to ignore the module translation system. Anyone else run into this problem?

  • Like 1
Link to comment
Share on other sites

I have the same problem...

Our web is in 4 languages, and by no reason PayPal is in Spanish all time.

The default language of the web is Catalan, all traducctions are OK... but in English, French, Spanish and Catalan, all time shows Spanish text...

Is this some api function?

  • Like 1
Link to comment
Share on other sites

Kristian, it appears no one bothered to plug the module into the existing PayPal translations. Must be a reason for that. Hopefully it is on someone’s to do list. Personally I have found 2 less than ideal work around.

  1. I renamed prestashop\modules\paypal\translations.xml to xxxtranslations.xml

This gets rid of it all together and leaves only the PayPal graphic.

  1. You can edit the default located at the top of the file, translations.xml.

Change line 7 to the words you would like, but this only solves you default language problem.

Edited by Bill Dalton (see edit history)
Link to comment
Share on other sites

I think the problem came from the function loadLangDefault()

This function uses the Country set in the Configuration page of the PayPal module to get the translations.

I'm doing a modification to get the iso_country by language.

 

something like this

id_lang iso_country

1 GB

2 DE

3 ES

...

 

With this and changing a litle bit this function it will work, I will tell you something

Link to comment
Share on other sites

I have found the "solution", change in paypal_abstract at line ~1233

   private function loadLangDefault()
   {
    $paypal_country_default = (int)Configuration::get('PAYPAL_COUNTRY_DEFAULT');
    $this->default_country = ($paypal_country_default ? (int)$paypal_country_default : (int)Configuration::get('PS_COUNTRY_DEFAULT'));
    $this->iso_code = $this->getCountryDependency(Country::getIsoById((int)$this->default_country));
   }

 

By

private function loadLangDefault()
   {
 global $cookie;
 $id_lang = (int)$cookie->id_lang;

 // Default country Catalonia
 $paypal_country_default = 245;

 // Englis to United Kingdom
 if($id_lang == 1)
  $paypal_country_default = 17;
 // Spanish to Spain
 if($id_lang == 4)
  $paypal_country_default = 6;
 // French to France
 if($id_lang == 5)
  $paypal_country_default = 8;
 // Catalan to Catalonia
 if($id_lang == 7)
  $paypal_country_default = 245;
    $this->default_country = ($paypal_country_default ? (int)$paypal_country_default : (int)Configuration::get('PS_COUNTRY_DEFAULT'));
    $this->iso_code = $this->getCountryDependency(Country::getIsoById((int)$this->default_country));
   }

 

You can see here that my country ID's are hardcoded.

Id of the language to the id of the country!

 

An other advice, if you have smething like me (I have the catalan language and country, and my ISO is CAT) you have to add your country iso, in the lang.xml, and edit the function getCountryDependency to get the correct response. Its easy, only copy and paste the same of other country and edit it,

 

Hope it helps!

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...