@magic-works/i18n-codegen

A code generator for strongly-typed i18n resources

Usage no npm install needed!

<script type="module">
  import magicWorksI18nCodegen from 'https://cdn.skypack.dev/@magic-works/i18n-codegen';
</script>

README

Usage

i18n-codegen [command]

Commands:
  i18n-codegen gen  Generate the i18n files

Options:
      --help     Show help                                             [boolean]
      --version  Show version number                                   [boolean]
  -c, --config   Specify a different configuration file
                                      [string] [default: "./.i18n-codegen.json"]
      --cwd      Current working directory                              [string]
  -q, --quite    Don't write to stdout                [boolean] [default: false]

TODO

i18next parser

  • Support nested namespace

i18next generator

  • Support generation for nested namespace
  • Support count?
  • Support interpolation like author.name, should generate as { author: { name: string } }