Git Product home page Git Product logo

Comments (24)

Animenosekai avatar Animenosekai commented on July 3, 2024 1

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.

This is fixed in the new-models branch

def __init__(self, session: typing.Optional[request.Session] = None, services_list: typing.Optional[typing.List[BaseTranslator]] = None, fast: bool = False):

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024 1

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

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024 1

Btw @ZhymabekRoman if you look at 5817dd6 I reorganized the CLI a bit (needs a bit more work) and I created a TUI using Textual

Screenshot 0005-08-23 at 02 21 16 Screenshot 0005-08-23 at 02 21 34 Screenshot 0005-08-23 at 02 21 50 Screenshot 0005-08-23 at 02 22 11 Screenshot 0005-08-23 at 02 23 07

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024 1

Reimplemented HTML translation

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024 1

The website works again!

Screenshot 0005-08-26 at 19 45 05

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024 1

Added the Papago translator from Naver

Screenshot 0005-08-28 at 20 06 23

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024 1
  • TODO: new service - quillbot (I have tried to implement this. However, we may need to bypass Cloudflare security first)

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

Wow, judging by the list, there's a lot of work to be done 😃

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

New Translate Services:

  • ABBYY Lingvo

New languages:

Other changes:

  • Mypy static type hint support

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024

New Translate Services:

  • ABBYY Lingvo

New languages:

Other changes:

  • Mypy static type hint support

Added to the list !

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024

@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)

Screenshot 0005-03-02 at 18 32 07

Screenshot 0005-03-02 at 18 30 47

Most of them support rich string representation, which can be generated through the __pretty__ method on the Result model :

Screenshot 0005-03-02 at 18 33 35

By passing in the cli=True parameter, you can even get colors !

Screenshot 0005-03-02 at 18 33 52

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.

TRANSLATEPY_SCREEN_REC.mp4

My bad the method is not transliteration but transliterate... (maybe could alias it ?)

Now I need to modify the actual translators implementations and re-implement Translate (aggregate translators) using BaseTranslator

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024

Updated all of the translators 🍡

Screenshot 0005-03-03 at 00 24 47

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024

And the Translate class is working !

Now, it inherits from BaseTranslator and its code is much simpler 🧃

Screenshot 0005-03-03 at 01 11 48

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

Wow! @Animenosekai, Great job ✨

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

TODO: add logger (like loguru)

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

TODO: Integrate fake-useragent

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

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.

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

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! 🚀

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

TODO: Telegram bot 😀

from translate.

Animenosekai avatar Animenosekai commented on July 3, 2024

TODO: Telegram bot 😀

Hmmmm I'm not sure if this should be done by this repo or in another repo

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

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

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024

Btw @ZhymabekRoman if you look at 5817dd6 I reorganized the CLI a bit (needs a bit more work) and I created a TUI using Textual

Wow! 😯 Great job @Animenosekai ! I like this!

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024
  • TODO: Introduce custom Request class with undetected-chromedriver backend to bypass bot detection algorithms with original Chrome fingerprints

from translate.

ZhymabekRoman avatar ZhymabekRoman commented on July 3, 2024
  • TODO: add Arabic to DeepL

from translate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.