• I am using the latest polylang version 1.8.

    It seems that the HTML lang attribute is missing from the text based language switcher.
    Generated code is similar to this:
    <a hreflang="el" href="http://www.example.com/el"><img ....>Ελληνικά</a>
    The problem arises when themes use the text-transform:uppercase CSS property.
    The uppercase property value works properly only if the lang HTML attribute defines the correct language code, for example:
    <a hreflang="el" href="http://www.example.com/el" lang="el"><img .....>Ελληνικά</a>

    Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    I made the test with Twenty Twelve which uses this css property in menu and the Greek language appears as ΕΛΛΗΝΙΚΆ instead of Ελληνικά. Is it incorrect? Adding the lang attribute does not change anything.

    Thread Starter mijalis

    (@mijalis)

    Yes it is incorrect.
    It should display ΕΛΛΗΝΙΚΑ (no accented characters)
    In Greek (el), vowels lose their accent when the whole word is in uppercase (ά/Α)
    Try this example:

    <div style="text-transform: uppercase;" lang="el">Ελληνικά</div>
    <div style="text-transform: uppercase;" >Ελληνικά (without lang definition)</div>

    It should work by just adding lang..I’ve tried this already..

    Thanks!

    Thread Starter mijalis

    (@mijalis)

    Try this example, it should work…
    I’ve tried this already:

    <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    </style>
    </head>
    <body>
    <div style="text-transform: uppercase;" lang="el">Ελληνικά</div>
    <div style="text-transform: uppercase;" >Ελληνικά (without lang definition)</div>
    </body></html>

    Thread Starter mijalis

    (@mijalis)

    I used a dirty hack in polylang to check my site and it is OK…
    Check please:
    http://www.villakynthia.gr/en/

    File: include/walker-list.php
    Line 20:

    "\t".'<li class="%s"><a hreflang="%s" href="%s" lang="el">%s</a></li>'."\n",

    Thread Starter mijalis

    (@mijalis)

    Just an unrelated Chrome bug…developer tools don’t render the change correctly…Firefox does, so it is better debug this property using Firefox’s F12

    Plugin Author Chouby

    (@chouby)

    I saw the result and will fix this in a future release.

    For your information, a few months ago, I had the intention to do this for all occurrences of native language names (not only for the frontend language switcher but for all occurrences on admin side too). I stopped the development because at that time, I could not do it everywhere (in the admin language filter) and I like consistency. I proposed a patch to WP which will be included in WP 4.5 (see #33513), so I will restart my development on the topic.

    I saw the result and will fix this in a future release.

    I see you are aware of this – that no language switcher is available as a menu item as of version 1.8.

    I am using WP 4.4.1 and I have tested with several Themes inc. Twenty Twelve latest available version.

    I appreciate this plugin so very much and your hard work. I hope you can address this soon. It is really problematic for our sites.

    Plugin Support Chrystl

    (@chrystl)

    @jemcbade
    In Appearance > Menus, go in the “screen options” then check “Language switcher”. If you have another request, please open a new topic. Thanks.

    Oops! There it is!

    Thanks for the help!

    Much appreciated.

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

The topic ‘Language switcher widget "lang" attribute missing’ is closed to new replies.