Margarita Shvetsova
Posted by Margarita Shvetsova
on 12/2/21 9:15 AM

Understanding Translation of JSON files

Localization is an absolute must if you want your product to be accessible to a wide international audience. However, it would take too much time to download all the content, manually separate the code from the text, translate it, and upload it back. To make things easier,  developers use common localization file formats.

JSON is the go-to format for many cases when you want to prepare your content for localization. Here is a trick though: how do you translate these files? The thing is, JSON is a type of semi-structured data and it requires some experience/knowledge to process it by separating the translatable content from the rest of the file. Hence, your best option is professional localization services that provide both speed and quality. Below, we will explain how exactly JSON files need to be translated and will have a look at available JSON translation tools.

What is a JSON file and why do you need it?

JSON (aka JavaScript Object Notation) is a data-interchange format that uses human-readable text for data storage and transmission. The JSON file format allows developers to easily download and upload app or website content across different platforms which contributes to saving time on converting the content from one format to another.

When we say cross-platform, we mean that JSON is quite universal in terms of its use cases. It can be viewed as a data storage container and because of that, it is independent of platforms and can be used for work with applications, games, websites, etc. 

JSON for i18n and l10n: benefits and challenges

JSON is great for localization simply because it’s a universal file format that runs on different platforms. Hence, the biggest benefit of JSON is the fact that it’s cross-platform and you don’t need to tweak your content for a new platform every time.

There are, however, several important aspects to keep in mind. Since both developers and content managers work with JSON files, it’s easy to mess up with a JSON translation object or make a mistake that will ruin the app’s work. Here is a list of the biggest considerations about JSON schema localization to keep in mind:

  • One should never edit text right in the JSON since it’s really easy to mess up. An example would be a content manager editing files right after the developers and forgetting a semi-colon or putting wrong quotations. As a result, the file will not work or the text will not be displayed properly.

  • Sometimes JSON recognizes specific text symbols as special characters during content parsing. These special characters have to be escaped in order for them to be identified as a text for translation and to avoid receiving errors during file processing. To screen a character, you should replace an apostrophe with a backslash. Also, you should put a comma after each .json string (except the last one) or the file will be invalid.

  • It is important to keep the IDs of resource files unique, so always check for the doubles and edit them if needed.

Order Localization

Machine translation vs professional translation

As we mentioned above, there are two options for JSON language translation: machine translation and professional translation. While many people believe that machine translation is good enough, it’s not very reliable. And despite neural machine translation (NMT) quality constantly growing, it still has a long way to go. Professional translation, on the other hand, adds a human factor so specialists can pick up the best-fitting word and adapt to a jargon of a certain region, for example. 

So how do you choose between these options? Judging by our experience, we can recommend the following: use machine learning for those internal projects that do not require exceptional quality and that would take too much time to be translated by professionals. For example, if you have massive manuals, it would be too expensive to translate them with the help of people. In this case, NMT will provide a somewhat decent translation, which is mostly understandable at best.

But if you translate content aimed at clients (external projects), professional translation is your choice. The thing is, professional translators can spot the tiniest differences in meanings of words and know the intricacies of different languages, thus making the text sound more natural.

JSON and Gitlocalize

Since most software projects are kept in GitHub, the first translation option to mention would be JSON translation via Gitlocalize. Gitlocalize is an automated localization platform that allows developers to easily translate needed text without too much manual work. Here is how Gitlocalize works:

  • You select your GitHub repository to integrate with the Gitlocalize platform.

  • After the integration, Gitlocalize will pull the target files from your repo to the platform and will translate them.

  • Once you see that files are translated, you can send a review request to the team.

  • After the translation is reviewed and approved, send a pull request back to the repo, and you are done!

In this way, the only thing that developers need to pay attention to is to check the pull requests and that’s it. So it’s safe to say that Gitlocalize is a valuable tool to use, especially if your developers do not know how to approach translations properly.

Using Google Translate API or another Online JSON Translator

Google offers an easy and developer-friendly way to translate JSON files. Think of it as of online JSON translator. All you have to do is install the Google Translate API plugin and specify which languages are used and which folders the text should be stored in. In this way, you set up the plugin and explain where you want to store your translations. Once this is done, Google will take care of the rest by automatically plugging into its database of machine translations, translating the needed text, and creating a new file with the obtained translation.

In this way, Google almost completely eliminates manual work when you use it to translate JSON online. Sure, there can be certain imperfections but if you choose Google API translation, you normally don’t expect flawless translations. In this way, you receive a “good enough” translation and you prefer to sacrifice quality for speed.

Using professional localization tools

Choosing one of the professional localization tools such as Crowdin is probably the best option when you put quality first. While they also provide results fairly quickly, they also offer great quality due to the professional translators involved. Here are just a few features that make Crowdin efficient for JSON localization

  • Developer friendly localization;

  • Automation of the majority of processes;

  • An option to add screenshots for context;

  • An option to communicate with all team members in one place;

  • Well-organized continuous organization workflow.

Crowdin was designed with usability in mind and many Alconost clients claim that it’s their top choice among similar tools for continuous localization. Therefore, for large external projects, be it a game, website, or mobile app, Crowdin is a really good choice.

Conclusion

As you can see, there are several options for translating JSON files and every option is suitable for specific use cases. Let’s have a look at each once again:

  • Gitlocalize: automated and quick. A perfect choice if your project is stored in GitHub and your developers can’t pay too much attention to translations.

  • Neural machine translation: quick, average quality, fully automated. Great for translating massive text where “good enough” quality is needed.

  • Professional translation: the best option for translating mobile apps and games, highly accurate, 100% adapted to different user groups. The best choice for providing an exceptional user experience.

As you can see, your choice will depend on the type of project and your goals. All three options support JSON so either way, you won’t have to worry about the process of translation since it will be either automated or handled by experienced professionals. 

Need help with translation or localization?

Contact us