Title: Language switcher widget &quot;lang&quot; attribute missing
Last modified: August 31, 2016

---

# Language switcher widget "lang" attribute missing

 *  [mijalis](https://wordpress.org/support/users/mijalis/)
 * (@mijalis)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/)
 * 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](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform)

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

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969703)
 * 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](https://wordpress.org/support/users/mijalis/)
 * (@mijalis)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969713)
 * 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](https://wordpress.org/support/users/mijalis/)
 * (@mijalis)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969715)
 * 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](https://wordpress.org/support/users/mijalis/)
 * (@mijalis)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969719)
 * I used a dirty hack in polylang to check my site and it is OK…
    Check please:
   [http://www.villakynthia.gr/en](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](https://wordpress.org/support/users/mijalis/)
 * (@mijalis)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969723)
 * 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](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969761)
 * 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](https://core.trac.wordpress.org/ticket/33513)), so I will restart
   my development on the topic.
 *  [jemcbade](https://wordpress.org/support/users/jemcbade/)
 * (@jemcbade)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969897)
 * > 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](https://wordpress.org/support/users/chrystl/)
 * (@chrystl)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969904)
 * [@jemcbade](https://wordpress.org/support/users/jemcbade/)
    In Appearance > Menus,
   go in the “screen options” then check “Language switcher”. If you have another
   request, please open a new topic. Thanks.
 *  [jemcbade](https://wordpress.org/support/users/jemcbade/)
 * (@jemcbade)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969905)
 * 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.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)

 * 9 replies
 * 4 participants
 * Last reply from: [jemcbade](https://wordpress.org/support/users/jemcbade/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/language-switcher-lang-attribute-missing/#post-6969905)
 * Status: not resolved