• ResolvedModerator threadi

    (@threadi)


    Hi,

    I’m currently trying to fix some remaining HTML issues in a project. There’s a tiny HTML-“bug” in your plugin.

    The following line is in floating-switcher.php:

    echo '<div class="' . esc_attr( $class ) . '" ' . $title . ' role="button" tabindex="0" aria-expanded="false"' . 'aria-label="' .  esc_attr( $current_language_label ) . '" aria-controls="' . esc_attr( $dropdown_id ) . '" ' . $no_translation . '>';

    The output looks like this:

    <div class="trp-language-item trp-language-item__current" title="Deutsch" role="button" tabindex="0" aria-expanded="false"aria-label="Change language" aria-controls="trp-switcher-dropdown-list" data-no-translation><img src="flagurl" class="trp-flag-image" alt="" role="presentation" loading="lazy" decoding="async" width="18" height="14" /><span class="trp-language-item-name">Deutsch</span></div>

    There’s a missing space between aria-expanded and aria-label. It would look better like this:

    echo '<div class="' . esc_attr( $class ) . '" ' . $title . ' role="button" tabindex="0" aria-expanded="false" aria-label="' .  esc_attr( $current_language_label ) . '" aria-controls="' . esc_attr( $dropdown_id ) . '" ' . $no_translation . '>';

    Second case in the same file:

    echo '<a href="' . $url . '" class="' . esc_attr( $class ) . '" ' . $title . $no_translation . '>';

    A space should be added here, e.g. like this:

    echo '<a href="' . $url . '" class="' . esc_attr( $class ) . '" ' . $title . ' ' . $no_translation . '>';

    It would be great if you could take this into account in future updates. This would ultimately also help screen readers with less tolerant errors.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Iarina

    (@iarinadasdi)

    Hello @threadi,

    Thank you for letting us know about this!

    This issue will be solved in our next update. I will let you know as soon as the fix becomes available.

    Plugin Support Iarina

    (@iarinadasdi)

    Hello again,

    I just wanted to let you know that we’ve included a fix for both spacing issues in the latest TranslatePress Multilingual update (version 3.0.4).

    If you update to 3.0.4, everything should render cleanly now.

    Thank you again for taking the time to report this!

    Moderator threadi

    (@threadi)

    Thanks, look better now 🙂

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

The topic ‘Code optimization for W3C HTML Validator’ is closed to new replies.