With the increasing demand for mobile applications, there is also an increasing need to manage the texts of the applications through a simple content management system. Wouldn't it be cool, not having to develop a CRUD and API in the backend just for being able to dynamically change the texts in the mobile application? And being able to deliver that in multiple languages too?
Google Spreadsheets
It may not be very obvious at first, but Google Spreadsheets offer a way of accessing the data in the same JSON format, as we’re used to use for data transfer between standard backend and frontend applications.
After publishing the spreadsheet to web, we can use a special URL to access the data in this format, which looks like this:
We can read this format from a mobile app and display the translations accordingly.
It should be noted: This data is then publicly accessible (just like the app which would show the data), therefore it is not advised to place any sensitive information in there.
Applications
We used this approach for the mobile app LEXI and it has proven easy to use. This app offers a lot of informational texts and supports 13 languages.
The app contains a version of the translations that was available at the time of the most recent update.
Whenever a user launches the app, it fetches the latest translations and caches them locally, so that the app works also without internet connection.
Flutter
Although managing text files via Google Spreadsheet generally works in any framework, we are using it for Flutter in particular. As we previously wrote in the blog post about Flutter, it is a great way to create modern-looking mobile applications. Flutter has been getting a lot more traction in the recent years and since Flutter 2, it’s now possible to even use it for creating Web and Desktop applications.
Since we've been increasingly relying on Flutter for app development lately, and we already have a collection of apps to fall back on, we wanted to make integrating such a text translation system as easy as possible. That's why we created an open source library for Flutter, which can also help you with a similar project.
Sometimes it’s not necessary to build every tool yourself and it’s possible to leverage existing tools to help with the task. Using Google Spreadsheet for this use case has proven to be an easy way how to handle texts and translations in mobile apps.