In today’s market, people seek personalization. They expect your app to speak their native language. In this article, we will cover how you can translate your Node.js app using a developer-friendly localization platform. Learn about the i18n framework and how to integrate your repository with a localization system to automate Node.js localization.
Make Your App Multilingual and Grow Your Revenue
Language connects people. The same principle is applied to your app development. Having localized versions of your app can grow and generate great revenue for your app by opening new markets.
The internet is somewhat similar to the real world. When you visit a place where no one speaks your mother language, you feel isolated and lost. Making your app multilingual help your customers use it more effectively and opens up opportunities to reach new audiences.
According to a recent study by Preply, most of the top apps in each tech category are also the most language-inclusive ones.
Node.js Web Application Framework
If you choose Node.js as a development environment and are curious about how you can implement localization as a part of your workflow – you’re in the right place.
Node.js i18n: Localization Starting Point
If you plan to create a multilingual version of your app, you should use one of the Node.js internationalization libraries available, for example on Openbase. This article will cover the i18n-node as an example. You may choose another library according to your preferences. They do implement localization functionality pretty much in the same way.
Here are a few first steps you need to take to begin the localization of your Node.js app with i18n-node library.
The first step would be to install the package
Then, create an i18n config object
Before we use the library, we need to configure it.
We added support for 2 languages, with the default one being en (English) and the second one being uk (Ukrainian). View the whole list of all configuration options for the library to learn more.
Node.js i18n: Create an i18n object
Then in the command line, run the following:
This will automatically generate a locales’ directory on the root folder. It will contain the relevant translation strings for the current language:
Add the following line in the index.js to test the generation of translatable strings for the other language:
Rerun the app to verify translations
Automate Node.js Localization with Crowdin
Node.js localization library was created to help and save your time as a developer. However, as you can assume from a small example above, doing the actual translations into multiple languages can still be very challenging, especially for complex apps.
You will face several challenges like making sure that:
- your translators do not edit the same file simultaneously or break the code
- translation values are present for each language
- you don’t have to spend time copy-pasting translations
You don’t have to deal with all the extra work. And why would you if there is a solution? Make localization part of your workflow and forget about those issues.
Integrate Your Repo and Localization Project
Set up an integration with your repo. Crowdin integrates with GitHub, GitLab, Bitbucket, and Azure Repos. You can also install Crowdin Console Client (CLI) which allows you to integrate with GIT, SVN, Mercurial, and more.
Crowdin will get the localization files from your repo and upload them to the Editor, where all strings from your app will look user-friendly and include the comments you provided. Once the translations are done, the system compiles them into a file and syncs them with your code as a merge request. Translations do not get to the master branch before you merge them. You can also integrate multiple branches with Crowdin at the same time, so translators can work with the texts from your feature branch before it’s rolled out, and you can release them into multiple languages at the same time.
In case you have more than one app or several products that share similar features and texts, you can share their translations and avoid translating the same content twice, saving time and money. Usually, iOS and Android app versions have much of the same content. In Crowdin, you can easily detect duplicate strings to reuse their translations.
Localize your product with Crowdin
Use Machine Translation and Translation Memory Pre-Translation
Both machine translation (MT) and translation memory (TM) will help you translate content faster and reduce translation costs. With their help, you can reduce the duration of the project even before the translators begin their work. To do this, configure pre-translation via TM or MT. You can also leverage MT to get translations of non-critical content. To reduce project length, but maintain the quality, you can still use MT, but add machine translation post-editing as the next step. This way your translation team will review auto-generated translations instead of translating everything from scratch.
On Crowdin, you can localize your product with the help of more than 40 machine engines like Microsoft Translator, Google Translate, DeepL Translator. View the list of machine engines you can use with Crowdin today.
Ensure Context for Translators
Simply put, context ensures the quality of the localized version of your app. Crowdin has created a few ways to help you provide context for translators and reduce manual work.
You can provide context using:
- WYSIWYG editor view
- Context for strings. Add text descriptions or labels, use Glossary terms to get relevant translations faster.
- Screenshots. You can upload your game or app screenshots manually or using different integrations or add-ons, like Crowdin SDK for example. This way, translators know the location and context for each string.
- In-Context Localization tool. Translators can work as if in the real app interface and preview the translations they make right there. Translations are stored within your Crowdin project, and you can decide when to pull the strings to your application.
You can learn more about the Crowdin platform by watching a short on-demand demo.
Localize Your Product with Crowdin
Automate localization by internationalizing your texts and integrating your repo with Crowdin New source strings are automatically sent to translators, and you receive translations as a merge after the work is done. Let your customers access your product in several languages. Get started and register a Crowdin account.