[vlc-devel] [PATCH] Add possibility to translate Qt-native text via gettext

Mario Speiß 1034-135 at online.de
Sun Jan 6 18:06:07 CET 2013

On 06.01.2013 12:43, Rémi Denis-Courmont wrote:
> Le samedi 5 janvier 2013 23:21:15, Mario Speiß a écrit :
>> This class makes all Qt-translations go through vlc gettext api (i.e.
>> context menu of QLineEdit can be translated now with vlc po-files)
> It sounds nice, but I don't understand how this can work. The Qt4 translatable
> strings are not in the vlc text domain.

I think the strings of all Qt-native API normally would be translated 
via compiled *.qm-files using QTranslator. Does VLC provide these 
*.qm-files for the Qt-native API (i.e. context menu of QLineEdit etc.)?

So, if not, this small class can be used to redirect "any" Qt-native API 
through vlc-gettext. Obviously the strings to be translated will have to 
be provided in the vlc text domain, but they "can" be translated now. 
Simply add the Qt-native string ("&Undo" for example) as msgid along 
with its translation and voila the QLineEdit context menu speaks your 

I agree that translating all the Qt-native api is not a good idea but to 
me it looks ugly having an otherwise localized application using english 
context menus etc. Maybe someone has an idea of how to integrate the Qt 
translations automatically to the corresponding vlc text domain.


More information about the vlc-devel mailing list