i18n-xlsx
Typesafe i18n
This module tries to solve problem of managing i18n data via transpiling excel files with i18n data into other typesafe formats. Currently supported formats are:
- Typescript
- Go
Installation
npm install -g i18n-xlsx
Tutorial (Typescript)
- Create excel file with i18n data:
Header should contain code
column and list of supported languages (in this case hr
and en
).
Library also supports multiple sheets.
- Use
i18n-xlsx
to create typescript file
i18n-xlsx -i translations.xlsx -o i18n.ts
Check i18n.ts
file. It will have following output.
; ;
- Use generated code
; console.logi18n.en.sheet1.testKey1; // typesafe + intellisense
License
MIT