Skip to content

DeedMob/transform-translations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Transform translations

This module reconciles translations between local and global files

Usage

node index.js <pathToSearchFolder> <pathToOutputFolder> <supportedLanguageArray> <sourceOfValueTruth: default to "local">

Example Usage

node index.js ../DeedMob ../DeedMob/intl/ en,nl global

Improvements

  • Currently changing path between executions will yield unexpected results, so path would be better relative to the directory, not this directory.

Expectations

  • Source of truth for values of keys (if they have one) is determined by the last argument
  • Throw error message if missing language key
  • Localized is source of truth on which keys there are
  • Alphabetical/deterministic order of object props & keys to minimize git diff problems

Output structure

Should create global files of structure in output

/* en.js

module.exports = { "../AccountForm/translations": { "profile": "User Profile", "account": "User Account" }, "../ProfileForm/translations" : { "vacancy": "Something" } };

*/

About

A node js script that transpiles between local/global translation files for https://github.com/DeedMob/react-local-translations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published