Skip to content
This repository was archived by the owner on Mar 15, 2023. It is now read-only.

JSON Translations, key options #41

Closed
vickyvxr opened this issue May 21, 2018 · 7 comments
Closed

JSON Translations, key options #41

vickyvxr opened this issue May 21, 2018 · 7 comments
Milestone

Comments

@vickyvxr
Copy link

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
Copy link

kopach commented Jun 4, 2018

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
Copy link
Author

vickyvxr commented Jun 4, 2018

I finally implemented it by myself.
I did a Pull request to this repository: #42

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

@kopach
Copy link

kopach commented Jun 4, 2018

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

@kopach
Copy link

kopach commented Jun 15, 2018

@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
Copy link
Owner

jcbvm commented Jun 19, 2018

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

@vickyvxr
Copy link
Author

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
Copy link
Owner

jcbvm commented Jun 20, 2018

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

@jcbvm jcbvm added this to the 2.0.0 milestone Jun 20, 2018
@jcbvm jcbvm closed this as completed Jun 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants