[Kde-games-devel] Load translations
Burkhard Lück
lueck at hube-lueck.de
Tue Nov 10 08:25:29 UTC 2015
Am Tuesday 10 November 2015, 07:13:35 schrieb Frederik Schwarzer:
> Am Montag, 9. November 2015, 11:13:48 schrieb Burkhard Lück:
> > Am Monday 09 November 2015, 09:06:42 schrieb Frederik Schwarzer:
> Hi,
>
> > KShisen is fully translated here (Language de, recent master from
> > sources)
>
> I am building libkdegames. libkmahjongg and KShisen from their masters
> but ude the distro-delivered translations. Not sure if that might be
> the problem.
>
Using libkdegames. libkmahjongg and KShisen from master with translations from
distro (Kubuntu 15.10) KShisen is translated here.
> > > I think to remember that in KDE4 we had to load library's catalogs
> > > into applications which used them. Doe we have to do this in KF5
> > > as well?
> >
> > No, it has to be done inside the library, e. g. for libkdegames the
> > catalog is loaded with:
> > libkdegames/CMakeLists.txt:31:add_definitions(-
> > DTRANSLATION_DOMAIN="libkdegames5")
>
> So libraries need this CMake command and applications need
> KLocalizedString::setApplicationDomain("kshisen");
> in main?
Right
> How does the application know that it needs other translation
> catalogues?
>
The application just loads all libraries it needs and does not have to care
about the translation catalogs of these libraries.
A library itself is responsible to load its translation catalog via definition
of the TRANSLATION_DOMAIN with the catalog name, where the translations in the
library are extracted to.
See e. g. the translation in frameworks libraries, an application never needs
to load them.
That is similar to the usage of CATALOG_LOADER macro in kde4
--
Burkhard Lück
More information about the kde-games-devel
mailing list