How to enumerate supported languages?

  • 31 Views
  • Last Post 2 days ago
Leif posted this 1 weeks ago

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.

Anna Savinova posted this 2 days ago

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; }

Close