Jump to content

Translate Pay with card or Paypal account


JET-Dev

Recommended Posts

Dear forum,

 

I can't find any way to translate the phrase Pay with card or Paypal account in checkout?

 

I can't find it in BO translate section i also tried with the xml translation file. I'm using PayPal module 3.2.5

 

Anyone who has done this?

 

Best regards,

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

I had the same problem with my PrestaShop 1.5.2 and PayPal module 3.3. I've translated almost everything to Slovak language but the problematic text stayed in English.

I've solved this problem by manual editing the file \modules\paypal\translations.xml where the source of the text is saved.

The strange thing was that the text displayed on my eshop was loaded from

<country iso_code="RE"> part of the file (and I have Slovak and English languages enabled in my front office). Probably you will have the same strange behaviour of your PayPal module.

So if you want to translate the text, just replace the blue text in translations.xml file in this section:

 

...

 

<country iso_code="RE">

<yes>Yes</yes>

<no>No</no>

<payment_choice>Pay with your card or your PayPal account</payment_choice>

<leader>Leader in</leader>

<online_payment>online payments</online_payment>

...

 

If it does not help, you will need to try other languages in this file.

Anyway, someone should fix this bug so that it can be translated in back office.

  • Like 6
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I have 3 languages so the above option doesn't work, it's based on customer country. I don't want it to be dependant on country, but on site language instead.

 

I just have made this text translatable on /modules/paypal/views/templates/front/express_checkout/paypal.tpl

 

{l s='$PayPal_content.payment_choice' mod='paypal'}

and added needed translations to paypal module from translations admin. Remember to update also English translation.

 

Hope they'll fix it in a next upgrade.

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

i personally edited the paypal module so that it takes the current user language instead of the default language :

 

in paypal_abstract.php

   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(strtoupper($this->context->language->iso_code));
   }

 

Then it will use its own translations in translations.xml

 

Maybe iggywebprom solution is better if you want to keep your translations in Prestashop

  • Like 3
Link to comment
Share on other sites

  • 3 months later...

Do you have a solution for the newest prestashop version? (I mean iggywebprom's solution aka {l s='$PayPal_content.payment_choice' mod='paypal'}

).

It seems like the file modules/paypal/views/templates/front/express_checkout/paypal.tpl is not here anymore...

I have only views/template/front/order-confirmation-mobile.tpl, order-confirmation.tpl, order-summary.tpl

do you know where should I put the patch for making this annoying msg translated?

Link to comment
Share on other sites

  • 3 months later...

Another solution that worked for me:

 

1) find this file: \modules\paypal\views\templates\hook\express_checkout_payment.tpl

 

2) create an override here: \themes\yourtheme\modules\paypal\express_checkout_payment.tpl

 

3) go to line 36 and comment out this part {$PayPal_content.payment_choice}, then add a translatable text: {l s='Your translation here' mod='paypal'}

 

 

PS 1.5.4.1

PayPal 3.5.7

  • Like 3
Link to comment
Share on other sites

Found this function in /modules/paypal/paypal.php file:

 

public function getTranslations()

{

$file = dirname(__FILE__).'/'._PAYPAL_TRANSLATIONS_XML_;

if (file_exists($file))

{

$xml = simplexml_load_file($file);

if (isset($xml) && $xml)

{

$index = -1;

$content = $default = array();

 

while (isset($xml->country[++$index]))

{

$country = $xml->country[$index];

$country_iso = $country->attributes()->iso_code;

 

if (($this->iso_code != 'default') && ($country_iso == $this->iso_code))

$content = (array)$country;

elseif ($country_iso == 'default')

$default = (array)$country;

}

 

$content += $default;

$this->context->smarty->assign('PayPal_content', $content);

 

return true;

}

}

return false;

 

Maybe bug is here ?

Link to comment
Share on other sites

  • 8 months later...

Another solution that worked for me:

 

1) find this file: \modules\paypal\views\templates\hook\express_checkout_payment.tpl

 

2) create an override here: \themes\yourtheme\modules\paypal\express_checkout_payment.tpl

 

3) go to line 36 and comment out this part {$PayPal_content.payment_choice}, then add a translatable text: {l s='Your translation here' mod='paypal'}

 

 

PS 1.5.4.1

PayPal 3.5.7

Thank's. That work's for Prestashop 1.5.6.2 and Paypal 3.6.8 too.

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

Another solution that worked for me:

 

1) find this file: \modules\paypal\views\templates\hook\express_checkout_payment.tpl

 

2) create an override here: \themes\yourtheme\modules\paypal\express_checkout_payment.tpl

 

3) go to line 36 and comment out this part {$PayPal_content.payment_choice}, then add a translatable text: {l s='Your translation here' mod='paypal'}

 

 

PS 1.5.4.1

PayPal 3.5.7

 

Could someone please explain what an "override" is?

 

Thanks

BeMike

Link to comment
Share on other sites

  • 3 weeks later...

I had the same problem with my PrestaShop 1.5.2 and PayPal module 3.3. I've translated almost everything to Slovak language but the problematic text stayed in English.

I've solved this problem by manual editing the file \modules\paypal\translations.xml where the source of the text is saved.

The strange thing was that the text displayed on my eshop was loaded from

<country iso_code="RE"> part of the file (and I have Slovak and English languages enabled in my front office). Probably you will have the same strange behaviour of your PayPal module.

So if you want to translate the text, just replace the blue text in translations.xml file in this section:

 

...

 

