Skip to content

Instantly share code, notes, and snippets.

@sikmir
Created January 29, 2017 11:05
Show Gist options
  • Save sikmir/ccacea3876e18ba664aa8e4d098c1479 to your computer and use it in GitHub Desktop.
Save sikmir/ccacea3876e18ba664aa8e4d098c1479 to your computer and use it in GitHub Desktop.
QTBUG-57802
#include <QCoreApplication>
#include <QLocale>
#include <QTextStream>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
auto locale = QLocale("eo");
QTextStream(stdout)
<< locale.language() << endl // "1"
<< locale.nativeLanguageName() << endl; // ""
locale = QLocale(QLocale::Esperanto, QLocale::AnyCountry);
QTextStream(stdout)
<< locale.language() << endl // "31"
<< locale.nativeLanguageName() << endl; // "American English"
QTextStream(stdout)
<< QLocale::Esperanto << endl // "32"
<< QLocale::languageToString(QLocale::Esperanto) << endl; // "Esperanto"
return a.exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment