[pmwiki-users] setXL to change language of the page?

Thomas -Balu- Walter list+pmwiki-users at b-a-l-u.de
Tue Aug 8 08:00:25 CDT 2006

On Thu, Aug 03, 2006 at 10:14:45AM -0500, Patrick R. Michaud wrote:
> > PS: I've noticed that my $XLLangs contains "de" two times - perhaps
> > because I've loaded two pages - the default and my local one? Is this
> > a feature or a minor bug that eats some ressources when searching for
> > translations?
> It's a minor bug affecting only performance, not functionality.  
> I think one can do 
>     $XLLangs = array_unique($XLLangs);
> to eliminate the duplication.

I've changed "function XLPage($lang,$p) {" to
if (isset($XLLangs[0]) && $XLLangs[0]!=$lang) array_unshift($XLLangs,$lang);

because there might be a priority e.g. an english translation of some
special word that needs to be translated even if the "next" language
is german and has the same word translated.

So this only checks if the last loaded translation is the same as the
previous one and then ignores it.


More information about the pmwiki-users mailing list