globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 605 forks source link

MessageFormat Module - How to Manage Translation Files In Practice #902

Open nkosi23 opened 4 years ago

nkosi23 commented 4 years ago

I am new to globalizejs. I am trying to figure out the most appropriate workflow to manage translation files. Say initially I create a translation file for locale A, I then compile it into a JavaScript module using the messageformat module. Now I want to add support for a new locale to my application (locale B). My questions are:

  1. Is there a way to automatically generate a "pseudo-translation" file for the new locale (a file containing the keys of the localeA file and the only thing needed is to replace the values)
  2. Initially, the first point could be achieved by copy-and-pasting the locale A translation file, however things become more complicated as I continue to develop my application and add entries to the locale A translation file. How can I ensure that I do not forget to add the new entries to the locale B file? Is there any tool helping keep everything in sync? That would be awesome.