Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFonts for internationalisation
Qt 6.11 is out! See what's new in the release blog

QFonts for internationalisation

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 970 Views 2 Watching
  • 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.
  • radioraheemR Offline
    radioraheemR Offline
    radioraheem
    wrote on last edited by
    #1

    I'm trying to get my application to display in different languages (specifically Chinese).

    My application is set to use a non-Chinese font by default (QApplication::setFont(QFont("Open Sans", 12));). The font database contains an entry for Traditional Chinese (QFontDatabase::TraditionalChinese).

    I have defined a translation file in my .pro file "TRANSLATIONS+= \myapptr_cn.ts" and used lupdate, linguist & lrelease to generate myapp_cn.qm, containing some translations.

    When I run my app, the Chinese translated strings just display as empty boxes, presumably as if no font can be found to render the characters. Isn't QT supposed to realise that the default font I set for the application doesn't contain those characters and render them using an appropriate font? Am I missing a step here to allow QT to find/use an alternate font?

    Any help would be greatly appreciated - I can't find any docs detailing how this is supposed to work.

    Thanks!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I might be mistaken but in that case shouldn't you set the font of the app to the Chinese font since the rest of the time you set it to Open Sans ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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 Extensions
      • Unsolved