Skip to content

Splits your translation file into multiple files according to your file structure.

Notifications You must be signed in to change notification settings

alimertcakar/i18n-translation-file-auto-splitter

Repository files navigation

This script splits your translation.json file into multiple files like common.json user-profile.json settings.json etc. (This is determined by folder structure under /pages folder.)
Copy the script to your frontend project, run node index.js.

Notes:

  • If a key is both conflicted (exists in multiple translation files) and unused (not called by any t()) it is not handled anywhere in the pipeline. It can be manually removed. (Feel free to open open up PR)
  • All the files under src are mock files that you can test this script on. You only need the run the index.js file at the root.
  • Some edge cases may not be handled, regex might -not- match all possible t() calls under the sun such as t called with parameter a nested function parameter etc.

About

Splits your translation file into multiple files according to your file structure.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published