desktoptojson and list properties / i18n of JSON files
lueck at hube-lueck.de
Thu Nov 20 22:01:17 GMT 2014
Am Donnerstag, 20. November 2014, 22:55:03 schrieb Albert Astals Cid:
> El Dijous, 20 de novembre de 2014, a les 20:18:29, Burkhard Lück va
> > Am Donnerstag, 20. November 2014, 20:05:19 schrieb Sebastian Kügler:
> > > 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.
> > Please launch "LANGUAGE=nl kdevelop" or "LANGUAGE=nl kate" in Konsole.
> > Do you have translated Names/Description in the settings dialog page
> > Plugins?
> Yes they are translated, but this is tangential to the issue here, they are
> translated because the .desktop file is converted to .json on compile time
> and then embedded into the .so file of the plugin. What Milian wants is not
> having the .desktop file in the repository, but having the .json file
> directly, it's an unneeded conversion step if we have the proper i18n
> tooling for it.
Kate and KDevelop do not install any desktop file in kf5 so we can skip the
conversion of deskop to json files and start to translate json files directly.
More information about the kde-core-devel