Skip to content

Commit acb3b0a

Browse files
authored
Create README.md
1 parent 81c20fc commit acb3b0a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# @idrinth/typescript-language-from-yaml
2+
3+
This small project handles the conversion of transslation files from yaml to typescript. Install it and run the command `itlfy` to use it.
4+
5+
## check
6+
7+
The check command will check if the yaml files in your current working directory's `language` folder are valid and match. It will error for unparseable files and keys not available in english, while warning if keys are missing in other languages.
8+
9+
`ilfy check` or `itlfy chheck root-folder-name`
10+
11+
## generate
12+
13+
Generate provides typescript language files according to your specification. It only works in your current working directoy's `language` folder and will output to `ssrc/locales` by default.
14+
15+
Options:
16+
17+
- `--strict-types` apply strict types, so that typescript will error on build if the structures missmatch
18+
- `--verbatim-module-syntax` will export the type as a named export instead of a default one
19+
- `--split` splits the language files at the top level keys.. Thhis leads to smaller files when using dynamic imports. Usually you want `--no-translations-file` as well in case of splitting.
20+
- `--no-translations-file` dissables the creation of a translation object containing all languages
21+
22+
## watch
23+
24+
Watching will watch one or more language folders and rebuild the typescript files whenever the yaml files change.If you don't give it a root folder, it will assume the current working directory.
25+
26+
- `ilfy watch rootfolder1 rootfolder2`

0 commit comments

Comments
 (0)