[BUG - 1.1 RC3] $context['user']['language'], language dependent images and utf8

Started by xduugu, August 30, 2006, 05:56:26 AM

Previous topic - Next topic

xduugu

If you are using a unicode board, normally your language dependent images are located in a folder called {language}-utf8. The problem: the addresses of the images contain the folder {language} instead of the utf8 one.

example:
http://www.simplemachines.org/community/Themes/newsite/images/german/new.gif

should be

http://www.simplemachines.org/community/Themes/newsite/images/german-utf8/new.gif

This section looks in the template file like this

<img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" />

As you can see, $context['user']['language'] is the troublemaker. The value of this string comes from the following line in Load.php

'language' => $func['ucwords'](strtr($profile['lngfile'], array('_' => ' ''-utf8' => ''))),

where the value gets rid of his utf8 suffix. I don't know why this is necessary as long as the "real" language name is only used on the profile summary.

There are two possibilities to fix this bug:
1. you rename all your folders located under /Themes/{theme name}/images from {language}-utf8 to {language} or
2. you replace the line
'language' => $func['ucwords'](strtr($profile['lngfile'], array('_' => ' ''-utf8' => ''))),

with
'language' => $func['ucwords']($profile['lngfile']),

and add an additional index to the array which removes the utf8 suffix for the profile page.

Advertisement: