2

I use the Q_ENUM macro in my code, and then I use the associated QMetaEnum to populate a QComboBox.

Is there any "standard" way to manage the translation of the Q_ENUM keys (retrieved with QMetaEnum::key() method)?

I didn't find anything in the Qt's documentation, and the main problem is to automatically add translations keys in the *.ts files for all keys of the Q_ENUM.

Thanks

Toby Speight
  • 27,591
  • 48
  • 66
  • 103
Aurelien
  • 1,032
  • 2
  • 10
  • 24

1 Answers1

2

You do have to provide the translation keys yourself, with a series of QT_TR_NOOP() expansions, for lupdate to pick them up.

If that's really onerous, you could write a small program to generate a suitable input file for lupdate from your meta-object.

Toby Speight
  • 27,591
  • 48
  • 66
  • 103