KStandardDirs and locale path

Albert Astals Cid aacid at kde.org
Thu Jul 18 22:54:04 UTC 2013


El Divendres, 19 de juliol de 2013, a les 00:32:03, David Faure va escriure:
> 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?

I have no say in the k18n fraemwork, that's Chusslove's but i do think that 
the second suggestion (insertCatalog with two parameters) is a better 
solution.

Cheers,
  Albert


More information about the Kde-frameworks-devel mailing list