Internationalization (i18n) is the process of adapting software for different languages and regions. The goal of internationalization is to develop a product that can be easily localized, by enabling developers to write text in the language of their choice and to use date, number, and currency formats according to the conventions of that language. In order for a website or app to be fully translated into another language, it needs to have all its content translated as well as its interface. This usually includes text strings such as labels, messages, and instructions. Different types of data such as numbers, dates, times, or currencies might also need localization. Internationalization is not just needed in order to localize a product to another vernacular, but it can also help bring in global users who can use the product anywhere. Internationalization is both functional and aesthetic, which means it can often drive more traffic and increase revenue.
A joshing moth, inc. recently received an order to internationalize a chrome extension that has benefited thousands of e-commerce entrepreneurs globally. The chrome extension was launched 3+ years ago and has been a favorite of drop shipping entrepreneurs. The artificial intelligence-powered chrome extension helps e-commerce entrepreneurs find highly profitable products in seconds. It was available worldwide in English only. Although the global supremacy of English is well known, many love to use a software solution in their own language.
The chrome team has published excellent documentation for the internationalization of a chrome extension. The documentation was followed meticulously. We had to list the locales to support. We decided to support 53 locales. The es 419 locale was not in the list of selected locales as it was not supported by the google cloud translation api. En gb & en us was not present in the list of locales supported by the google cloud translation api. It was decided that the content of the en gb and en us folders will be the same as the en folder. We extracted the text content from the chrome extension's front end. The output was a file that contained English strings separated by newlines. We prepared the message strings from the file. The locales directory was prepared with the help of a shell script. We used google cloud translation api for the translation. The messages.json file for every supported locale was prepared with the help of a python program, prepare-messages.py. Some problematic characters were found in the messages.json files and the issue was swiftly resolved by a python program, correction.py . The messages.json files were validated with the help of a shell script (validate.sh) that used jq (jq-linux64).
The chrome extension also had a lot of dynamic content. For that, we decided to develop a proprietary api. We created a node express server on a reputed cloud app platform. It was a wrapper of the google cloud translate api that receives the text and the target language in a request and returns the translated text in response. With both the server-side and client-side modules of the update finished, the chrome extension was submitted to the store for review. The update was approved and the users welcomed the new version. The update was a success. We had a lot of downloads and positive reviews.
Imgae credit: Brett Jordan, pexels.com
Comments
Post a Comment