Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    How do i set context menu language?

    General and Desktop
    2
    2
    2634
    Loading More Posts
    • 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.
    • S
      SetBetterPass last edited by

      I have a small application with few text fields (QLineEdit) and want to set context menu for them. I have already set default context menu (undo, copy, paste etc.) but i want it in my language (Slovak). Is there some way how to set language for it, change whats in menu or at least overwrite original file where it is set? I have Qt 4.8.0, Qt Creator 2.4.1 and Ubuntu 12.04 if it affect something.

      1 Reply Last reply Reply Quote 0
      • M
        MuldeR last edited by

        As always, install the translator using QApplication::installTranslator();

        Of course, when you create your context menu, you'll have to use tr(), like myMenu->addAction(tr("Copy")) instead of just myMenu->addAction("Copy"), in order to make them translatable. And then you will also have to translate the new strings in your TS/QM file. And: Don't forget to re-translate after installing a new translator!

        My OpenSource software at: http://muldersoft.com/

        Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

        Go visit the coop: http://youtu.be/Jay...

        1 Reply Last reply Reply Quote 0
        • First post
          Last post