Skip to content

Commit

Permalink
update readme, typo
Browse files Browse the repository at this point in the history
  • Loading branch information
genox committed Jan 27, 2024
1 parent d0b9d07 commit fd5503b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ yarn add -D @tegonal/qwik-speak-deepl
Run the translator with the following command from the root of your qwik project:

```bash
# Runs with default options. This will determine the default language
# from your vite config and translate the source files to all available languages.
npx qwik-speak-deepl -a <deeplApiKey>
```

## A word on context

Single word strings are notoriously difficult to translate correctly without context.

For better translation quality, you can create a text file that is used to provide context for the translator in the root of your qwik project named `qwik-speak-deepl.context.txt` (or any other name, see command arguments). The contents of this file will be sent alongside each translation request. Additionally, all strings of the source language are added to context as well for good measure, to provide DeepL with the best possible starting point to find translations for single word strings.

The context file could contain a general summary of the kind of app you are building or its functionality. You can try different approaches and see what works best for you. For e-commerce, it could contain a list of brand or product names.

## Options

```bash
Expand All @@ -36,7 +46,7 @@ Options:
-c, --contextFile <path> A text file with context for better quality translations (default:
"qwik-speak-deepl.context.txt")
-nc, --noCache Don't use the existing cache (default: false)
-f --formality <level> Formality level to use. Available options are 'less' or 'more' (default:
-f, --formality <level> Formality level to use. Available options are 'less' or 'more' (default:
"less")
-h, --help display help for command
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Qwik Speak Deepl Translator",
"author": "Oliver Studer <[email protected]>",
"license": "MIT",
"version": "1.0.2",
"version": "1.0.3",
"type": "module",
"main": "./dist/index.js",
"bin": "./dist/qwik-speak-deepl.js",
Expand Down
2 changes: 1 addition & 1 deletion src/bin/qwik-speak-deepl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ program
)
.option('-nc, --noCache', "Don't use the existing cache", false)
.option(
'-f --formality <level>',
'-f, --formality <level>',
"Formality level to use. Available options are 'less' or 'more'",
'less',
)
Expand Down

0 comments on commit fd5503b

Please sign in to comment.