Open Animenosekai opened 1 year ago
Wow, judging by the list, there's a lot of work to be done :smiley:
New Translate Services:
New languages:
Other changes:
New Translate Services:
- [ ] ABBYY Lingvo
New languages:
- [ ] Turkish, Ukranian and Indonesian to DeepL - https://www.deepl.com/en/blog/deepl-welcomes-turkish-and-indonesian
- [ ] Ukranian to Reverso
Other changes:
- [ ] Mypy static type hint support
Added to the list !
@ZhymabekRoman
Here is what is currently happening on the new-models
branch !
Brand new models have been implemented !
They now all include the raw
attribute (which is optional)
Most of them support rich string representation, which can be generated through the __pretty__
method on the Result model :
By passing in the cli=True
parameter, you can even get colors !
The brand new BaseTranslator
New dictionary, example methods and alternative methods have been added !
It natively handles bulk translations, transliterations, ... on everything ! Through the use of typing.overload
, the type checkers automatically know if the return value should be an iterable (if a bulk action) or if it should be a normal result model.
Moreover, the Result
model actually implements __iter__
to avoid mistakes when looping over Translator.translate()
even if a single translation is done.
The iterable returned by bulk actions is a custom LazyIterable
which actually loads things if needed and stores them.
My bad the method is not
transliteration
buttransliterate
... (maybe could alias it ?)
Now I need to modify the actual translators implementations and re-implement Translate
(aggregate translators) using BaseTranslator
Updated all of the translators 🍡
And the Translate
class is working !
Now, it inherits from BaseTranslator
and its code is much simpler 🧃
Wow! @Animenosekai, Great job ✨
TODO: add logger (like loguru)
TODO: Integrate fake-useragent
TODO: avoid def __init__(self, request: Request = Request()):
. See more: https://youtu.be/Cj6O9FUjiAA
Flask warning:
[flake8] [W] Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-ti
me function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
TODO: avoid
def __init__(self, request: Request = Request()):
. See more: https://youtu.be/Cj6O9FUjiAAFlask warning:
[flake8] [W] Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-ti me function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
This is fixed in the new-models
branch
TODO: add logger (like loguru)
The server is going to use nasse
, which already has a custom logger which we could use.
See also: Nasse — Logging
TODO: add logger (like loguru)
The server is going to use
nasse
, which already has a custom logger which we could use.See also: Nasse — Logging
Great job! :rocket:
TODO: Telegram bot :grinning:
TODO: Telegram bot 😀
Hmmmm I'm not sure if this should be done by this repo or in another repo
TODO: Telegram bot 😀
Hmmmm I'm not sure if this should be done by this repo or in another repo
Yeah, maybe in separated repo
Reimplemented HTML translation
The website works again!
Added the Papago translator from Naver
version: 3.0 status: ALPHA
Next
This version provides general improvements over the whole project, bringing exciting new features.
New
website
[^10]Fixes
Updates
dictionary
,example
methods [^5]alternative
method [^5]raw
attribute)Everything is detailed in the
README.md
fileA comparison from the previous release can be found here
v2.3...v3.0
A comparison from the current branch can be found here
v3.0...main
[^1]: We might use Textual for an interactive TUI. We should also default to the interactive TUI when running
translatepy
without any action specified.[^2]: An actual public website was planned but due to the end of Heroku's free service and a lack of resource for now, we are going to stick with the local website (I think?). However the idea is not abandonned and a way of ranking the different translators based on real results is expected in the future.
[^3]: For single word translations ?
[^4]: This provides a way of choosing the translators to use from the CLI (#53) But this also allows choosing the translator from the web server and thus the website.
[^5]: Refer to https://github.com/Animenosekai/translate/discussions/62
[^6]: Following #58
[^7]: Following https://github.com/Animenosekai/translate/issues/28#issuecomment-918746811
[^8]: Following #54
[^9]: Following #28
[^10]: The branch needs to be changed to fit the
main
branch (local website) and to have a CLI access[^11]: Following #66
[^12]: Following #65
[^13]: Following https://github.com/Animenosekai/translate/issues/78#issuecomment-1443529618