The problem is that this function is limited for a specific languages:
case 'en': case 'fr': case 'de': case 'it': case 'es': case 'ko': case 'ja': return $lang;
I use he-IL as the language code but the button still in english instead hebrew.
In any case, this function isn't really necessary. Twitter automatically uses the first two chars as the language. So `data-lang="he-IL"` would still show it as hebrew, there is no real need to cut it into `data-lang="he"`. If the language isn't recognized by twitter, it automatically fallback to english.