You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage.md
+63-6Lines changed: 63 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,13 +171,20 @@ Below is a detailed explanation of all command-line arguments:
171
171
*Description:* Provides the DeepSeek API key directly.
172
172
*Behind the scenes:* This key is required to make API calls to DeepSeek’s translation service.
173
173
174
-
-**`--folder-language`**
175
-
*Description:* Enables inferring the target language from the folder structure.
174
+
-**`--folder-language`**
175
+
*Description:* Enables inferring the target language from the folder structure.
176
176
*Behind the scenes:* The tool inspects the path components (directory names) of each PO file and matches them against the provided language codes. Supports locale codes (e.g., folder `fr_CA` matches `-l fr_CA` for Canadian French, or falls back to `-l fr` for standard French).
177
177
178
-
-**`--no-ai-comment`**
179
-
*Description:* Disables the automatic addition of 'AI-generated' comments to translated entries.
180
-
*Behind the scenes:***By default (without this flag), every translation made by the AI is marked with a `#. AI-generated` comment in the PO file.** This flag prevents that marking, making AI translations indistinguishable from human translations in the file.
178
+
-**`--default-context CONTEXT`**
179
+
*Description:* Sets a default translation context for entries without `msgctxt`.
180
+
*Behind the scenes:* When the tool encounters PO entries without explicit `msgctxt` context, it applies this default context to provide additional information to the AI. Entries with explicit `msgctxt` always take precedence. Can also be set via the `GPT_TRANSLATOR_CONTEXT` environment variable or `default_context` in `pyproject.toml`.
*Example:*`--default-context "web application UI"` helps the AI understand the context for all translations without specific msgctxt.
183
+
*Note:* Use descriptive context (e.g., "e-commerce product page" rather than just "web") for best results.
184
+
185
+
-**`--no-ai-comment`**
186
+
*Description:* Disables the automatic addition of 'AI-generated' comments to translated entries.
187
+
*Behind the scenes:***By default (without this flag), every translation made by the AI is marked with a `#. AI-generated` comment in the PO file.** This flag prevents that marking, making AI translations indistinguishable from human translations in the file.
181
188
*Note:* AI tagging is enabled by default for tracking, compliance, and quality assurance purposes.
182
189
183
190
-**`-v, --verbose`**
@@ -777,6 +784,54 @@ Translate to German: Save
777
784
778
785
Result: **"Speichern"** (button action) instead of **"Sparen"** (to save money)
779
786
787
+
### Default Context
788
+
789
+
For entries without explicit `msgctxt`, you can provide a default context that applies to all translations:
0 commit comments