From kde-core-devel Sun Nov 21 08:30:35 2010 From: Volker Krause Date: Sun, 21 Nov 2010 08:30:35 +0000 To: kde-core-devel Subject: Re: Helping libraries load their own translation catalogs Message-Id: <201011210930.42048.vkrause () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=129032848909618 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart11238047.9jsM90psQk" --nextPart11238047.9jsM90psQk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 21 November 2010 01:46:53 Albert Astals Cid wrote: > Hi, one of the problem we find every so often in KDE-land is that our > libraries properly extract their translation messages to a .po file but > then the application using those libraries forget they have to add a line > like > > KGlobal::locale()->insertCatalog("libkdepim") > > Which means the application is unfortunately shown untranslated to the > user. > > Here comes a patch that tries to fix that by moving the catalog loading > responsability to the library, that is in my opinion where it should live. > > Which this patch, your library would just have somewhere > > K_CATALOG_LOADER(libkdepim); > > and then all the programs linking to your library would automagically get > the libkdepim catalog loaded. > > It achieves that by creating a static that instructs KGlobal to load a > given translation catalog on global locale creation. > > What do you think about the patch? very nice :)=20 Especially for KDE PIM, where we probably have about twice as many librarie= s=20 as applications, with complex dependencies, making sure to always have the= =20 right catalogs loaded is a painful and very error-prone job (just recently = we=20 did that for the mobile apps, required quite a few iterations until we had= =20 most strings show up translated, I wouldn't be surprised if we are still=20 missing a few catalogs though). Code looks fine to me as well. > Is there any way i can convince you it's safe enough for KDE 4.6 inclusio= n? I'd love to have that in KDE 4.6, with KDE PIM depending on the latest stab= le=20 release of kdelibs, we'd have to wait about 9 month before we could use it= =20 otherwise. regards Volker --nextPart11238047.9jsM90psQk Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) iD8DBQBM6Nixf5bM1k0S0kcRAj4pAKCbfQxJCi3LRhwUltlU0jVaImsV6QCfVan2 c9eJWMRtrHpjd8eQ8ZsVVng= =RGRG -----END PGP SIGNATURE----- --nextPart11238047.9jsM90psQk--