Results 1 to 4 of 4

Thread: Testing automatic language sensing

  1. #1
    Join Date
    Sep 2010
    Location
    Ontario Canada
    Posts
    23
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Maemo/MeeGo

    Default Testing automatic language sensing

    Hello all,
    I should start off by stating I am a beginner programmer!
    I have recently completed my Qt for Symbian app and deployed it to OVI and other various mobile stores.
    I just got my first translation of my application completed in Spanish. Here are the steps I used to add the translation to the application;
    1. Selected File->Release in the Qt liguist tool which created the "applicationName_es.qm" file.
    2. Added "TRANSLATIONS = ApplicationName_es.ts" to the pro file.
    3. Added
      Qt Code:
      1. QString locale = QLocale::system().name();
      2. QTranslator translator;
      3. translator.load(QString("ApplicationName_") + locale);
      4. a.installTranslator(&translator);
      To copy to clipboard, switch view to plain text mode 
      to main.

    Now I would like to see if the translation works...
    My version of Windows7 does not support language packs so I used the RDA to load the app on a symbian device, then switched the devices language to Spanish which I would assume should be now detected as ES and intern load the Spanish version of my app... Unfortunately it does not, only the English version is loaded....

    How do I test if the translated version is working?
    I have tried
    Qt Code:
    1. translator.load("ApplicationName_es.qm");
    To copy to clipboard, switch view to plain text mode 
    and it still shows up in English?
    Any and all help would be greatly appreciated!

    Cheers,
    Jon

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Testing automatic language sensing

    Check what load() returns. Maybe the application simply can't find the translation file. By the way, you can skip the ".qm" part of the file name when calling load().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Location
    Ontario Canada
    Posts
    23
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Maemo/MeeGo

    Default Re: Testing automatic language sensing


    Never mind...
    I needed to embed the qm file into the resource to make it available during runtime...
    Cheers,
    Jon

  4. #4
    Join Date
    Sep 2010
    Location
    Ontario Canada
    Posts
    23
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Maemo/MeeGo

    Default Re: Testing automatic language sensing

    Thanks wysota! You are 100% correct.
    We must have been posting at the same time.
    Cheers,
    Jon

Similar Threads

  1. Testing Qt-Software with a GUI Testing Tool
    By nightghost in forum Qt Programming
    Replies: 8
    Last Post: 22nd February 2012, 08:43
  2. Qt unit testing
    By chandan in forum Newbie
    Replies: 3
    Last Post: 13th July 2010, 20:20
  3. GUI Testing
    By larry104 in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2007, 14:46
  4. testing and testcases
    By sreedhar in forum Qt Programming
    Replies: 3
    Last Post: 7th June 2006, 16:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.