excerpt |
---|
If you're building a mobile app or website, chances are that you need to manage translations for multiple languages. In this post I want to show how to use a free tool called "Localeasy", to use Google Sheets to store and manage your translation strings |
If you're building a mobile app or website, chances are that you need to manage translations for multiple languages. There are many complicated paid platforms that you can use to do this, but in this post I want to show you a free alternative: Localeasy.
With Localeasy you can use Google Sheets to store and manage your app translations. This has many benefits such as easy user management, change tracking, comments, no limits on contributors, and best of all: it's free of charge!
In this post I will show you how you to integrate Localeasy with your project. For this example we will use two languages: English and Dutch.
The first step is to create a new Google Sheet which will contain all translations in all the languages that you support. I've already created a template that you can duplicate: Template sheet. Go ahead and duplicate it, it should look something like this:
-
The key column will hold the key of the translation.
-
The en and nl columns will hold the English and Dutch translations respectively.
-
The comment column can be used to add an optional comment to the row.
Go to the Share options of your sheet, and enable the public view-only link. This ensures that Localeasy can access it.
There is no need to install or configure anything locally! Simply make a GET request to https://localeasy.dev/generate with the required query parameters, and get a formatted localization file in return.
Make sure you include the following query parameters
sheet: The ID of the Google Sheet that contains your translations. format: The format of the translation file that you want to receive. For example: cocoa-strings locale: The locale that you want to receive.
curl "https://localeasy.dev/generate?sheet=1lf71Q7J_By6_X46u-wisU5G3KoZx_uD8PX4PkYyVzOk&format=json&locale=en&nest-by=.&variant=web"
The process of managing your translations is now much easier. Just make a change to the Google sheet, call the Localeasy endpoint, and Localeasy will take care of the rest!