Translate a variable string

Question

I have an array with languages codes. So I’m looping over this array and “translate” their language name:

foreach ($guide_languages_decoded as $key => $value){
    $language = locale_get_display_language($value);

    echo __($language, 'ea-theme');
}

But the issue is that it prints “English”, “Dutch”, … So in English. I want to translate them with WPML that’s why I’ve tried to add __($variable). But it doesn’t seem to work.

I’ve already scanned my theme for new strings…

0
Dennis 4 months 0 Answers 8 views 0

Leave an answer