Skip to content

Commit

Permalink
feat: add tmx support and change output
Browse files Browse the repository at this point in the history
  • Loading branch information
SethFalco committed Mar 11, 2023
1 parent 4689089 commit 39007ad
Show file tree
Hide file tree
Showing 14 changed files with 331 additions and 1,077 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,4 @@ dist
# Output files
/dataset
/dataset.*
/datasets
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ npm run build
Finally, you can execute the command from the transpiled sources.

```sh
npm run tldr-translation-pairs-gen -- -s {PATH_TO_TLDR-PAGES} -o dataset.csv -O
npm run tldr-translation-pairs-gen -- --source {PATH_TO_TLDR-PAGES}
```

Read the README or help command for more information on how to use this and arguments.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ git clone https://github.com/tldr-pages/tldr.git

### Execute tldr-translation-pairs-gen

Once you have tldr-pages locally, you should be able to point tldr-translation-pairs-gen to the directory using the `--source` argument. This will export a `dataset.xml` file with all mappings that can be found between translated pages.
Once you have tldr-pages locally, you should be able to point tldr-translation-pairs-gen to the directory using the `--source` argument. This will output a file for every combination of languages to the `dataset/` directory, with all alignments that can be found between translated pages.

```sh
tldr-translation-pairs-gen --source {{path/to/sources}}
```

You can also pass a `--output` argument to specify a different file location. The supported file formats are CSV, JSON, and XML, which can be specified by using the appropriate file extension in the output argument.
You can also pass the `--format` argument to specify a different output format. The supported file formats are TMX ([Translation Memory eXchange](https://en.wikipedia.org/wiki/Translation_Memory_eXchange)), XML, CSV, and JSON.

```sh
tldr-translation-pairs-gen --source {{path/to/sources}} --output dataset.json
tldr-translation-pairs-gen --source {{path/to/sources}} --format csv
```

## Excluded Strings
Expand Down
Loading

0 comments on commit 39007ad

Please # to comment.