desktoptojson and list properties / i18n of JSON files

Sebastian Kügler sebas at kde.org
Thu Nov 20 19:05:19 GMT 2014


On Thursday, November 20, 2014 19:57:54 Burkhard Lück wrote:
> > 2.2 is easier (if possible to change the code in 1 to do it) since it does
> > not  involve writing back strings to the json file.
> 
> In kf5 using "LANGUAGE=foo kate" or LANGUAGE=foo kdevelop" (both projects
> do  not install desktop files but use json files generated at build time
> from desktop files)  I see the name/description (from the json files) of
> plugins in the settings dialog translated in language "foo".
> 
> So apparently in kf5 using json files with translated Name/Description as 
> provided by Kevin's example kdevpatchreview.json I get the proper
> translations  in the GUI.
> Please check that, you do not need to have language "foo" installed, just 
> launch kate or kdevelop using x-test/uk/de/fr... as value for "foo".
> 
> If that works we could treat json and desktop files in the same way from 
> devel/translators pov, because what is the difference between desktop and
> json  files?
> Name and format, nothing else.

The json embedded in plugins is created using the desktoptojson tool. This 
tool runs at build time, it converts a .desktop file (including its 
translations) to a .json file, which is then embedded into the plugin binary. 
This tool has only limited understanding of list properties (this limitation 
is what Milian's problem triggering this thread is about). An idea is to not 
do a conversion, but rather add a json file to the repository, which can 
directly be included. Since translations are done in the .desktop file, the 
json file would not be translated. This is the root of the problem.

Cheers,
-- 
sebas

Sebastian Kügler    |    http://vizZzion.org    |     http://kde.org




More information about the kde-core-devel mailing list