How does LT detect language variant?

I realize that LT has optional integration with FastText for language detection. But FastText afaik only detects the language, ie. en vs. de and not locale ie. en-GB vs. en-US. how is this done?

You need to set the preferredVariants parameter (see HTTP API docs).

I was asking more about how it does it inside the source code, ie. what additional steps you take inside the server once you have used FastText to determine the language to then get to a language variant.

You might want to check out TextChecker.detectLanguageOfString().

1 Like