[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkde-runtime=5D_phonon/platform=5Fkde=3A_Load_transl?=
From:       Harald Sitter <sitter () kde ! org>
Date:       2011-03-01 0:15:07
Message-ID: 20110301001507.2931CA60CB () git ! kde ! org
[Download RAW message or body]

Git commit e0f18c2a963c0d814de9445c63fea6d00d225aab by Harald Sitter.
Committed on 01/03/2011 at 01:14.
Pushed by sitter into branch 'master'.

Load translation catalogs of phonon backends after creating a backend

Only recently we noticed that while some backends (gstreamer and xine)
have translatable strings and appropriate po files for KDE l10n, their
catalogs do not actually get loaded. This is a humble try to fix this.

Before createBackend() returns with a valid backend (i.e. a backend was
found and successfully loaded) it will now insert its catalog into the
global KLocale object, which then results in nicely localized strings.

The catalog name is equal to the library name of the backend (as found
in the backend's desktop file). Therefore it is absolutely essential
that the library name matches the pot file created by a backend.

CCMail: phonon-backends@kde.org
CCMail: kde-multimedia@kde.org

M  +2    -0    phonon/platform_kde/kdeplatformplugin.cpp     

http://commits.kde.org/kde-runtime/e0f18c2a963c0d814de9445c63fea6d00d225aab

diff --git a/phonon/platform_kde/kdeplatformplugin.cpp b/phonon/platform_kde/kdeplatformplugin.cpp
index 1df2be9..c1c7766 100644
--- a/phonon/platform_kde/kdeplatformplugin.cpp
+++ b/phonon/platform_kde/kdeplatformplugin.cpp
@@ -169,6 +169,8 @@ QObject *KdePlatformPlugin::createBackend(KService::Ptr newService)
     }
 
     kDebug() << "using backend: " << newService->name();
+    // Backends can have own l10n, try loading their catalog based on the library name.
+     KGlobal::locale()->insertCatalog(newService->library());
     return backend;
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic