1<?php
2/**  THIS PAGE HAS TO BE utf-8 ENCODED.
3 * Info Plugin: Simple multilanguage plugin language names
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Daniel Darvish, MD <ddarvish@hibm.org>
7 */
8// must be run within Dokuwiki
9if(!defined('DOKU_INC')) die();
10
11// For a list of country codes see http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm
12// Please ensure there is only one line per two letter language code.  Listed alphabetically.  Thank you.
13$langname['af'] = 'Afrikaans';    $langflag['af'] = 'af.gif';
14$langname['ar'] = 'العربية (Arabic)';     $langflag['ar'] = 'sa.gif';
15$langname['cs'] = 'čeština or Česky (Czech)';      $langflag['cs'] = 'cz.gif';
16$langname['da'] = 'Dansk (Danish)';      $langflag['da'] = 'dk.gif';
17$langname['de'] = 'Deutsch (German)';    $langflag['de'] = 'de.gif';
18$langname['en'] = 'English';    $langflag['en'] = 'gb.gif'; //may use uk.gif if you want!
19$langname['ga'] = 'Gaeilge (Irish)';    $langflag['ga'] = 'ie.gif';
20$langname['el'] = 'ελληνικά (Greek)';   $langflag['el'] = 'gr.gif';
21$langname['es'] = 'Español (Spanish, Mexico)';    $langflag['es'] = 'mx.gif';
22$langname['fa'] = 'فارسی (Persian/Farsi, Iran)';   $langflag['fa'] = 'ir.gif';
23$langname['fr'] = 'Français (French)';   $langflag['fr'] = 'fr.gif';
24$langname['he'] = 'עברית (Hebrew, Israel)';     $langflag['he'] = 'il.gif';
25$langname['it'] = 'Italiano';   $langflag['it'] = 'it.gif';
26$langname['ja'] = '日本語 (Japanese)';   $langflag['ja'] = 'jp.gif';
27$langname['ko'] = '한국어 (Korean)';     $langflag['ko'] = 'kr.gif';
28$langname['no'] = 'Norsk or Bokmål (Norwegian';  $langflag['no'] = 'no.gif';
29$langname['nl'] = 'Nederlands'; $langflag['nl'] = 'nl.gif';
30$langname['pl'] = 'Poliski (Polish)';  $langflag['pl'] = 'pl.gif';
31$langname['pt'] = 'Português (Portuguese, Portugal)';  $langflag['pt'] = 'pt.gif';
32$langname['pt-br'] = 'Português brasileiro (Portuguese, Brasil)';   $langflag['pt-br'] = 'br.gif';
33$langname['ru'] = 'Русский (Russsian)';  $langflag['ru'] = 'ru.gif';
34$langname['ro'] = 'Română (Romanian)'; $langflag['ro'] = 'ro.gif';
35$langname['sv'] = 'Svenska (Swedish)';    $langflag['sv'] = 'se.gif';
36$langname['th'] = 'ภาษาไทย (Thai)';  $langflag['th'] = 'th.gif';
37$langname['tr'] = 'Tϋrkçe (Turkish)';  $langflag['tr'] = 'tr.gif';
38$langname['vi'] = 'Tiếng Việt (Vietnamese)';  $langflag['vi'] = 'vn.gif';
39$langname['zh'] = '中文 (Chinese)';    $langflag['zh'] = 'cn.gif';
40
41
42/*
43Fot this to work, the function _buildTransLink($lng,$idpart) in syntax.php should look have the following code (see BOF and EOF: add flags ...)
44
45    function _buildTransLink($lng,$idpart){
46        global $conf;
47        global $saved_conf;
48        if($lng){
49            $link = ':'.$this->tns.$lng.':'.$idpart;
50            $name = $lng;
51        }else{
52            $link = ':'.$this->tns.$idpart;
53            if(!$conf['lang_before_translation']){
54              $name = $conf['lang'];
55            } else {
56              $name = $conf['lang_before_translation'];
57            }
58        }
59
60        // BOF: add flags by ddarvish; ******************************
61        if(file_exists(DOKU_PLUGIN.'translation/flags/langnames.php')) {
62          require(DOKU_PLUGIN.'translation/flags/langnames.php');
63          if(file_exists(DOKU_PLUGIN.'translation/flags/'.$langflag[$name])){
64            $flag['title'] = $langname[$name];
65            $flag['src'] = DOKU_URL.'lib/plugins/translation/flags/'.$langflag[$name];
66            return html_wikilink($link,$flag);
67          }
68        }
69        // EOF: add flags by ddarvish;*********************************
70
71        return html_wikilink($link,$name);
72    }
73
74*/
75