diff --git a/README.md b/README.md index 1b7d320..b9af6b0 100644 --- a/README.md +++ b/README.md @@ -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 ``` +## 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 @@ -36,7 +46,7 @@ Options: -c, --contextFile 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 Formality level to use. Available options are 'less' or 'more' (default: + -f, --formality Formality level to use. Available options are 'less' or 'more' (default: "less") -h, --help display help for command diff --git a/package.json b/package.json index 417967e..c014df8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Qwik Speak Deepl Translator", "author": "Oliver Studer ", "license": "MIT", - "version": "1.0.2", + "version": "1.0.3", "type": "module", "main": "./dist/index.js", "bin": "./dist/qwik-speak-deepl.js", diff --git a/src/bin/qwik-speak-deepl.ts b/src/bin/qwik-speak-deepl.ts index b1870c1..0f15a19 100644 --- a/src/bin/qwik-speak-deepl.ts +++ b/src/bin/qwik-speak-deepl.ts @@ -11,7 +11,7 @@ program ) .option('-nc, --noCache', "Don't use the existing cache", false) .option( - '-f --formality ', + '-f, --formality ', "Formality level to use. Available options are 'less' or 'more'", 'less', )