2

I have my own site on a German host (still not finished so I cannot link it).

The web site on that host contains a page for donations and the div for the PayPal button is:

<div class="centerDiv">
    <h6>PayPal</h6>
    <form id="donateForm" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
        <input type="hidden" name="cmd" value="_s-xclick">
        <input type="hidden" name="hosted_button_id" value="H57A47NP4KVLW">
        <input id="imageDonate" type="image" src="images/coperonate_now.png" name="submit" alt="PayPal - The safer, easier way to pay online!">
    </form>
</div>

I tried the button in Italy from my mothers phone that has an Italian language and the page was displayed in German. It seems that the language is taken from the location of the host, thus German.

If so, how can I fix it ? if not... how can I fix it ? :)

marco
  • 1,686
  • 1
  • 25
  • 33

3 Answers3

2

Ok, I can answer my self, I just started searching for "paypal donate button language" instead of "paypal always in german" and found the solution.

From a PayPal link:

lc The locale of the login or sign-up page, which may have the specific country's language available, depending on localization. If unspecified, PayPal determines the locale by using a cookie in the subscriber's browser. If there is no PayPal cookie, the default locale is US.

So I added

<input type="hidden" name="lc" value="__ppLang__">

to the div because the website is created dynamically via PHP so __ppLang__ will be replaced with the language tag got from the query.

Hope this helps others.

marco
  • 1,686
  • 1
  • 25
  • 33
1

To expound on marco's answer (I tried it myself and still got German), if you're using PHP, this method works for me:

<?php
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$localeCode = "en_US";
switch ($lang) {
    case "fr":
      $localeCode = "fr_FR";
      break;
    case "it":
      $localeCode = "it_IT";
      break;
    case "en":
      $localeCode = "en_US";
      break;
    default:
      $localeCode = "en_US";
      break;
}
?>

<form id="donateForm" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="H57A47NP4KVLW">
  <input type="hidden" name="lc" value="<?php echo $localeCode; ?>">
  <input id="imageDonate" type="image" src="images/coperonate_now.png" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>

Of course, if you want all languages supported, you would have to add on to that switch statement to account for all of paypals locale codes.

Other References: https://stackoverflow.com/a/3770616/4445768

Community
  • 1
  • 1
Bango
  • 971
  • 6
  • 18
0

For some reason, the lc parameter didn't work for me.

I found the locale.x param when changed the language from the dropdown on the Donate page:

<input type="hidden" name="locale.x" value="en_US">

This also works for the Shareable URL.

mortalis
  • 2,060
  • 24
  • 34