Translation support in Qt-translation-based frameworks

Albert Astals Cid aacid at kde.org
Tue Apr 1 23:09:44 UTC 2014


El Dimarts, 1 d'abril de 2014, a les 01:07:37, Aurélien Gâteau va escriure:
> [sinp]
> 
> > > To test translations:
> > > 
> > > 1. Generate a .pot file by following those instructions:
> > > http://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Sy
> > > stem s#Testing_your_Messages.sh_script
> > > 
> > > 2. Create a translation file:
> > >     cd po
> > >     cp myframework.pot myframework-fr.po
> > >     (or -de, -es, -pt...)
> > > 
> > > 3. Edit myframework-fr.po with Lokalize or your text editor, translate
> > > strings of interest (no need to translate all, this is just for testing)
> > > 
> > > 4. Rerun cmake so that it notices the new po dir (touch CMakeLists.txt
> > > should do)
> > > 
> > > 5. Run make and make install
> > > 
> > > 6. Run the code to test, your translations should appear
> > 
> > This is really bad compared to our you do it in kde4 which is basically.
> > 
> >  * Go do l10n-kde4
> >  * Install your language
> >  * Done
> 
> True.
> 
> > It also makes it much harder for translators to test the translations
> > they are
> > working on since they suddenly have to compile the program they are
> > translating instead of just compiling the translation and using the
> > binaries
> > the distro provides.
> 
> Even in the current state, I think it would still work: distro would
> ship packages built from tarballs which contain translations, so the
> code would load any updated translation. In any case, such a testing
> workflow is broken, IMO: you want to test translations of version N of
> the app with code of version N, not version N - 1.

-1 can be small enough like 4.12.3 vs 4.12.4 that it does not matter.

> Having said that, it is a problem when testing packages for nightly
> builds (a much better way to test translations), which I assume are not
> built from tarballs with translations.

There is not such a thing as "tarballs with translations" at this stage, is 
there? Of course the frameworks tarballs should include their own translations 
IMHO but AFAIK this is still not done.

> 
> > Any way we can make the old "just compile your l10n-kde4 language and
> > install
> > it" way work?
> 
> The cmake code can be changed to always build the .qm loader. 

Which code?

> This way
> you can build the .qm separately. It would still require the step
> "compile your l10n-kde4 language and install" to know that this
> particular .po needs to be turned into a .qm, not a .mo. Any ideas how
> to do that?

If the .pot contains
"X-Qt-Contexts: true\n"
it's quite probable it needs it, the problem for that it's that you're going 
to need to have the templates folder besides your language folder

My understanding is that .po files should still have this, but somehow the few 
files i found don't seem to have it :S

Not sure if it's because maybe they're autogenerated from other .po files

Cheers,
  Albert

> 
> Aurélien
> _______________________________________________
> Kde-frameworks-devel mailing list
> Kde-frameworks-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-frameworks-devel



More information about the Kde-frameworks-devel mailing list