Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57802

eo locale is improperly handled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 5.7.1
    • Fix Version/s: 5.12.0
    • Component/s: Core: Locales (i18n)
    • Labels:
      None
    • Commits:
      44b6757fe50b6bf581864d3da519a3ff60818fa8

      Description

      Issues:

      • Instantiating a QLocale with 'eo' gives back the default "C" locale (nativeLanguageName returns empty string).
      • Instantiating a QLocale with QLocale::Esperanto gives back the default 'en' locale (nativeLanguageName returns 'American English').
      #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();
      }
      

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              Eddy Edward Welbourne
              Reporter:
              sikmir Nikolay Korotkiy
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes