Comments (4)
Hi, I assume bash
is picking up John,Doe.pdf
as 2 separate inputs, as the document
subcommand requires 2 positional arguments, one for the input file and one for the output file. See the help output:
$ deepl document --help
usage: deepl document [-h] --to TARGET_LANG [--from SOURCE_LANG]
[--formality {less,default,more,prefer_more,prefer_less}]
[--glossary-id GLOSSARY] [--output-format OUTPUT_FORMAT]
file [file ...] dest
translate document(s)
positional arguments:
file file(s) to be translated.
dest destination directory to store translated files.
optional arguments:
-h, --help show this help message and exit
--to TARGET_LANG, --target-lang TARGET_LANG
language into which the text should be translated
--from SOURCE_LANG, --source-lang SOURCE_LANG
language of the text to be translated; unless using a
glossary, this argument is optional and if it is
omitted DeepL will auto-detect the source language.
--formality {less,default,more,prefer_more,prefer_less}
desired formality for translation
--glossary-id GLOSSARY
ID of glossary to use for translation
--output-format OUTPUT_FORMAT
output file extension
The correct command would probably be deepl --auth-key <zip> document --to=DE "John,Doe.pdf" "John,Doe_TRANSLATED.pdf"
from deepl-python.
Upon rereading, that is kind of what the help states (incorrectly). I will fix the wording here, thanks!
from deepl-python.
I misunderstood dest
as the location of deepl
's output. For some reason I thought deepl would name the translated file something like John,Doe_de.pdf
. That's why I wrongly entered the current directory .
.
from deepl-python.
I just checked the code - the command I suggested works as well, but the intention is to provide a directory (as you can provide multiple documents as input), and it will create one file per input file with the same name in this directory (so, if the file is in the current directory, .
as the output directory might lead to errors, as the paths will collide.)
from deepl-python.
Related Issues (20)
- [Bug] DeepL Write adds sentences describing chosen style
- DeepL documentation states ZH is supported as target for translate_docs but on execution it errors HOT 2
- translate_document_from_filepath fails to recognise XML files HOT 1
- [Feature Request] Make auto-retry toggleable HOT 3
- can't use my auth key, and can't sign up to the API plan for free trial HOT 4
- preserve_formatting missing in translate_document() function HOT 5
- In the translation result, the "left" quotation mark is missing. HOT 1
- Convenient request max retries setup HOT 4
- Encoding problem when translating to french. HOT 2
- New feature : customize timeout duration HOT 2
- Glossaries HOT 1
- deepl.Formality.MORE results in untranslated text HOT 1
- Mismatch in the placement of ignore tags and lack of translation HOT 1
- The deepl.Formality is ignored
- Abnormal strings in translation results: ãã£ã£ãç§ã¡ã¡åã HOT 5
- `translate_document()` should `seek(0, 0)` the output file after being done
- Disambiguate homonyms in glossaries / provide alternative translations? HOT 3
- When translating long English fields into Chinese, the last paragraph was lost
- Glossary flexible search
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepl-python.