[vlc-commits] [Git][videolan/vlc][master] qt: use `QObject::tr()` in `qfut()` macro

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Aug 20 19:40:52 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
367f021c by Fatih Uzunoglu at 2026-08-20T19:25:25+00:00
qt: use `QObject::tr()` in `qfut()` macro

We can do this since f0db1229, and with
7b50365f it would have the advantage of
providing plural context aware translation.

- - - - -


2 changed files:

- modules/gui/qt/qt.hpp
- po/Makevars


Changes:

=====================================
modules/gui/qt/qt.hpp
=====================================
@@ -132,11 +132,11 @@ public:
 
 #define qfu( i ) QString::fromUtf8( i )
 #define qfue( i ) QString::fromUtf8( i ).replace( "&", "&&" ) /* for actions/buttons */
-#define qfut( i ) QString::fromUtf8( vlc_gettext(i) )
+#define qfut( ... ) QObject::tr( __VA_ARGS__ )
 #define qtu( i ) ((i).toUtf8().constData())
 
 /* For marking translatable static strings (like `_()`) */
-#define qtr( i ) qfut( i )
+#define qtr( ... ) qfut( __VA_ARGS__ )
 
 #if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
 #define QtCheckboxChanged  QCheckBox::checkStateChanged


=====================================
po/Makevars
=====================================
@@ -10,7 +10,7 @@ subdir = po
 top_builddir = ..
 
 # These options get passed to xgettext.
-XGETTEXT_OPTIONS = --directory=.. --keyword=_ --keyword=N_ --keyword=_NS --keyword=qtr --keyword=qsTr:1,1t --keyword=qsTr:1,2,3t --keyword=Q_ --language=C++ --keyword=vlc_ngettext:1,2 --keyword=vlc_pgettext:1c,2 --keyword=_PNS:1c,2 --add-comments=xgettext: --from-code=UTF-8
+XGETTEXT_OPTIONS = --directory=.. --keyword=_ --keyword=N_ --keyword=_NS --keyword=qtr:1 --keyword=qtr:1,2,3t --keyword=qsTr:1,1t --keyword=qsTr:1,2,3t --keyword=Q_ --language=C++ --keyword=vlc_ngettext:1,2 --keyword=vlc_pgettext:1c,2 --keyword=_PNS:1c,2 --add-comments=xgettext: --from-code=UTF-8
 
 # This is the copyright holder that gets inserted into the header of the
 # $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/367f021c2930dca027aa4cd8fdc5d9ebf8d2d541

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/367f021c2930dca027aa4cd8fdc5d9ebf8d2d541
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list