KStandardDirs and locale path
David Faure
faure at kde.org
Thu Jul 18 22:32:03 UTC 2013
On Wednesday 10 July 2013 04:14:19 Sebastian Kügler wrote:
> Hi,
>
> Example code:
>
> const QString translationsPath = package->filePath("translations");
> KGlobal::dirs()->addResourceDir("locale", translationsPath);
> KLocalizedString::insertCatalog(dataEngineDescription.pluginName());
>
> Question:
>
> How to port to QStandardPaths, i.e. where to insert the translations path?
Let's add the possibility to add new search paths to KLocalizedString itself.
This keeps things modular, contrary to the old KStandardDirs solution.
I see two solutions, both for klocalizedstring.h: either a
static void addCatalogSearchPath(const QStringList &path);
or a
static void insertCatalog (const QString &catalogName, const QStringList
&searchPath);
I.e. the question is whether the search path should apply to all catalogs in
the current process (loaded after the call), or should apply to an individual
catalog. In your example code above, I presume the latter would be better.
Want to modify insertCatalog to add this?
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5
More information about the Kde-frameworks-devel
mailing list