In-House Over-the-Air Localizations in a Modular iOS App
Streamlining iOS app localization updates without SDK dependencies.
1Introduction to Localization Challenges
Localizations in iOS apps are traditionally static, embedded within app bundles and requiring full release cycles for updates. This process can delay corrections and new translations by days or weeks, despite the mobile industry's shift towards remote updates for features and UI configurations.
2The Need for Over-the-Air Updates
Just Eat Takeaway.com faced limitations with their chosen localization platform, which lacked an over-the-air (OTA) update mechanism. This necessitated the development of a custom solution that aligns with their modular app architecture, avoiding the constraints of SDK-provided OTA functionalities.
3Designing the Custom OTA Solution
The custom OTA solution was designed to be lightweight, requiring only a small foundation module with minimal dependencies. It allows for runtime string bundle updates with a simple one-line integration per module, ensuring compatibility with the app's modular structure.
4Key Use Cases Driving Development
Three primary use cases guided the development: correcting incorrect translations post-release, faster localization of new features, and enabling Product and Marketing teams to iterate on copy without needing new app releases.
5Operational Goals of the OTA Mechanism
The OTA mechanism aims to download updated string bundles at runtime, apply them on the next cold launch, and ensure minimal network traffic. It also guarantees no partial or corrupted string bundles reach the app, with a transparent fallback to embedded strings when necessary.
6Constraints and Considerations
A critical constraint is the prohibition of reusing string keys with different meanings across app versions to avoid conflicts. The CDN layout supports versioning, minimizing the impact of bad deployments and ensuring consistency across devices.
7Leveraging Existing Bundle Functionality
Instead of building a complex string store, the solution leverages the existing Bundle functionality for locale selection and fallback chains. This approach simplifies the client design by downloading a directory that mimics a resource bundle and passing it to NSLocalizedString.
8Implementation Details
The implementation involves a LocalizableStrings protocol extension, allowing each module to resolve its strings through a custom bundle. The integration requires only a one-line change per module, utilizing the nil-coalescing operator for fallback logic.
9Benefits of Custom OTA Localizations
The custom OTA solution offers significant benefits, including reduced release cycle dependencies, faster translation updates, and greater flexibility for Product and Marketing teams to iterate on app copy without the need for new releases.
10Ensuring Robustness and Reliability
The design ensures robustness by handling locale fallback chains, region variants, and plural rules correctly. It also provides a real kill switch, allowing the app to behave as if the OTA feature was never implemented if necessary.
11Future Enhancements and Considerations
While the current solution does not support live, mid-session string updates, future enhancements could explore this capability. The design's simplicity and modularity make it adaptable to evolving needs and potential new use cases.
12Conclusion and Impact
The in-house OTA localization solution represents a significant advancement in managing iOS app translations. It aligns with Just Eat Takeaway.com's modular architecture, reduces release cycle dependencies, and provides a flexible, efficient mechanism for updating app copy.
Original article: Alberto De Bortoli — In-House Over-the-Air Localizations in a Modular iOS App