Search code examples
javascriptnode.jslocalizationfile-format

What's the most fastest and readable file format for localization?


I have a website that already has localization to 3 different languages:

  • English (Default)
  • Russian
  • Hebrew

But the locales .json files are big and unreadable

Big .json file of English text

Is there any file format that I can use with Node.js, and it's readable and can be parsed fast?


Solution

  • I would suggest that it is not the fileformat that is the issue, but the tooling that you use to access and manipulate it. A .json file with a nested key structure for your translations is a compact and efficient format for holding translations, and you IDE and build tools work with it by default. Changing it would potentially yield problems elsewhere in your project space.

    So I suggest that you have a look at the tooling available for handling translations like this. And I think what you have here is compatible with BabelEdit.

    This is an editor for your .json files, with features that help you with regards to handling translations.

    Exerpt from their landing page:

    Supports your file formats

    BabelEdit knows the frameworks you use and can directly work on these files. No conversion or export required:

    • json (Angular, React, Laravel, Vue and more)
    • yaml (Ember)
    • php (Laravel translation data)
    • vue (Vue.js single file components)
    • arb (Application Resource Bundle, Flutter)
    • properties (Java, Groovy, Grails,…)

    With this you can easily edit your translations, and give translators access as well. And there are other nice features, such as spell checking.