gen_lang icon indicating copy to clipboard operation
gen_lang copied to clipboard

Improvement idea: support object grouping

Open NicolasDionB opened this issue 5 years ago • 2 comments

We've been using this package to manage our texts and really love the plural functions. The only problem I see is organizing your text definition. It's not an issue when you have only a few lines in your JSON file but as the projects gets bigger with more areas and topics in the app, it gets harder to stay organized.

As JSON doesn't allow comments, my idea would be to create objects in the definition itself and have texts in it. For instance:

{
    "screenSharing": {
        "title": "Screen sharing",
        "startError": "Another user is already sharing his screen."
    }
}

instead of:

{
    "screenSharing_title": "Screen sharing",
    "screenSharing_startError": "Another user is already sharing his screen."
}

That would make things so much easier to maintain. Hope this idea gets through!

NicolasDionB avatar Oct 28 '19 11:10 NicolasDionB

Interesting. Wanna to know your team to manage the text jsons directly?

For my use case, i use Airtable to manage my texts and share this table to translators. That why i write another library - lang_table to generate different json from airtable

Basically, i will not manage the jsons file directly.

KingWu avatar Oct 30 '19 04:10 KingWu

I hear you. I've seen Airtable but to use it on a larger project with multiple devs, I don't want to rely on yet another online service for managing this. Any chance of improving this?

NicolasDionB avatar Oct 30 '19 14:10 NicolasDionB