[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Translations for JSON files?
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2013-10-29 18:41:33
Message-ID: 14875067.v6gCzdn3yD () xps
[Download RAW message or body]

El Dimarts, 29 d'octubre de 2013, a les 18:28:28, John Layt va escriure:
> Hi,

Hi

> I have a couple of projects coming up for KF5 that will involve providing
> lots of data files, probably in a JSON format, and I'm wondering what is
> the best way to implement translation support for them.
> 
> The first project is a re-write of KHolidays which we'll be starting at the
> KDEPIM sprint later this month, the second is my long discussed ISO Codes
> project.  The common feature of both is that I want the data files to be
> completely platform independent, i.e. able to be used by anyone who wants.
> While I'll provide default Qt libraries for accessing them, I want people
> like Gnome and Mozilla to be able to pick them up and use them
> independently.  It's the data that's the truly valuable shared resource,
> and I want the translations to be an integral part of that.  The only
> requirement is to translate the Holiday or Country name.  I also want the
> file format to become a de-facto standard, allowing other people to
> distribute their own Holiday files that can be used anywhere.
> 
> The obvious and easiest solution is to carry on using po files, with scripty
> adapted to pull the strings from the json files.  This is pretty much how
> the iso-codes project works too.  My concern about this is that a Holidays
> file is then no longer a single integral file that can be easily downloaded
> and distributed via say GHNS or Mozilla's website, or used by any platform
> or app without needing gettext support, or indeed produced by anyone.
> 
> An alternative would be for the single json file to include all the
> translations inside it, so it's an atomic download, and an app or platform
> just selects the locale attribute they need without running it through
> gettext or any other i18n.  The downside here is that integrating that into
> scripty could be a nightmare as it has to write a valid json format to
> integrate the translations.  It could also bloat the file size badly.

Bloat the file size? Come on, you're translating a few strings to a hundred of 
languages, what's that, a few K?

I have not tried them, but json2po and po2json seem exactly what you want, no?

Cheers,
  Albert

> A halfway house could be to use the json translation file format that seems
> to be getting popular, basically json format po files.  This would be
> easier for scripty to implement, and reduce the bloat, but again would lose
> the simplicity of a single file.
> 
> Any thoughts on this?  Am I too concerned about a single file or relying on
> gettext?
> 
> The other thing I'm wondering is if I'll need to support genitive forms? 
> For example for the holiday name "Christmas Day", or the country name
> "Germany"? Or is the single form of the name always sufficient?
> 
> Cheers!
> 
> John.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic