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

probot-translate-comments #45

Open
bogas04 opened this issue Feb 23, 2018 · 11 comments
Open

probot-translate-comments #45

bogas04 opened this issue Feb 23, 2018 · 11 comments

Comments

@bogas04
Copy link

bogas04 commented Feb 23, 2018

Detect language of commenter/OP and translate it using Google translate/Bing, or at least post link to it (if APIs aren't open/rate limited).

Default languages (not to translate) can stored as a closed issue, which the bot can look up for.

Something like:
"probot/translate-comments/default-languages en-us,es"

@JasonEtco
Copy link
Member

JasonEtco commented Feb 23, 2018

This is an awesome idea! I'd love to see auto-detect so that it just works passively. Maybe a config file to denote the destination language for that repo, so that it isn't always translating to English by default? And even using <details> to say "Translated from ____"

@bogas04
Copy link
Author

bogas04 commented Feb 23, 2018

Hi @JasonEtco,

Thanks for taking time to read this through. I didn't like the idea of config file as it's kinda intrusive to the codebase, I mean JS world is going #0CJS lol. I guess you misunderstood the closed issue thingy. So the maintainer can create an issue with some format, which probot app can fetch and parse to get required stuff. This way it doesn't affect the code base/commit lot and can be tweaked by updating that closed issue.
But anyway, we can store those details somewhere (issues/file).

<details> is really nice to avoid noise.

@JasonEtco
Copy link
Member

Typically, config files for GitHub/Probot Apps are stored in the repo's .github folder, so the codebase isn't touched much and it'd be handled in one commit.

Personally, I'd rather have my project's config as part of the codebase than somewhere in an issue that is liable to get lost, but its up to you 🤷‍♂️

For what its worth, #0CJS is awesome, but that doesn't mean it shouldn't be configurable at all; smart defaults, like having the default translation destination be English, would be good enough for most projects (I'm guessing)

@bogas04
Copy link
Author

bogas04 commented Feb 23, 2018

Oh, I wasn't aware that we already use config files in certain cases, in that case let's go with a config file. Yeah, the issue thing is kinda hacky anyway.

Regarding defaults, while English is good enough, we can probably do slight search to figure that out as well. The major pain point would be to detect what language given string is in. Once we settle for its logic/npm module, we can use same on, umm, commit history, to find top language and use it as target/destination language. Sounds good?

@JasonEtco
Copy link
Member

Once we settle for its logic/npm module, we can use same on, umm, commit history, to find top language and use it as target/destination language. Sounds good?

That'd be really, really cool! Since it'd be per repo, and you wouldn't want to do that search on every comment, you'd probably want to have the app make a PR adding the config file when its installed. This also has the benefit of introducing the maintainers to the app, and to have them check to make sure that the proposed language is correct, as a second human check.

@bogas04
Copy link
Author

bogas04 commented Feb 23, 2018

Amazing!

Plan:

  • onInstall: raise a PR adding a config file with set defaults.
    • Figure out default language (destination language) for the repo from commit history. Multiple languages can be added in case maintainers are bilingual.
  • onMerge: Once merged, comment on same PR in some foreign language just to test.
  • Use <details> to have cleaner comments instead of spamming the thread with paragraphs of poor translation.

This bot would do a lot of work;

  • Detect language from a string
  • Read commit history
  • Raise PR
  • Detect when a particular PR is merged, comment on it
  • Comment whenever a comment with foreign language is found with translated text/link.
  • We'll have to make sure it doesn't translate itself to avoid infinite loops, yet it must allow one test comment from itself.

@Rahmeen14
Copy link

Hi! My teammate @Akshitaag and I would love to take this issue up as a part of our RGSoC proposal!
Additionally @bogas04 is our coach for RGSoC so we'll have a great time making this bot! :)

@Akshitaag
Copy link

Yes, we would love to work on this issue. @gr2m what are your thoughts?

@gr2m
Copy link
Contributor

gr2m commented Feb 24, 2018

Sure, fee free to add it to your submission :)

@vidu171
Copy link

vidu171 commented Dec 17, 2018

@Rahmeen14 @Akshitaag was any submission made on this?. If it's a work in Progress I'd love to contribute.

@Rahmeen14
Copy link

Hi @vidu171 !
There hasn't been any progress on this issue yet. Please go ahead with the implementation. Feel free to reach out for any help. Cheers!

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

No branches or pull requests

6 participants