jcbvm / i18n-editor

GUI for editing your i18n translation files
MIT License
358 stars 78 forks source link

JSON Translations, key options #41

Closed vickyvxr closed 6 years ago

vickyvxr commented 6 years ago

Would it be possible to add a new options when creating JSON translations files, to change the output file from: { "login": { "login": "Entrar sssdds", "password": "Contraseña", "username": "Nombre de usuario" } }

To: { "login.login": "Entrar", "login.username": "Nombre de usuario", "login.password": "Contraseña" }

It will be great to use this tool with react-intl library.

Thanks!!!

kopach commented 6 years ago

I can't wait to have this feature released. I do also need to have flat json keys instead of nested ones for my project.

vickyvxr commented 6 years ago

I finally implemented it by myself. I did a Pull request to this repository: https://github.com/jcbvm/i18n-editor/pull/42

Feel free to test it and give me your feed back!

kopach commented 6 years ago

Yes, it seems to work as expected. I'll test it a little bit more and give you my response later

kopach commented 6 years ago

@vickyvxr , after some time of usage, the only thing I would change - it's naming. Instead of Plain JSON keys I would name it as Flat keys or Flat structure (as opposite to nested structure we do currently have).

And, maybe, would be great to add this option application wide, not only per project.

jcbvm commented 6 years ago

Looks great, flat structure is the better name indeed. Will merge this into next release

vickyvxr commented 6 years ago

Thanks for these nice commens! The name is better so please change it for the next release.

I didn't add the option to the whole application because I didn't know if it was interesting, if @jcbvm doesn't add it I will do it.

jcbvm commented 6 years ago

@vickyvxr I will also add it to the global settings thanks!