mashpie / i18n-node

Lightweight simple translation module for node.js / express.js with dynamic json storage. Uses common __('...') syntax in app and templates.
MIT License
3.09k stars 421 forks source link

yml parser TypeScript and locale issues #500

Open gregschroeder opened 2 years ago

gregschroeder commented 2 years ago

I'm very interested in keeping the resource files in YAML rather than JSON format - thanks for that recent addition.

Unfortunately, I was unable to convert due to a couple of issues.

  1. the TypeScript support is out of date (release 0.13 and not 0.15) and does not include the parser directive, so I cannot use with TypeScript projects (without any casts or lots of hacks)
  2. It no longer picks the right locale resource file. I am able to easily set locale (in __ options) with the JSON version and all works correctly. When then only changes I make are to set parser to YAML and convert the resource files to .yml, it correctly gets the right string and does substitutions, but only from the primary (en) file, ignoring the locale setting.