[mythtv] Translation of uPnP root info
Nigel Pearson
nigel at ind.tansu.com.au
Wed Dec 19 03:27:54 UTC 2007
On 05/12/2007, at 8:23 PM, Daan de Beer wrote:
> I would like to make a patch to translate the strings returned by
> the uPnP
> server.
I am not 100% sure that the backend has a language setting
at the time the UPnP server is created, but if it does,
you just need to create the UPnpCDSExtension non-statically
with QObject::tr("english string").
e.g. modify the constructors, or create an Init method:
UPnpCDSRootInfo * UPnpCDSMusic::g_RootNodes = NULL;
...
UPnpCDSMusic::Init()
{
g_RootNodes = new UPnpCDSRootInfo[3];
g_RootNodes[0].title = QObject::tr("All Music");
g_RootNodes[0].column = "*";
g_RootNodes[0].sql = "SELECT song_id as id, name, 1"
" as children FROM music_songs"
" song %1 ORDER BY name";
g_RootNodes[0].where = "";
...
}
It could be done in the server (e.g. UPnpCDSExtension::ProcessAll()),
but that means the strings in the source code would not be picked up
by the translate helper, i18n/lupdate
Good luck!
--
Nigel Pearson, nigel at ind.tansu.com.au|"Reality is that which,
Telstra Net. Eng., Sydney, Australia | when you stop believing
Office: 9202 3900 Fax: 9261 3912 | in it, doesn't go away."
Mobile: 0408 664435 Home: 9792 6998 | Philip K. Dick - 'Valis'
More information about the mythtv-dev
mailing list