Differences

This shows you the differences between two versions of the page.

Link to this comparison view

computers:dokuwiki_plugin-translations-flags [2015/03/24 05:42] (current)
Line 1: Line 1:
 +====== dokuwiki plugin-translations flags ======
  
 +This is the translations plugin used on this site with flags instead of two letter ISO codes. ​ See top right corner for the flags 8-)
 +
 +{{  computers:​translations1.gif|Interface ​ }}
 +{{computers:​translations2.gif|Configuration}}
 +
 +==== Usage Example ====
 +Just unzip this file {{computers:​translation.zip}} in /​lib/​plugins folder. ​
 +
 +==== Server Side Code  ====
 +
 +<code php>
 +//​syntax.php function was modified as follows
 +    function _buildTransLink($lng,​$idpart){
 +        global $conf;
 +        global $saved_conf;​
 +        if($lng){
 +            $link = ':'​.$this->​tns.$lng.':'​.$idpart;​
 +            $name = $lng;
 +        }else{
 +            $link = ':'​.$this->​tns.$idpart;​
 +            if(!$conf['​lang_before_translation'​]){
 +              $name = $conf['​lang'​];​
 +            } else {
 +              $name = $conf['​lang_before_translation'​];​
 +            }
 +        }
 +        ​
 +        // BOF: add flags; ******************************
 +        if(file_exists(DOKU_PLUGIN.'​translation/​flags/​langnames.php'​) &&
 +            $this->​getConf('​flags'​)){
 +          require(DOKU_PLUGIN.'​translation/​flags/​langnames.php'​);​
 +          if(file_exists(DOKU_PLUGIN.'​translation/​flags/'​.$langflag[$name])){
 +            $flag['​title'​] = $langname[$name];​
 +            $flag['​src'​] = DOKU_URL.'​lib/​plugins/​translation/​flags/'​.$langflag[$name];​
 +            return html_wikilink($link,​$flag);​
 +          }
 +        }
 +        // EOF: add flags;​*********************************
 +        ​
 +        return html_wikilink($link,​$name);​
 +    }
 +
 +</​code>​
 +
 +==== Client Side Code ====
 +None needed
 +
 +
 +====== Candidate Code Suggestions ======
 +If you'd like to use dropdown, it may be better to do it as suckerfish css ul list (like the top menu on this site) 
 +
 +===== Discussion =====
 +The pluign has been uodated, will a new version of this enhancement also be issued>