lxqt / lxqt-config

Tools to configure LXQt and the underlying operating system
https://lxqt.github.io
GNU Lesser General Public License v2.1
86 stars 60 forks source link

Translation not displayed in "remove palette" dialog #801

Closed stefonarch closed 2 years ago

stefonarch commented 2 years ago

In https://github.com/lxqt/lxqt-config/blob/e4810a3bdacdf980b43c5cd0803f58f2aeb56f87/lxqt-config-appearance/styleconfig.cpp#L372

QMessageBox::StandardButton btn =
            QMessageBox::question(this,
                                  tr("Remove Palettes"),
                                  tr("Do you really want to remove selected palette(s)?\nRoot palettes will remain intact if existing."));
            if (btn != QMessageBox::Yes)

the translations exists (tested it and ru) but aren't displayed

Steps to Reproduce (for bugs)
  1. LANG=it lxqt-config-appearance
  2. Open "carica schema" dialog
  3. Click left button "rimuovi"
  4. popup window appears in english

    Latest git and debian

tsujan commented 2 years ago

Only "Remove Palettes"? The Palettes dialog itself is translated?

stefonarch commented 2 years ago

Neither. schermata-12-12-19-15

tsujan commented 2 years ago

I tested and the problem was only in "Remove Palettes" dialog, not in "Palettes" dialog itself (that was what I wanted to know):

tr

It may have something to do with PalettesDialog being a "local class". Will investigate it.

tsujan commented 2 years ago

Yes, my guess was right. Once I put the translations outside the local class, they were shown:

tr1

Apparently, Qt's translation doesn't work inside local classes. Will make a PR.