jonlepage / discutions

repository discutions
0 stars 0 forks source link

babelEdit :RE #2

Open jonlepage opened 7 months ago

jonlepage commented 7 months ago

Hello @CodeAndWeb, sorry for the delay. I had to get a license to conduct more in-depth tests and evaluate my needs as well as those of a few colleagues.

I wasn't using any framework, but after discovering i18next, I decided to use it at its highest level in my game because it's really easy to customize. BabelEdit is really great, however, there were a few small feature gaps that quickly stood out to me and created a sense of insecurity.

I took the time to thoroughly test my needs and the frameworks available to try to propose a solution that could meet all needs in a generic way possible. Based on my experience, I think a tag manager in a new window that could be activated as a service would be really welcome.

I made a small mockup to give you a very simple idea of how I think this could be implemented. (see at end) If the mockup can help stimulate your mind, then I'm happy. The feature would maybe aim to offer only ergonomics, productivity, and a very pleasant sense of security, much like all typed languages and what you already offer when creating ids.


The first thing that comes to mind would be to intuitively have a small new window section to configure all the tags you want in project. image

These tags are added literally as needed by the developer's project. Babel's role would simply be to offer assistance in writing the tags and to verify if they are consistent with their availability. Nothing more than proposing available tags during writing, as is already the case when creating a new ID.

I could expect something like this, for example when using interpolation: { or {{ suggest triggers Sans titre-1

and than when using a triggers: $ suggest symbole Sans titre-2

symbole will are a colored link with information for help translator : Sans titre-4

If I could summarize the UI without writing a book, here's what I'm maybe thinking:

here a sketchy demo for inspiration: https://codesandbox.io/p/sandbox/mantine-react-template-forked-2lrs7m?file=%2Fsrc%2FApp.tsx%3A4%2C36

what do you think about this ? did you think it possible to bring a feature like this ? my only issue is security when i write tags. all my tags will be defined in enums likes this:

enum DIALOGS_TARGETS {
    system_1 = 'system_1',
    system_2 = 'system_2',
    actor_1 = 'actor_1',
    actor_2 = 'actor_2',
    actor_3 = 'actor_3',
    actor_4 = 'actor_4',
    actor_5 = 'actor_5',
    actor_6 = 'actor_6',
    actor_7 = 'actor_7',*
}

So my idea it just to copy/past this in babelEdit interpolation section and allow me to using tags where i want. BabelEdit will do nothing more than juste helping visualy the translation and get security feeling.