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. How do i set context menu language?

How do i set context menu language?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.9k 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.
  • S Offline
    S Offline
    SetBetterPass
    wrote on last edited by
    #1

    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
    0
    • M Offline
      M Offline
      MuldeR
      wrote on last edited by
      #2

      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
      0

      • Login

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