Carta Operum

Journal ◆ Money

Six languages, four currencies, one set of screens

Euro, zloty, koruna and hryvnia at checkout, with no second build of the app.

TicketBus365 speaks six languages and prices trips in four currencies: EUR, PLN, CZK and UAH. Those are two different settings, and mixing them up is the classic mistake. A traveler may read the app in Ukrainian and pay in zloty, because the coach leaves from Warsaw.

Language lives in the usual Flutter localization files. Currency is not a translation. It is a number, a code and a rule for writing them. Every price goes through one function that takes an amount and a currency and returns text, so the symbol position, the decimal separator and the spacing follow the language while the code decides the rest. Nothing else in the app may glue a number to a symbol.

Amounts travel with their currency from the API, and the app never converts between currencies by itself, because an exchange rate is a fact that somebody has to own. The test I trust most is a table: each of the six languages against each of the four currencies, asserting the string. It is twenty-four lines, and it catches every comma I would have missed.