• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed helperTwitterLanguage missing languages

rellect

Well-known member
#1
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:

Mike

XenForo developer
Staff member
#2
I've changed this. Interestingly, it didn't fallback properly before, which is why this code was written.