splitbrain / dokuwiki-plugin-translation

Easily setup a multi-language DokuWiki
http://www.dokuwiki.org/plugin:translation
23 stars 24 forks source link

Small bug in constructor of helper.php #240

Closed gdirch closed 6 years ago

gdirch commented 6 years ago

After upgrading to the newest version of the translation plugin, I see the translation item of the default language twice. I'm using the described method 2 with separate subnamespaces by configuring each namespace in the config option translation->translations (in my case "de en"). The default language is "de".

I think the problem lies in the constructor of the the helper class. The current code looks like this:

        [...]
        // get default translation
        if(!empty($conf['lang_before_translation'])) {
            $dfl = $conf['lang'];
        } else {
            $dfl = $conf['lang_before_translation'];
        }
        [...]

The if-statement must be changed to (removing the '!'): if(empty($conf['lang_before_translation'])) {

BTW: Many thanks to Andreas Gohr for his great work!

gdirch commented 6 years ago

I just see that there is already a pull request for this issue.

238 opened 2 days ago by cperthel