joomla / jed-issues

Joomla! Extensions Directory - Issue Tracker
8 stars 2 forks source link

JED checker error whitespace in the language key #253

Open jschmi102 opened 2 years ago

jschmi102 commented 2 years ago

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:

  $country['name'] = "Bosnia and Herzegovina" or
  $country['name'] = "Austria"

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:

BOSNIA AND HERZEGOVINA="Bosnien und Herzegovina"
AUSTRIA="Östereich"

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. Can you please explain, why you classify this as error (or is JED checker doing wrong and will be corrected)?