G
G
grabbee2020-09-16 17:22:34
Machine translation from one language to another
grabbee, 2020-09-16 17:22:34

Service for determining the text input language. Which one exists?

I don't know how best to proceed. I want to fix what language the user uses. I see two ways
* Look at the user's locale
* Try to determine by text input

What is the best way to proceed? I know Google Translate seems to be able to determine the input language. For money. I don't know what to choose and how to proceed. Help me please.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xotkot, 2020-09-16
@xotkot

I know Google Translate seems to be able to determine the input language. For money. I don't know what to choose and how to proceed. Help me please.

almost all online translators have auto-detection
from Google, if you wish, you can also for free:
curl -s "https://translate.googleapis.com/translate_a/single" --data "client=gtx&dt=t&sl=auto&tl=ru" --data-urlencode "q=你好" | jq -r '.[2]'

Google has code matches - Language support
, but if you need it often and stably, then of course it's better to do it through their paid of.api

R
Roman Mirilaczvili, 2020-09-16
@2ord

Locale is the simplest, this is the language + region.
There are libraries and API services to determine by text.
Search:Language Detection (library OR API)

I don't know what to choose and how to proceed.
We don't know either. Try and choose for yourself.

D
Dimonchik, 2020-09-16
@dimonchik2013

if you don’t want to pay, do it yourself, there are either on Python the same,
and you can practice on the good words "bulba" and "master"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question