-
Notifications
You must be signed in to change notification settings - Fork 28
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
Error: Whitespace in the key is not allowed #191
Comments
First, I'd like to note that JEDChecker issues a warning, not an error. Actually, there are two problems with your approach:
|
Hmm, I've found original reason to make it error. There was the Specification of language files page on docs.joomla.org with the following requirements:
I don't know why this page was removed without a replacement. PS. My opinion is that, in general, all rules except of "core" ones (Info, License, XML Manifests, XML Files, GPL License) should trigger warnings instead of errors. But at the same time I think that "error" is a proper level in this particular case: using of a raw text instead of a prefixed keys in language file is ok for local development, but not for JED, because it may lead to conflicts between different extensions. |
I've considered to offer my extension, which runs since joomla 3.0 now also with joomla 4.2RC1 without any problems. to the JED. So I ran a check with JED-Checker and I was quite surprised that the checker qualified my extension to be in error caused by "whitespace in the language key".
But first let me explain why my extension is using white spaces in language keys with Joomla's very powerful multilanguage support.
My extension retrieves country info from geolocation server, which e.g. provide county names and county codes. Country names are only provided in english language. To display those names also in german language, joomla multi lanaguage support ist used.
So If I get:
I'm using Joomla's TEXT-function:
echo Text::_($country['name']);
to display the country name.The TEXT-function will cause Joomla to lookup for a language key "BOSNIA AND HERZEGOVINA" or 'AUSTRIA' (upper case of key). But as Joomla will not find this key, it will display instead the original key as key-value. So you will see a display showing
Bosnia and Herzegovina and Austria
But now if you add to your used ("de-DE") language ini file the entry:
You will see the correct display on your german site "Bosnien und Herzegovina" and "Östereich"
You see "whitespace in the language key" is not a restriction it works perfectly and I do not see any reason why to avoid it and I do not see a better solution than mine for this.
Can you please explain, why you classify this as error (or is JED checker doing wrong and will be corrected)?
The text was updated successfully, but these errors were encountered: