-----Original Message-----
From: Interest <interest-boun...@qt-project.org> On Behalf Of Mitch Curtis
Sent: Tuesday, June 18, 2019 8:02 AM
To: Thiago Macieira <thiago.macie...@intel.com>; interest@qt-project.org
Subject: Re: [Interest] Translating JSON files

> 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.

I make the text an array of structs, one for each language:

    "displayText":
    [
        { "language": "en", "text": "English" },
        { "language": "fr", "text": "Francais" }
    ]

Tom Isaacson

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to