You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since keys in JSON are allowed to contain spaces and slashes, it would be nice if these characters could be used in our translation keys.
Suggested solution
I looked in the node module if there was anything like this search result I got for ruby, but didn't find anything.
For finding the key it seems the string is only split on ., so I don't get why spaces and slashes in keys don't work. Looking at the code following the splitting of the key, this logic does look pretty complicated for what it should do. In an own project I did something similar on functionally one line as follows:
I know this project is a tad more complicated than my own, however in my eyes it looks like this could be done in an easier way, and ideally in a way that supports spaces and slashes in keys, like my snippet does.
Alternative
My only other option is to remove the slashes and spaces everywhere i18n is used, but this
Additional context
For my project I need to use keys which contain spaces and slashes.
Clear and concise description of the problem
Since keys in JSON are allowed to contain spaces and slashes, it would be nice if these characters could be used in our translation keys.
Suggested solution
I looked in the node module if there was anything like this search result I got for ruby, but didn't find anything.
For finding the key it seems the string is only split on
.
, so I don't get why spaces and slashes in keys don't work. Looking at the code following the splitting of the key, this logic does look pretty complicated for what it should do. In an own project I did something similar on functionally one line as follows:I know this project is a tad more complicated than my own, however in my eyes it looks like this could be done in an easier way, and ideally in a way that supports spaces and slashes in keys, like my snippet does.
Alternative
My only other option is to remove the slashes and spaces everywhere i18n is used, but this
Additional context
For my project I need to use keys which contain spaces and slashes.
Validations
The text was updated successfully, but these errors were encountered: