Skip to content

Donates - #359

Merged
biodranik merged 3 commits into
masterfrom
mollie-subscribe
Sep 28, 2026
Merged

biodranik merged 3 commits into
masterfrom
mollie-subscribe

Conversation

@biodranik

Copy link
Copy Markdown
Member

No description provided.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Deploying organicmaps with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5c706d6
Status: ✅  Deploy successful!
Preview URL: https://ed70ee3f.organicmaps.pages.dev
Branch Preview URL: https://mollie-subscribe.organicmaps.pages.dev

View logs

/donate/subscribe/ is a self-hosted donation form that posts to donate-api
and hands the donor to Mollie's hosted checkout; /donate/manage/ lets
someone who lost the management link from their email ask for a new one.
Card details never reach either repo.

The form works with JavaScript disabled — a plain POST that donate-api
answers with a redirect. donate-subscribe.js only improves it: presets that
scale and reformat per currency and interval, a default currency guessed
from the browser's region, inline validation mirroring the server's, and
prefill from ?amount=&interval=&currency= so the app can link straight to a
filled-in form.

All 27 Mollie currencies are offered (RUB stays on the Telegram Tribute
rail). JPY and ISK are zero-decimal; HUF and TWD are restricted to whole
units as well, because PayPal has no sub-unit for either and Mollie rounds
such an amount *up* — a fraction would charge more than the form promised,
on every renewal of a subscription. Amounts may be typed in the donor's own
digits: the presets are Intl-formatted, so the Persian page prints €۲۵ and
the Marathi one €२५, and those are now accepted. The currency table, the
amount grammar and the honeypot field name all mirror donate-api and must
change with it.

_headers gives both pages a strict CSP. The rules are deliberately narrow
rather than one /donate/* rule: /donate/ itself posts to PayPal, which this
form-action would block.

Signed-off-by: Alexander Borsuk <me@alex.bio>
…guage

Both pages in all 33 translations, so every reader reaches a donation form
in their own language and donate-api can return them to it afterwards.

Each page keeps its user-visible strings in `extra.form`, which nothing
translates automatically — translate_md.py rewrites only title and
description — so these were done by hand and proofread. The single-brace
placeholders `{amount}`, `{min}` and `{max}` are substituted at runtime by
literal string replace and had to survive character for character;
translate_review.py now says so explicitly, since an inflected or
quote-wrapped placeholder would silently print itself on the button.

Adding a language here is not enough on its own: SITE_LANGS in donate-api
must list it too, or the donor is returned to the English thank-you page
after paying, with no error anywhere.

Signed-off-by: Alexander Borsuk <me@alex.bio>
translate_md.py rewrites `title:` and `description:` and copies `extra:`
verbatim, and translate_check.py compared only those same two fields — so
user-visible text kept under `extra` was never translated and never
reported. The donation pages keep twenty-odd form labels there, which means
a language added with this repo's own pipeline would ship English buttons
and still be called clean.

The check now walks `extra` recursively, skipping the keys that are the same
in every language by design. Over the corpus it found seven, five of them
real: the Italian top menu said "Donate" and the Occitan one "News" and
"Privacy". Each is fixed here with a word the page's own translation already
uses — "Fai una donazione" from its <h1>, "Novèlas" and "Privadesa" from
their prose and title.

The other two are loanwords that really are the translation, and no textual
test can tell those from a field nobody touched: Occitan "Privacy" and Dutch
"Privacy" looked identical. So a page declares the ones it means, the way
the Ukrainian donation page declares its missing RUB reference:

    extra:
      translation_keeps_source: ["extra.menu_title"]

It is verified rather than obeyed — naming a field the English source lacks,
or one that is no longer identical, is an ERROR — so the declaration cannot
outlive the situation it describes.

CLAUDE.md also documented finding translations with the Tera v1 `filter`
filter, removed in Tera v2 and the source of a build break on this branch;
that, the real scope of translate_md.py, and the two couplings a new
donation-page language needs are now written down.

Signed-off-by: Alexander Borsuk <me@alex.bio>
@biodranik
biodranik merged commit 1658458 into master Sep 28, 2026
4 checks passed
@biodranik
biodranik deleted the mollie-subscribe branch September 28, 2026 17:07

This branch was successfully deployed

1 active deployment
production — 5c706d68 Deployed Sep 28, 2026 by biodranik via Check Zola build #1226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant