How to enumerate supported languages?

  • 71 Views
  • Last Post 22 June 2017
  • Topic Is Solved
Leif posted this 21 April 2017

Is there a way to enumerate the supported languages (either all languages supported, or only those languages available on the given PC)? What I would like to do is enumerate the languages, get the text strings e.g. "Arabic", and then present the user with a list so they can choose the languages they want when using our front end.

According to the manual, the LanguageIdEnum defines the complete set of supported languages, and each item is easily converted into a Windows LANGID. But I don't see a way to step over the items.

We use the C++ interface to the ABBYY OCR Engine.

Order By: Standard | Newest | Votes
Anna Savinova posted this 25 April 2017

Hello!

You can get available languages list via AvailablePredefinedLanguages of FREngine.

FREngine::IPredefinedLanguagesPtr predefinedLanguages = Engine->GetAvailablePredefinedLanguages();

for (int i = 0; i < predefinedLanguages->GetCount(); ++i) {
    FREngine::IPredefinedLanguagePtr predefinedLanguage = predefinedLanguages->Item(i);

std::cout << predefinedLanguage->GetExternalName() << std::endl; }

  • Liked by
  • Leif
Leif posted this 22 June 2017

Thank you, that does the job. Sorry to take so long to reply.

Close