Weather Widget in Chinese Traditional not showing – SOLVED

Posted in: Newspaper
Post count: 59

Hi, I’m working for a project inserting a weather widget for wordpress with the openweathermap API.

I used the Theme Magazine for TagDiv, and I’m forcing the language to zh_tw for traditional chinese.

The characters are wrong sometimes (for example sunny is correct / cloudy is not correct).

Got it! My own client saw the solution, while calling the API, the function inserted is:

// CHECK FOR LOCALE BY FIRST TWO DIGITS
if (in_array(substr($sytem_locale, 0, 2), $available_locales)) {
$atts[‘w_language’] = substr($sytem_locale, 0, 2);
}

So just get “zh”

Whic those working with traditional chinese should change to:

if (in_array(substr($sytem_locale, 0, 5), $available_locales)) {
$atts[‘w_language’] = substr($sytem_locale, 0, 5);
}

To get “zh_tw”

Viewing 1 post (of 1 total)
The forum ‘Newspaper’ is closed to new topics and replies.