<country iso_code="RE">

<yes>Yes</yes>

<no>No</no>

<payment_choice>Pay with your card or your PayPal account</payment_choice>

<leader>Leader in</leader>

<online_payment>online payments</online_payment>

...

 

If it does not help, you will need to try other languages in this file.

Anyway, someone should fix this bug so that it can be translated in back office.

Thanks!

 

This worked for me. Its strange, find iso_code="RE" and translate there.

 

Im using prestashop 1.6.0.9 and PayPal module 3.7.2

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

For Prestashop 1.4.7

Find file modules>paypal>views>template>hook>express_checkout_payment.tpl

Replace line 65:

   {$PayPal_content.payment_choice}

 

by:
{l s='$PayPal_content.payment_choice' mod='paypal'}

Force compile and then edit translations in BO (Tools>Translations>Module translations)
(search for "$PayPal_content.payment_choice" and also edit EN language)

Link to comment
Share on other sites

  • 5 weeks later...

Hi,

 

I wanted to try the override translation method for the PayPal phrase "Pay with your card or your PayPal account", but it doesn't seem to work the with latest version of the European PayPal module (version 3.8.1). I'm currently using PS 1.5.6.2. Am I doing something wrong? I can get the phrase to appear in the translations module and translate to any language, but it doesn't translate to the Checkout page.

 

In fact the only phrase that appears is in the PayPal "public_html/shop/modules/paypal/translations.xml" file

 

So here's what I've done...

 

I copied "express_checkout_payment.tpl" (as described in previous comments) to "public_html/shop/themes/mytheme/modules/paypal" and then changed the code at lines 35 to 40 from

 

{if isset($logos.LocalPayPalHorizontalSolutionPP) && $PayPal_payment_method == $PayPal_integral}
<img src="{$logos.LocalPayPalHorizontalSolutionPP|escape:'htmlall':'UTF-8'}" alt="{$PayPal_content.payment_choice|escape:'htmlall':'UTF-8'}" height="48px" />
{else}
<img src="{$logos.LocalPayPalLogoMedium|escape:'htmlall':'UTF-8'}" alt="{$PayPal_content.payment_choice|escape:'htmlall':'UTF-8'}" />
{/if}
{$PayPal_content.payment_choice}
{/if}
 
to
 
{if isset($logos.LocalPayPalHorizontalSolutionPP) && $PayPal_payment_method == $PayPal_integral}
<img src="{$logos.LocalPayPalHorizontalSolutionPP|escape:'htmlall':'UTF-8'}" alt="{!-- $PayPal_content.payment_choice --!l s='Pay with your credit card or PayPal account.' mod='paypal'|escape:'htmlall':'UTF-8'}" height="48px" />
{else}
<img src="{$logos.LocalPayPalLogoMedium|escape:'htmlall':'UTF-8'}" alt="{$PayPal_content.payment_choice|escape:'htmlall':'UTF-8'}" />
{/if}
{$PayPal_content.payment_choice}

{/if}

 

Should there be more? Anything else I seem to change in the same way within this file causes the checkout page to not display.

 

Many thanks for reading,

 

Nick

 

Update: 19th December 2014  - Actually the best solution for me was to use the method posted today by Fandal at this post http://www.prestashop.com/forums/topic/331542-paypal-translate-pay-with-your-card-or-your-paypal-account/?do=findComment&comment=1903466

Edited by Nick Lappage (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hi,

 

Works for PS 1.6.0 and PayPal 3.7 

 

It works with 1.6.11 and PayPal 3.8.1

 

You have to comment out {$PayPal_content.payment_choice} twice in the override .tpl, in lines 36 and 65 more or less, and add {l s='Pay with your card or your PayPal account' mod='paypal'} twice as well, like this:

 

{*$PayPal_content.payment_choice*}
{l s='Pay with your card or your PayPal account' mod='paypal'}

 

Then, the new string 'Pay with your card or your PayPal account' will be translatable, and it will show nicely in the checkout.

 

R

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

i personally edited the paypal module so that it takes the current user language instead of the default language :

 

in paypal_abstract.php

    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(strtoupper($this->context->language->iso_code));
    }
Then it will use its own translations in translations.xml

 

Maybe iggywebprom solution is better if you want to keep your translations in Prestashop

 

This is the original code in Paypal.php but what did you change it to?

Link to comment
Share on other sites

Hi,

 

 

It works with 1.6.11 and PayPal 3.8.1

 

You have to comment out {$PayPal_content.payment_choice} twice in the override .tpl, in lines 36 and 65 more or less, and add {l s='Pay with your card or your PayPal account' mod='paypal'} twice as well, like this:

 

{*$PayPal_content.payment_choice*}

{l s='Pay with your card or your PayPal account' mod='paypal'}

 

Then, the new string 'Pay with your card or your PayPal account' will be translatable, and it will show nicely in the checkout.

 

R

Works great for PS 1.6.0.14, only the file you have to edit in this version is: modules/paypal/views/templates/hook/express_checkout_payment.tpl

Link to comment
Share on other sites

  • 8 months later...
  • 5 months later...

i personally edited the paypal module so that it takes the current user language instead of the default language :

 

in paypal_abstract.php

    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(strtoupper($this->context->language->iso_code));
    }

Hello,

 

This works on 1.6.1.5. latest ;))

 

The text i correct, but i dont have a real picture of Paypal logo, but just ?? ...

What can  do...maybe who know how to change logo there ?

 

Thank you

 

Tadej

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...