[Interest] Translating JSON files

Mitch Curtis mitch.curtis at qt.io
Mon Jun 17 23:18:33 CEST 2019

> -----Original Message-----
> From: Interest <interest-bounces at qt-project.org> On Behalf Of Thiago
> Macieira
> Sent: Monday, 17 June 2019 10:28 PM
> To: interest at qt-project.org
> Subject: Re: [Interest] Translating JSON files
> On Monday, 17 June 2019 13:02:13 PDT Mitch Curtis wrote:
> > I was hoping to avoid having to duplicate the file, as it would be a
> > maintenance nightmare. Though I guess there's not much I can do in
> > JSON besides doing some funky string-based syntax to mark translatable
> strings:
> >
> >     "displayText": "tr(Some user-facing text)",
> >
> > I can't think of a better solution though.  Switching file formats is
> > also not an option at this point.
> It's only a maintenance nightmare if you manually edit them.

The thing is that I have other data in the file that doesn't need to be translated, so copying them would require keeping each file in sync. The file itself is edited often fairly regularly to add new data (both translatable and non-translatable). 

> If you always generate the translated ones from the .ts or .po file, it's no more of a
> maintenance issue as a .qm or .mo file.

I do like the idea of generating .ts files from JSON...

> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel System Software Products
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest

More information about the Interest mailing list