Localize Stripe links #222

Merged
root merged 1 commit from rt-donation-localize into master 2024-12-24 19:06:39 +00:00
2 changed files with 14 additions and 10 deletions

View file

@ -28,7 +28,6 @@ external_links_target_blank = true
paths = "safe"
[extra]
stripe = "https://donate.organicmaps.app/"
ada = "addr1qxh59080ujswxuzapzrdvuzpglfktg09gq9q7dxpdl7jfka0g27wle9qudc96zyx6ecyz37nvks72sq2pu6vzmlayndsj02qhw"
algo = "3UZXZEPGFAM7E74IO32Y7O6KOY3E7NNNJVBV4GFS5UWQQSY7AIM5PK7C2E"
bch = "qqcjkzf7nlgvhng5vhq7n7hjrcdqccyqlq9h7gq4xw"

View file

@ -1,28 +1,33 @@
{% if lang == 'en' %}
{% set stripe = 'https://donate.organicmaps.app' %}
biodranik commented 2024-03-24 22:46:54 +00:00 (Migrated from github.com)
Review
  1. Do all our langs match stripe langs?
  2. What is the stripe behavior when a lang is not supported there?
  3. Is it possible to enable automatic lang detection without passing an explicit parameter, as it was mentioned on the stripe's documentation page?
1. Do all our langs match stripe langs? 2. What is the stripe behavior when a lang is not supported there? 3. Is it possible to enable automatic lang detection without passing an explicit parameter, as it was mentioned on the stripe's documentation page?
Review
  1. Do all our langs match stripe langs?

They seem to be matching, including composed codes like pt-BR.

What is the stripe behavior when a lang is not supported there?

Stripe auto-detects the language.

Is it possible to enable automatic lang detection without passing an explicit parameter, as it was mentioned on the stripe's documentation page?

Automatic language detection works already out of the box in Stripe. This PR just do all the best to continue with the same language as seen on the web-site. What is the problem with that?

> 1. Do all our langs match stripe langs? They seem to be matching, including composed codes like pt-BR. > What is the stripe behavior when a lang is not supported there? Stripe auto-detects the language. > Is it possible to enable automatic lang detection without passing an explicit parameter, as it was mentioned on the stripe's documentation page? Automatic language detection works already out of the box in Stripe. This PR just do all the best to continue with the same language as seen on the web-site. What is the problem with that?
biodranik commented 2024-03-27 10:32:00 +00:00 (Migrated from github.com)
Review

The problem is that this approach requires some code/support, and may introduce unexpected issues with unsupported languages/wrong parameters, while automatic detection by stripe works automatically and doesn't require any changes.

What are the benefits enabled by merging this PR?

The problem is that this approach requires some code/support, and may introduce unexpected issues with unsupported languages/wrong parameters, while automatic detection by stripe works automatically and doesn't require any changes. What are the benefits enabled by merging this PR?
Review

Sorry, please provide any constructive arguments why this PR shouldn't be merged based on before/after analysis.

Sorry, please provide any constructive arguments why this PR shouldn't be merged based on before/after analysis.
biodranik commented 2024-03-27 23:31:48 +00:00 (Migrated from github.com)
Review

his PR just do all the best to continue with the same language as seen on the web-site. What is the problem with that?

The wrong locale on our website will prohibit Stripe from autodetecting the correct locale that is not supported yet on our website. For example, a Greek user will see en OM website and will see en Stripe instead of el.

P.S. A shortcode can help to avoid copy-paste.

> his PR just do all the best to continue with the same language as seen on the web-site. What is the problem with that? The wrong locale on our website will prohibit Stripe from autodetecting the correct locale that is not supported yet on our website. For example, a Greek user will see en OM website and will see en Stripe instead of el. P.S. A shortcode can help to avoid copy-paste.
Review

The wrong locale on our website will prohibit Stripe from autodetecting the correct locale that is not supported yet on our website. For example, a Greek user will see en OM website and will see en Stripe instead of el.

Our web-site is already localized to almost all locales that Stripe supports. Greek localization will be added eventually if there is a demand. Our web-site and Stripe probably have different logic for auto-detecting locales. Plus our web-site provides explicit language choosers for users. From the user's prospective, the donation page is an integral part of the web-site. Preserving the same locale when navigating from one section of web-site to another sounds reasonable to me.

Not to mention that links to AppStores on this web-site also have includes the locale code (i.e.hl={{ lang }}) since the beginning. Nobody complained, but for flimsy reasons we are not merging this PR.

> The wrong locale on our website will prohibit Stripe from autodetecting the correct locale that is not supported yet on our website. For example, a Greek user will see en OM website and will see en Stripe instead of el. Our web-site is already localized to almost all locales that Stripe supports. Greek localization will be added eventually if there is a demand. Our web-site and Stripe probably have different logic for auto-detecting locales. Plus our web-site provides explicit language choosers for users. From the user's prospective, the donation page is an integral part of the web-site. Preserving the same locale when navigating from one section of web-site to another sounds reasonable to me. Not to mention that links to AppStores on this web-site also have includes the locale code (i.e.`hl={{ lang }}`) since the beginning. Nobody complained, but for flimsy reasons we are not merging this PR.
biodranik commented 2024-03-28 10:27:03 +00:00 (Migrated from github.com)
Review

Any unsupported language will fall back to en on our website. I suggest to use automatic stripe language detection logic for en in this case, to help users see localized stripe pages when their languages are not yet supported on our website.

Any unsupported language will fall back to en on our website. I suggest to use automatic stripe language detection logic for en in this case, to help users see localized stripe pages when their languages are not yet supported on our website.
Review

Updated

Updated
biodranik commented 2024-04-02 08:01:27 +00:00 (Migrated from github.com)
Review
  1. set stripe = config.extra.stripe for easier configurability?
  2. nit: slash at the end.
1. `set stripe = config.extra.stripe` for easier configurability? 2. nit: slash at the end.
{% else %}
{% set stripe = 'https://donate.organicmaps.app/?locale=' ~ lang %}
{% endif %}
<div class="donate_buttons">
{%- if lang == 'ru' %}
<a href="https://donate.organicmaps.app?currency=rub" title="По карте МИР в рублях"><img id="mir" src="/images/donates/mir.svg" alt="По карте МИР в рублях"></a>
<a href="https://t.me/OrganicMapsRu/29441" title="Telegram по карте МИР в рублях"><img id="telegramRu" src="/images/donates/telegram.svg" alt="Telegram по карте МИР в рублях"></a>
{% endif -%}
<a href="{{ config.extra.stripe | safe }}" title="Credit/Debit Card"><img src="/images/donates/visa_mc.svg" alt="Credit/Debit Card"></a>
<a href="{{ config.extra.stripe | safe }}" title="Apple Pay" id="applePay"><img src="/images/donates/apple.svg" alt="Apple Pay"></a>
<a href="{{ config.extra.stripe | safe }}" title="Google Pay" id="googlePay"><img src="/images/donates/google.svg" alt="Google Pay"></a>
<a href="{{ stripe }}" title="Credit/Debit Card"><img src="/images/donates/visa_mc.svg" alt="Credit/Debit Card"></a>
biodranik commented 2024-04-02 08:01:59 +00:00 (Migrated from github.com)
Review

Is safe not needed anymore?

Is `safe` not needed anymore?
<a href="{{ stripe }}" title="Apple Pay" id="applePay"><img src="/images/donates/apple.svg" alt="Apple Pay"></a>
<a href="{{ stripe }}" title="Google Pay" id="googlePay"><img src="/images/donates/google.svg" alt="Google Pay"></a>
<form action="https://www.paypal.com/donate" method="post" target="_blank" title="PayPal">
<input type="hidden" name="hosted_button_id" value="JYM34AADM87V8" />
<input type="image" src="/images/donates/paypal.svg" name="submit" title="Donate to Organic Maps using PayPal" alt="Donate with PayPal button" />
</form>
<a href="{{ config.extra.stripe | safe }}" title="giropay"><img src="/images/donates/giropay.svg" alt="giropay"></a>
<a href="{{ stripe }}" title="giropay"><img src="/images/donates/giropay.svg" alt="giropay"></a>
{%- if lang != 'ru' %}
<a href="{{ config.extra.stripe | safe }}" title="iDeal"><img src="/images/donates/ideal.svg" alt="iDeal"></a>
<a href="{{ config.extra.stripe | safe }}" title="Sofort"><img id="sofort" src="/images/donates/sofort.svg" alt="Sofort"></a>
<a href="{{ stripe }}" title="iDeal"><img src="/images/donates/ideal.svg" alt="iDeal"></a>
<a href="{{ stripe }}" title="Sofort"><img id="sofort" src="/images/donates/sofort.svg" alt="Sofort"></a>
{% endif -%}
<a href="{{ config.extra.stripe | safe }}" title="SEPA"><img src="/images/donates/sepa.svg" alt="SEPA"></a>
<a href="{{ stripe }}" title="SEPA"><img src="/images/donates/sepa.svg" alt="SEPA"></a>
<a href="/donate#bank-transfer" title="Bank Transfer"><img src="/images/donates/bank.svg" alt="Bank Transfer"></a>
<a href="https://liberapay.com/OrganicMaps" title="LiberaPay"><img src="/images/donates/liberapay.svg" alt="LiberaPay"></a>
<a href="https://github.com/sponsors/organicmaps/" title="GitHub Sponsors"><img src="/images/donates/github.svg" alt="GitHub Sponsors"></a>
<a href="https://www.patreon.com/OrganicMaps" title="Patreon"><img src="/images/donates/patreon.svg" alt="Patreon"></a>
<a href="https://opencollective.com/organicmaps" title="OpenCollective"><img src="/images/donates/opencollective.svg" alt="OpenCollective"></a>
<a href="{{ config.extra.stripe | safe }}" title="BanContact"><img src="/images/donates/bancontact.svg" alt="BanContact"></a>
<a href="{{ config.extra.stripe | safe }}" title="EPS"><img id="eps" src="/images/donates/eps.svg" alt="EPS"></a>
<a href="{{ stripe }}" title="BanContact"><img src="/images/donates/bancontact.svg" alt="BanContact"></a>
<a href="{{ stripe }}" title="EPS"><img id="eps" src="/images/donates/eps.svg" alt="EPS"></a>
<a href="/donate#crypto" title="Bitcoin, Ethereum, Monero, Tron, ZCash and other crypto"><img src="/images/donates/bitcoin.svg" alt="Bitcoin, Ethereum, Monero, Tron, ZCash and other crypto"></a>
</div>
<script>