-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v4] Language editor doesn't support keys with spaces #5332
Comments
Not quite a bug, but intended to be that way. One can probably argue if it should be different. But supporting more characters isn't 100% trivial as the key itself is used in the request endpoint string. |
Could we percent-encode it in the URL? |
I think we can allow all characters This could be all the characters that PHP array() allows.
|
@afbora TBH I don't quite understand how arrays play into this. A space would also be a valid character in an array key. |
Can't we manage the <?php
return [
'code' => 'en',
'default' => true,
'direction' => 'ltr',
'locale' => [
'LC_ALL' => 'en_US'
],
'name' => 'EN',
'translations' => [
'foo bar' => 'Hello',
'foo_bar' => 'Hello',
'foo.bar' => 'Hello',
'foo-bar' => 'Hello',
'fooBar' => 'Hello',
],
'url' => NULL
]; |
Well, the author of this issue does, or at least wants to. 😄 I think it would be totally fine to use your suggestion as a first step though if support for all characters (using percent encoding in the URL) is not possible or too much work. |
One reason for reporting this is that it might break this view after upgrading to v4. Since there were no restrictions so far on how to pick language variable key value pairs. I just did a reality check with websites that I built: out of 14 websites that use language variables, 3 contain spaces and capitalized words and in their keys. One of those three projects is in development, one is live and one is obsolete. So it doesn't affect a lot of my clients. |
I just looked at the language editor for the first time. Beautiful work!
I created some variables in
languages/de.php
and then explored them there. Turn's out that the UI breaks when the key contains a space. This is the error I see when clicking on Jetzt anmelden!:Capitalized keys also "wrongly" get lowercased:
I didn't run in problems yet when using the primary-language value as the key in translations.
I think it's nice that they're very verbose opposed to generic terms like
signup.button
. Those make a lot of sense in big projects but I don't see their need in small projects.Version: alpha.3
The text was updated successfully, but these errors were encountered: