Translation of JSON files for dummies.

Let’s simplify the task of translating a JSON file with smaller steps. First, let’s look at the basics.

What is a JSON format?

In short, JSON is a lightweight data-interchange format that is easy for humans to read and write and for machines to parse and generate. JSON files are commonly used to transfer data between systems.

For example, JSON is a format often used to export data from Content Management Systems (CMS) or store app localization data. So, if you want to make your content or app multilingual, your next big task is translating a batch of JSON files.

What does a JSON file look like?

A JSON is a text file with a .json extension containing data in key-value pairs.

The most common format for a key is “key:value”, but other formats are possible, such as “key : value”, “key :” value “,” key:value “, etc.

An example of a simple JSON file looks like this:

{

“language”: “en”, messages”:
{ welcome”: “Hi there!”, message”: “Thank you for joining. Add a picture to your profile now.”, error”: “Operation failed. Please try again later.” 

}

}

Translation of a JSON file

When translating a JSON file, all the keys should remain untranslated, while the values need to be translated.

In the example above, the keys (language, welcome, message, error) would stay the same in all language versions.

The values are:

en

Hi there!

Thank you for joining. Add a picture to your profile now.

Operation failed. Please try again later.

And they should be translated.

There are two ways you can apply a translation to a JSON file:

Manual translation

The first one is to do it manually by editing a JSON file. You can use any text editor for this, but a code editor will be more convenient because it will highlight the words that need to be translated.

You can use a translation tool.

This approach makes the job more accessible because it automatically detects words that need to be translated and provides proposals via a dedicated translation user interface.

In general, a translation tool should be able to import JSON files for translation, pre-translate with an option for translators to correct translations, and export the final translated JSON files.

An additional benefit is having all the files in one place for easy management.

JSON free translator

If your files are relatively small (below 50kB each) and you need them translated automatically but in good quality and for free, read no further but head to this service:

JSON free translator

If you have many JSON files, things get a bit more complicated, and machine translation needs to improve. In this case, you want to engage with a Translation Management System like TextUnited (and engage with their translators too).

TextUnited is a tool that helps you manage your multilingual content. You can use it to translate JSON files and other types of files such as PO, XLIFF, Excel, XML, HTML, docx, etc., and it supports both manual and automatic translation.

How to translate JSON files with TextUnited?

JSON files

 

At TextUnited, there are two approaches to choose from:

File-based translation project

With the first one, you create a new file-based translation project. You may upload one or more JSON files to a project and select as many target languages as you wish. You can create an internal translation project or outsource translation to TextUnited. After translation, you download translated JSON files.

Connecting your versioning repository

The second method is to synchronize content with your BitBucket and GitHub repositories. Users can set up Auto Sync for continuous translation by connecting to a repository. Once your repository is updated with new files, strings will be automatically transported to TextUnited and become available for translation. Translated content can be synced back to the repositories automatically as well.

JSON files

Select content for translation in JSON files.

You can select specific translation elements (JSON keys) in JSON filter settings. This proves to be very helpful in the case of larger JSON files with a lot of different content.

JSON files

However, the situation can also be reversed. You might have a JSON file with only a few keys that need translation. In that case, you don’t need to spend hours excluding all the other keys to start localizing your content. You can choose which keys to include and continue with your work.

The following great news is that you may create and save as many templates as you want. You can apply them to your files after the project has been completed. You do this by opening the project details page and using a filter template from the list.

Conclusions

Translate JSON files easily with TextUnited:
  • Save time by translating files in bulk
  • Use filter settings for fine-tuning the selection of content for translation
  • Keep track of who translated what and when
  • Reuse translations
  • Share translations with other translators

Do you think our hints on translating JSON files are helpful? If that’s the case, start your free trial. If you have further questions, don’t hesitate to contact us – we will gladly answer them.