joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.74k stars 3.64k forks source link

Language string COM_CONTACT_EMAIL missing from com_contact.ini #37442

Open DelPoint opened 2 years ago

DelPoint commented 2 years ago

Steps to reproduce the issue

  1. Go to Global Configuration -> Component -> Contacts -> Icon panel
  2. Set Settings drop-down list to Icons
  3. Select any picture for Custom Email Icon
  4. Create a contact, add every contact datas (name, address, email, etc.)
  5. Display the created contact using any kind of template (preferable Cassiopeia) which doesn't use template override for the file "_components/com_contact/tmpl/contact/defaultaddress.php"
  6. Check the alt text of the selected image of email

Expected result

Alt text should display the word Email instead of the key CON_CONTACT_EMAIL of the missing lang string.

Actual result

image

System information (as much as possible)

Joomla! 4.1.2., but earlier versions are also affected.

Additional comments

Lang file "com_contact.ini" needs to be updated & translated with a new string COM_CONTACT_EMAIL="Email"

DelPoint commented 2 years ago

Hm. Looks like this is a duplicate of #36957.

DelPoint commented 2 years ago

Well, the #36957 is a very similar issue, but not this case. In this case custom icons are added by selecting images, AND the alt text is still wrong, because the code inserting the image uses COM_CONTACT_EMAIL key.

DelPoint commented 2 years ago

It seems to me COM_CONTACT_EMAIL is used in /com_contact/src/View/Contact/HtmlView.php only.

infograf768 commented 2 years ago

Confirmed https://github.com/joomla/joomla-cms/blob/9d13d2287abe919592353f4cf4608980bf2aef42/components/com_contact/src/View/Contact/HtmlView.php#L280

2 possible solutions: use the JGLOBAL_EMAIL or add _LABEL as done in https://github.com/joomla/joomla-cms/issues/36957

brianteeman commented 2 years ago

None of those icons should have an ALT description at all as they are purely decorative so they should be alt=""

DelPoint commented 2 years ago

@brianteeman Well, then #36976 was pointless, and both components/com_contact/tmpl/contact/default_address.php and components/com_contact/src/View/Contact/HtmlView.php ...must be edited/fixed too, plus we can remove the already added lang strings from _com_contact.ini used by these 2 files, I guess.

On the other hand: ALT can be helpful (decorative img or not), as that can be used if something went wrong with the images - e.g. you are using an img file with space(s) in its name: just test it, it will produce invalid SRC value in IMG tag (another bug BTW in HtmlView.php).

chmst commented 2 years ago

@DelPoint this is an abuse of the alt text, unfortunately it was used this way in the past.

Today we know that Alt texts give information for blind users, they are read by screen readers. No blind user must hear an announcement like "image DGB-78589980988-int-1000x456.png".