Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Get language ISO-639 from Locale::Language
Qt 6.12 LTS is out! See what's new in the release blog

Get language ISO-639 from Locale::Language

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    Can I get the language code (iso-639) as a string given a Locale::Language ?

    Will this way always work:

    QLocale::Language language = settings.getUiLanguage();
    QLocale myLocale(language);
    QString str = myLocale.name();
    str = str.mid(0,str.indexOf('_'));
    
    RatzzR 1 Reply Last reply
    0
    • ? A Former User

      Can I get the language code (iso-639) as a string given a Locale::Language ?

      Will this way always work:

      QLocale::Language language = settings.getUiLanguage();
      QLocale myLocale(language);
      QString str = myLocale.name();
      str = str.mid(0,str.indexOf('_'));
      
      RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by
      #2

      @AlaaM
      You check here for details .

      --Alles ist gut.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved