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

automatic language detection? #11

Open
floating opened this issue May 11, 2011 · 3 comments
Open

automatic language detection? #11

floating opened this issue May 11, 2011 · 3 comments

Comments

@floating
Copy link

I couldn't find an example if this is implemented already, can anyone point me in the right direction?

If it's not implemented I will look into it via the translate api or perhaps there is a trigrams lib.

@Marak
Copy link
Owner

Marak commented May 11, 2011

I think it's already implemented? It looks like I'm defaulting to EN => ES, not sure why.

https://github.com/Marak/translate.js/blob/master/lib/translate.js#L7

Try experimenting a little, maybe remove the defaults from being passed to Google and see if it auto-detects. I think the issue is that auto-detect isn't always 100% accurate and that it's better to just specify your language targets.

Either way, if you can do a little research and let me know the best plan of attack, I'd be glad to write a patch and add the auto-translate option to the library.

Please let me know what you find out, thanks!

  • Marak

@floating
Copy link
Author

There is a call to detect language and it returns reliability/confidence levels that could be useful. It looks like the call you're doing now, with no default set, should auto-detect and return detectedSourceLanguage within the result object. Passing that in addition to text and errors would be good enough for what I'm trying to do.

Also defaulting to auto-detect instead of EN would be more useful in my opinion.

Thanks!

@Marak
Copy link
Owner

Marak commented May 20, 2011

Do you think you could do a pull request for this? Even if it's not perfect it would greatly speed up things on my end.

I'm always looking for people to help maintain projects too... :-)

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

2 participants