Transtoyou is an online health platform for patients across Europe and the UK. Patients answer a medical questionnaire or book a video consultation, an independent doctor reviews the request (how it works), and a licensed partner pharmacy delivers the treatment. It runs in 14 languages, on one WordPress multisite with our own theme and plugins.
This post is not about which plugin to install. It is about the rules we had to learn the hard way when one codebase has to behave correctly for 14 languages, a dozen delivery countries and several currencies.
1. One rule, one place
The most expensive bugs we had were never in a single function. They were two places that answered the same question differently.
Example: "can this medicine be delivered to this country?" (our delivery countries and times depend on it) At one point the product page, the cart, the checkout, the search and the pharmacy assignment each had their own version of that answer. Four places, four slightly different rules. A patient could add a product to the cart that the checkout later refused.
We now have one reader per question. The product page, the cart, the checkout and the search all call the same function, and a test fails when a new call site tries to answer the question itself. It sounds obvious. It is the single most valuable rule in our codebase.
2. Never derive meaning from a translated string
On a multilingual site, text is not data. We had code that matched a menu item by its title. It worked in English and silently failed in ten other languages, because every language site translates its menu.
The fix is always the same: match on something that does not get translated. An icon class, a slug from the main site, an ID in a translation group. If you ever write if ( $title === 'Something' ) on a multilingual site, stop.
3. Counts break grammar
"30 days" looks harmless until you translate it. In Romanian you write "30 de zile" but "14 zile". In Polish and Lithuanian the noun changes with the number. A single stored string like %d days cannot be right for every number in every language.
What worked for us:
- Put the number where no noun depends on it: "Days: 30" instead of "30 days".
- Use real plural forms (
_n()in WordPress) where you can. - For the few cases where a number sits in the middle of a sentence, a small helper that knows the rule for that language.
4. Caches and language are a dangerous mix
A page cache serves the same HTML to everyone. If anything on the page depends on the visitor's country, currency or language, the first visitor decides what everyone else sees.
Our rule: a page from the cache never reads a cookie or a session on the server. It renders for the country the site stands for, and a small script corrects prices and availability for the visitor afterwards. Anything else ends up showing a Danish price to a German visitor.
5. Hreflang only works if every language agrees
We had pages that announced their language versions correctly on one site and not on another, which search engines read as conflicts. The lesson: build the list of language versions from one shared source (a translation group table), and print it only on the clean URL of a page, never on a filtered or parameterised view.
6. Make migrations boring
Schema changes used to run on the first request after a deploy. Once, two requests started the same ALTER TABLE at the same moment, and the migration waited on a lock long enough to fill every PHP worker.
Now every migration goes through one runner: it only runs from the command line, cron or the admin, takes a lock, sets a short lock wait, and records its version only after a check that the new columns really exist. A visitor's request never migrates anything.
What I'd tell my younger self
- Write the rule once and make the tests guard that it stays once.
- Treat every translated string as something that will be different tomorrow.
- Assume the cache will show your page to the wrong person, and design for it.
None of this is specific to health. But in health, a wrong answer on a product page is not just a bug. It is a promise to a patient that a pharmacy cannot keep.
I'm Roel, founder of Transtoyou. Happy to answer questions in the comments.
