Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for English to Other Language translation support #34

Open
sandyydk opened this issue Sep 18, 2022 · 2 comments
Open

Add support for English to Other Language translation support #34

sandyydk opened this issue Sep 18, 2022 · 2 comments
Labels
question Further information is requested

Comments

@sandyydk
Copy link

sandyydk commented Sep 18, 2022

I propose adding support for translation from English to any other language. This can be useful while trying to convey something in other languages or just for fun. This is intended not be used to translate entire text or document but only for small use cases like wanting to translate say a number 50 in English to Hindi and for such scenarios.

The feature would use .translate to initiate it. It should accept the text in English to translate and the target language to which it should be translated. The format could be something like

dig hello-hindi.translate @dns.toys

or if we intend to support multiple words with a size limit then it could be like

dig hello_world.translate @dns.toys

where multiple words are separated by an "underscore". Hopefully underscore is a valid character in DNS.

The feature should consist of two services, .dice and .random. The first service should accept requests in the standard format kdn(+m.)dice, where k, n and m are numbers. For example:

Do let me know if this makes any sense. @knadh
I can work on this if this is approved and this is my first try at contributing to open source. If there's something else I can pick up would be glad to try it out as well. Thanks in advance.

@knadh
Copy link
Owner

knadh commented Sep 19, 2022

Thanks for the suggestion @sandyydk. Where would the data for translation come from?

@knadh knadh added the question Further information is requested label Sep 19, 2022
@sandyydk
Copy link
Author

Thanks for the suggestion @sandyydk. Where would the data for translation come from?

We could get it from Google translate by forming the URL this way for example

https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=hi&dj=1&dt=t&ie=UTF-8&q='how are you'

This repo shows a sample implementation

https://github.com/bregydoc/gtranslate

This is a hacky way to do it. Been using it for some time just to play around. API keys of say Google or Microsoft lets you make 50k requests per month after which it should be blocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants