Pavol Rašev
Available for remote contractsBook a call
← Blog

Apps and SaaS · updated · 7 min read

Shipping copy changes to mobile apps without a release: how over-the-air translations work

Over-the-air translations let a mobile app download new strings at runtime instead of waiting for an App Store or Google Play release. The design that holds up pins every translation bundle to the app builds it was made for, ships complete strings inside the app as a fallback, caches the last good bundle on the device, and shows changes to testers before everyone else.

The string “You have %d items” becomes “%d items in your basket, %@”. Build 41 passes one argument to a format that expects two "You have %d items" "%d items in your basket, %@" // build 41 passes one argument // to a format that expects two

From July 2022 to July 2023 I worked at Lokalise, a localization platform, on a service that answers one question: an app on someone’s phone asks for its translations, so which ones does it get? The obvious answer is “the latest”. The right answer is “the latest that this build of the app can handle”, and that difference is most of this article.

My part was the interface where teams manage and publish their bundles, a new feature at the time. I also made smaller fixes in the Node.js delivery service and in the export pipelines for the file formats customers’ integrations use. I won’t describe how Lokalise works inside. Everything about their product below comes from their public documentation, and the design rules are the ones I’d use in any app, with a vendor or without one.

What over the air can change, and what it can’t

A typo in the checkout button of a mobile app normally costs a release: a build, a review, and then days or weeks until most users have updated. Over-the-air (OTA) translations skip that. When the app starts, it asks a server whether newer strings exist for its language, downloads them, and shows them instead of the ones it shipped with.

Both stores allow this because strings are data, not code. Apple’s guideline 2.5.2 forbids apps to “download, install, or execute code which introduces or changes features or functionality of the app”. Google Play says an app “may not download executable code (such as dex, JAR, .so files) from a source other than Google Play”. A file of translated text is neither. I’d still keep OTA to copy: guideline 2.3.1 asks that new features and product changes be described to App Review, and a translation update that quietly turns a free trial into a paid one is a product change, whatever file it travels in.

How the strings get swapped depends on the platform. Lokalise’s iOS SDK swizzles the main bundle, so the ordinary NSLocalizedString() calls return downloaded strings without code changes. Their Android SDK wraps the app’s Context and Resources, so getString() does the same. Both docs list the edges, and they are worth knowing before you promise anything to your marketing team:

  • InfoPlist.strings on iOS can’t be replaced at runtime, so the app name and the text in permission prompts (camera, location) still need a release.
  • SwiftUI text has to go through NSLocalizedString() explicitly for the swap to reach it.
  • On Android, text set in custom views has to be refreshed in code.

Why the version matters

Here is the failure that version-aware delivery exists to prevent. Build 42 of your app adds a new screen, so the translation project gets new keys. Someone also reworks an old string: “You have %d items” becomes “%d items in your basket, %@” because build 42 now passes a name too. Translators update every language, and the bundle is published.

Now a phone still running build 41 downloads that bundle. The new keys are harmless, build 41 never asks for them. The reworked string is not harmless. Build 41 passes one argument to a format that expects two, and depending on the platform and the placeholder, the user sees a raw %@, the wrong value or a crash. Not everyone updates the day a release comes out, so this is not an edge case.

The fix is to tie each bundle to the builds it was made for. Lokalise calls this a bundle freeze: you assign a bundle to a range of builds, and their docs give the example of one bundle for builds 0 to 6 and the newest bundle for builds 7 to 12. Two details there are easy to miss. The range uses the build number (CFBundleVersion on iOS, versionCode on Android), not the version users see in the store, because one store version can have several builds. And everything outside a frozen range gets the current production bundle. Phrase does the same with an optional minimum and maximum app version per release.

If you write React Native, you already know this idea from code updates. Expo’s runtime version exists because “runtime versions are a property that guarantees compatibility between a build’s native code and an update”. Translations need the same guarantee, just for text.

Fallback and cache: the app must never wait for the network

The second rule: the app has to work if the OTA server never answers. Lokalise’s docs describe their OTA bundle as containing only the translations modified since the last app release, which tells you what sits under it: the full set of strings inside the app. So the app has to ship complete, current strings in every build. A build with stale strings inside, plus a small update on top, is a build with holes the day the network is down.

The lookup order I’d use:

  1. The downloaded bundle for this build, if there is one.
  2. The last bundle that downloaded and parsed correctly, kept on the device.
  3. The strings shipped in the app.
  4. The base language, if a key is missing in the user’s language.

Then the network side. Check for updates when the app comes to the foreground, not on every screen. Ask with the ETag of the bundle you have (RFC 9110 conditional requests), so “nothing new” costs almost nothing. Never block startup on it. And decide when new text appears: I prefer the next launch or the next screen, because a button that changes its label while someone’s thumb is on it looks like a bug. Retries differ too. Lokalise’s Android SDK retries a failed download up to four times with longer timeouts; their iOS SDK leaves retrying to you.

Plurals belong in the bundle as plurals, not as separate keys someone glues together. English has two forms for whole numbers. Slovak has three: 1 položka, 2 položky, 5 položiek. The Unicode CLDR plural rules list the categories for each language, and the OTA format has to carry all of them, or an update fixes the English and breaks the Slovak.

Rollout: testers first, and a way back

The third rule is about people, not code. Publishing translations should be something a product or content person can do and undo without an engineer, and without opening a support ticket. At Lokalise I built the bundle management interface so publishing translation versions became a self-service step that previously needed support. I mention it because that’s the part teams underestimate: the delivery service can be perfect and nobody uses it if publishing is scary.

The tools for that are simple. First, a prerelease bundle that only test builds receive, so the team sees the new copy on real phones before anyone else; Lokalise’s SDKs have exactly that switch, and production bundles go to everyone else. Second, a history of published bundles, so going back is publishing the previous one, not editing strings in a hurry. Third, a check before publishing that every placeholder in every language matches the base string.

A checklist for your app

This works with Lokalise, Phrase or a service you write yourself.

  1. Ship complete, current strings inside every build. OTA is a patch on top, never the source.
  2. Pin bundles to build numbers, not store versions. When a build changes placeholders or meaning, freeze the old builds on their bundle.
  3. Validate placeholders and plural forms in every language before a bundle is published.
  4. Look up strings in this order: downloaded bundle for this build, last good cached bundle, shipped strings, base language.
  5. Check for updates on foreground with an ETag, never block startup, and apply new text on the next screen or launch.
  6. Keep the app name, permission texts and anything in InfoPlist.strings out of your OTA plans; those need a release.
  7. Publish to a prerelease bundle first, test on real phones, then production, and keep the history so rollback is one click.
  8. Use OTA for copy, not for features or prices. If App Review would want to know, it’s a release.

I build React Native apps for iOS and Android, and the API behind them. FirmFlow is the latest. If your app needs to speak several languages and change its copy without a release, have a look at how I work on mobile apps, then send me a few lines about your app and its languages through the contact form.

Based on

Sources

  1. Apps and SaaS

    One app for the shop floor: how I help a company move its internal processes off paper

  2. Web and security

    A website in every language you sell in: translated URLs, hreflang and what breaks

  3. Working together

    Hiring a remote senior engineer from Central Europe: time zones, contracts, VAT and cost