Fixed helperTwitterLanguage missing languages

refael

Well-known member
The helperTwitterLanguage returns the language code for the twitter share button.
The problem is that this function is limited for a specific languages:
PHP:
case 'en':
case 'fr':
case 'de':
case 'it':
case 'es':
case 'ko':
case 'ja':
    return $lang;
There are more languages supported for the twitter button.
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.
 
Last edited:
I've changed this. Interestingly, it didn't fallback properly before, which is why this code was written.
 
Top Bottom