QLocale request from country language to language name from this country German (de)
Code:
QTextToSpeech *tessi = new QTextToSpeech(this);
QVector<QLocale> localein = tessi->availableLocales();
out << "QTextToSpeech availableLocales \n";
foreach
(const QLocale &locale, localein
) { int nr = (int)locale.language();
.
arg(QLocale::languageToString(locale.
language())) .arg(locale.bcp47Name()));
out << "Lang Found:" << nr << "-" << name;
out << "\n";
}
out << "end... \n";
out.flush();
How i can get the correct name from country self & language...
the result is :
Lang Found:31-English (en)
Lang Found:58-Italian (it)
Lang Found:114-Swedish (sv)
Lang Found:37-French (fr-CA)
Lang Found:42-German (de) but i wand "Deutsch"
Lang Found:48-Hebrew (he)
....... and other...
to get first 3 letter from https://github.com/tesseract-ocr/langdata
to download is data key... text key unicode qchar ecc...
example if i have the 3 first letter German ger not corect is deu "deutsch" its here a way? or write from hand a translate...
Re: QLocale request from country language to language name from this country German (
i solved whit a long long switch ... :p
Code:
switch(id) {
/* 8 - Arabic الْعَرَبيّة */
case 8 : nt = QTUTF8decode("\xD8\xA7\xD9\x84\xD9\x92\xD8\xB9\xD9\x8E\xD8\xB1\xD9\x8E\xD8\xA8\xD9\x8A\xD9\x91\xD8\xA9");
ctess= QStringLiteral("ara");
break;
/* 28 - Czech ÄeÅ¡tina */
case 28 : nt = QTUTF8decode("\xC4\x8D\x65\xC5\xA1\x74\x69\x6E\x61");
ctess= QStringLiteral("ces");
break;
/* 29 - Danish dansk */
case 29 : nt = QTUTF8decode("\x64\x61\x6E\x73\x6B");
ctess= QStringLiteral("dan");
break;
/* 42 - German deusch */
case 42 : nt = QTUTF8decode("\x44\x65\x75\x73\x63\x68");
ctess= QStringLiteral("deu");
break;
/* el - 43 - Greek - Greece ελληνική/0 \xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAE */
case 43 : nt = QTUTF8decode("\xCE\xB5\xCE\xBB\xCE\xBB\xCE\xB7\xCE\xBD\xCE\xB9\xCE\xBA\xCE\xAE");
ctess= QStringLiteral("null"); //// not having dir
break;
/* 31 - English */
case 31 : nt = QTUTF8decode("\x65\x6E\x67\x6C\x69\x73\x68");
ctess= QStringLiteral("eng");
break;
/* 111 - Spanish castellà */