Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Introduce AUTO as a valid source language #7

Merged
merged 3 commits into from
Aug 5, 2018

Conversation

jonbulica99
Copy link
Contributor

This is my own take at fixing #2.

@@ -3,7 +3,8 @@
from .jsonrpc import JSONRPCBuilder

POST_URL = "https://www2.deepl.com/jsonrpc"
VALID_LANGS = ["EN", "DE", "FR", "ES", "IT", "NL", "PL"]
SOURCE_LANGS = ["AUTO", "EN", "DE", "FR", "ES", "IT", "NL", "PL"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like the language codes to be index independent for better readability. I think for now it's sufficient to define a AUTO_LANG = "AUTO" and set SOURCE_LANGS = TARGET_LANGS + [AUTO_LANG].

@@ -3,7 +3,8 @@
from .jsonrpc import JSONRPCBuilder

POST_URL = "https://www2.deepl.com/jsonrpc"
VALID_LANGS = ["EN", "DE", "FR", "ES", "IT", "NL", "PL"]
SOURCE_LANGS = ["AUTO", "EN", "DE", "FR", "ES", "IT", "NL", "PL"]
TARGET_LANGS = SOURCE_LANGS[1:]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TARGET_LANGS can be defined like the old VALID_LANGS then.

}
if self.src_lang != SOURCE_LANGS[0]:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we can use AUTO_LANG instead to get rid of the index.

"target_lang": self.dst_lang
}
}
if self.src_lang != SOURCE_LANGS[0]:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should use AUTO_LANG, too.

@jonbulica99
Copy link
Contributor Author

It should be fixed now.

@uinput uinput merged commit d6a14b8 into uinput:master Aug 5, 2018
@jonbulica99 jonbulica99 deleted the lang-auto branch August 5, 2018 21:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants