Results 1 to 3 of 3

Thread: language in library

  1. #1
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default language in library

    hi,
    im using qt in debian. im creating a custom widget for using inside qtcreator. i want to give some language settings in my custom widget.
    i tried the following ,
    in plugin class, i added
    Qt Code:
    1. myTablePlugin::myTablePlugin( QObject* parent )
    2. : QObject(parent) {
    3. QTranslator *translator = new QTranslator(this);
    4. QVariant v=translator->load(":/myLang.qm");
    5. qApp->installTranslator(translator);
    6. }
    To copy to clipboard, switch view to plain text mode 

    after this, i created the .so file and copied to qt/bin/designer folder.
    when i drag n drop my widget , In the user application , I can able to see the caption in local language.

    but after running the application i cant able to see the language. i can see only the english captin.

    pls guide me, how to set the language in plugin

    pls guide me,
    Bala

  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: language in library

    The resouce is embedded in the plugin binary but the final application does not link with the plugin but rather with the widget code directly so the resource is not there. Forcing the translator like that is a bad idea. Instead deploy the message catalog as a separate file and let your users install the translator themselves should they wish to do it.
    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. The following user says thank you to wysota for this useful post:

    BalaQT (7th March 2011)

  4. #3
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: language in library

    Thanks master for ur time and answer. will try as you said. Will get back to you soon.

    Thanks
    Bala

Similar Threads

  1. Replies: 2
    Last Post: 19th February 2011, 12:26
  2. Language of QFileDialog
    By cevou in forum Qt Programming
    Replies: 1
    Last Post: 7th May 2010, 01:55
  3. 1.3.0 - UI Language
    By Asperamanca in forum Qt Tools
    Replies: 2
    Last Post: 16th December 2009, 12:19
  4. greek language
    By eem in forum Qt Tools
    Replies: 0
    Last Post: 6th July 2009, 17:15
  5. How can I add any other language
    By ethos0714 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 22nd February 2006, 03:51

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.