• Resolved nickless667

    (@nickless667)


    Hi TranslatePress team,

    the language switcher outputs flag images like this:

    <img src=”…/en_US.svg” class=”trp-flag-image” alt=”” role=”presentation”>


    While this may be acceptable for purely decorative images, it causes problems in practice:

    • SEO and accessibility audit tools flag this as “empty ALT attribute”
    • There is no filter, hook or setting to modify the ALT attribute server-side
    • The current language flag and the dropdown flags are handled inconsistently
      Because the HTML is generated server-side, JavaScript fixes are not sufficient for SEO crawlers that do not execute JS.


      Request:

      Please provide either
    • a filter to modify the flag markup (ALT / role), or
    • an option to define ALT text for flag images, or
    • a way to disable flag images entirely in favor of text-only output.
      This would allow developers to meet both accessibility and SEO requirements without hacking plugin files.
      Thank you!
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Anghel Emanuel

    (@anghelemanuel99)

    Hello there,

    Thank you for reaching out to us!

    You should be able to add a different alt-tag to a flag, if you change the default flag icon of a language with a different one, from your media folder. In the media folder, you should be able to add the alt tag you want (this is not related to our code).

    Let me know about this!

    Kind Regards,

    Thread Starter nickless667

    (@nickless667)

    Yes, of course. That’s the solution. I feel a little silly for not having figured it out myself. Thank you very much.

    Thread Starter nickless667

    (@nickless667)

    .

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.