diff options
| author | Christian Fowler <spider@viovio.com> | 2008-07-08 06:57:33 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2008-07-08 06:57:33 +0000 |
| commit | 99b4078ebdd1fd59918e8a7ff11f504c2046a2d9 (patch) | |
| tree | aeed037cd094a2b2d29c1cedfd107c1e853d99e2 /liberty_plugins | |
| parent | aaed1c213ea718d253696752e9dd95470ee72cd8 (diff) | |
| download | languages-99b4078ebdd1fd59918e8a7ff11f504c2046a2d9.tar.gz languages-99b4078ebdd1fd59918e8a7ff11f504c2046a2d9.tar.bz2 languages-99b4078ebdd1fd59918e8a7ff11f504c2046a2d9.zip | |
move some plugins to their new homes
Diffstat (limited to 'liberty_plugins')
| -rw-r--r-- | liberty_plugins/data.lang.php | 77 | ||||
| -rw-r--r-- | liberty_plugins/data.tr.php | 48 | ||||
| -rw-r--r-- | liberty_plugins/data.translated.php | 118 |
3 files changed, 243 insertions, 0 deletions
diff --git a/liberty_plugins/data.lang.php b/liberty_plugins/data.lang.php new file mode 100644 index 0000000..e6d5802 --- /dev/null +++ b/liberty_plugins/data.lang.php @@ -0,0 +1,77 @@ +<?php +/** + * @version $Revision: 1.1 $ + * @package liberty + * @subpackage plugins_data + */ +// +----------------------------------------------------------------------+ +// | Copyright (c) 2004, bitweaver.org +// +----------------------------------------------------------------------+ +// | All Rights Reserved. See copyright.txt for details and a complete list of authors. +// | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details +// | +// | For comments, please use phpdocu.sourceforge.net documentation standards!!! +// | -> see http://phpdocu.sourceforge.net/ +// +----------------------------------------------------------------------+ +// | Author (TikiWiki): Sylvie Greverend <sylvieg@users.sourceforge.net> +// | Reworked for Bitweaver (& Undoubtedly Screwed-Up) +// | by: StarRider <starrrider@users.sourceforge.net> +// | Reworked from: wikiplugin_lang.php - see deprecated code below +// +----------------------------------------------------------------------+ +// $Id: data.lang.php,v 1.1 2008/07/08 06:57:33 spiderr Exp $ + +/** + * definitions + */ +define( 'PLUGIN_GUID_DATALANG', 'datalang' ); +global $gLibertySystem; +$pluginParams = array ( + 'tag' => 'LANG', + 'auto_activate' => FALSE, + 'requires_pair' => TRUE, + 'load_function' => 'data_lang', + 'title' => 'Lang - This plugin is not yet functional.', // Remove this line when the plugin becomes operational +// 'title' => 'Lang', // and Remove the comment from the start of this line + 'help_page' => 'DataPluginLang', + 'description' => tra("This plugin will attempt to translate the text between the ") . "{LANG}" . tra(" blocks to the current language. If the translation fails - nothing is displayed."), + 'help_function' => 'data__lang_help', + 'syntax' => "{LANG lang= }" . tra("Text to be translated") . "{LANG}", + 'path' => LIBERTY_PKG_PATH.'plugins/data.lang.php', + 'security' => 'registered', + 'plugin_type' => DATA_PLUGIN +); +$gLibertySystem->registerPlugin( PLUGIN_GUID_DATALANG, $pluginParams ); +$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATALANG ); + +// Help Function +function data_lang_help() { + $back = tra("^__Parameter Syntax:__ ") . "~np~{LANG" . tra("(key=>value)}~/np~\n"); + $back.= tra("||__::key::__ | __::value::__ | __::Comments::__\n"); + $back.= "::lang::" . tra(" | ::abreviation:: | the language of the text between the ") . "~np~{LANG}~/np~" . tra(" blocks. __Required__.\n"); + $back.= tra("abreviations: Chinese (Simplified)=") . "__cn__" . tra(" / Chinese Traditional=") . "__tw__" . tra(" / Czech=") . "__cs__" . tra(" / Danish=") . "__da__" . tra(" / English=") . "__en__" . tra(" / French=") . "__fr__" . tra(" / German=") . "__de__" . tra(" / Hebrew=") . "__he__" . tra(" / Italian=") . "__it__" . tra(" / Japanese=") . "__ja__" . tra(" / Norwegian=") . "__no__" . tra(" / Polish=") . "__po__" . tra(" / Russian=") . "__ru__" . tra(" / Serbian=") . "__sr__" . tra(" / Slovak=") . "__sk__" . tra(" Spanish=") . "__es__" . tra(" Swedish=") . "__sv__.||^"; + $back.= tra("^__Example:__ ") . "~np~{LANG(lang=>fr)}Bon appétit{LANG}~/np~^"; + return $back; +} + +// Load Function +function data_lang($data, $params) { + global $gBitLanguage; + extract ($params, EXTR_SKIP); + if (!isset($lang) || $lang == $gBitLanguage->mLanguage) + return $data; + else + return ""; +} +/****************************************************************************** +The code below is from the deprecated LANG plugin. All comments and the help routines have been removed. - StarRider + +function wikiplugin_lang($data, $params) { + global $gBitLanguage; + extract ($params, EXTR_SKIP); + if (!isset($lang) || $lang == $gBitLanguage->mLanguage) + return $data; + else + return ""; +} +*/ +?> diff --git a/liberty_plugins/data.tr.php b/liberty_plugins/data.tr.php new file mode 100644 index 0000000..c849e38 --- /dev/null +++ b/liberty_plugins/data.tr.php @@ -0,0 +1,48 @@ +<?php +/** + * tr translation plugin + * + * @author wjames5 will@tekimaki.com + * @version $Revision: 1.1 $ + * @package liberty + * @subpackage plugins_data + * @copyright Copyright (c) 2008, bitweaver.org + */ + +/** + * Setup Code + */ +define( 'PLUGIN_GUID_DATATR', 'datatr' ); +global $gLibertySystem; +$pluginParams = array ( + 'tag' => 'TR', + 'auto_activate' => TRUE, + 'requires_pair' => TRUE, + 'load_function' => 'data_tr', + 'title' => 'Translate', + 'help_page' => 'DataPluginTR', + 'description' => tra( "Use this plugin to mark strings for translation. You should only use this for common short strings, and not entire pages." ), + 'help_function' => 'data_tr_help', + 'syntax' => "{tr}", + 'path' => LIBERTY_PKG_PATH.'plugins/data.tr.php', + 'security' => 'registered', + 'plugin_type' => DATA_PLUGIN +); +$gLibertySystem->registerPlugin( PLUGIN_GUID_DATATR, $pluginParams ); +$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATATR ); + +function data_tr_help() { + $help = tra( "Example: " ) . "{tr}string of text to be translated{/tr}"; + return $help; +} + +function data_tr( $pData, $pParams, $pCommonObject ) { + $transString = tra( $pData ); + $parseHash = $pCommonObject->mInfo; + $parseHash['no_cache'] = TRUE; + $parseHash['data'] = $transString; + $parsedData = $pCommonObject->parseData( $parseHash ); + $parsedData = preg_replace( '|<br\s*/?>$|', '', $parsedData ); + return $parsedData; +} +?> diff --git a/liberty_plugins/data.translated.php b/liberty_plugins/data.translated.php new file mode 100644 index 0000000..829ca48 --- /dev/null +++ b/liberty_plugins/data.translated.php @@ -0,0 +1,118 @@ +<?php +/** + * @version $Revision: 1.1 $ + * @package liberty + * @subpackage plugins_data + */ +// +----------------------------------------------------------------------+ +// | Copyright (c) 2004, bitweaver.org +// +----------------------------------------------------------------------+ +// | All Rights Reserved. See copyright.txt for details and a complete list of authors. +// | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details +// | +// | For comments, please use phpdocu.sourceforge.net documentation standards!!! +// | -> see http://phpdocu.sourceforge.net/ +// +----------------------------------------------------------------------+ +// | Author (TikiWiki): Mose <mose@users.sourceforge.net> +// | Reworked & Undoubtedly Screwed-Up for (Bitweaver) +// | by: StarRider <starrrider@sourceforge.net> +// | Reworked from: wikiplugin_translated.php - see deprecated code below +// +----------------------------------------------------------------------+ +// $Id: data.translated.php,v 1.1 2008/07/08 06:57:33 spiderr Exp $ + +/** + * definitions + */ +define( 'PLUGIN_GUID_DATATRANSLATED', 'datatranslated' ); +global $gLibertySystem; +$pluginParams = array ( + 'tag' => 'TRANSLATED', + 'auto_activate' => FALSE, + 'requires_pair' => FALSE, + 'load_function' => 'data_translated', + 'title' => 'Translated - This plugin is not yet functional.', // Remove this line when the plugin becomes operational +// 'title' => 'Translated', // and Remove the comment from the start of this line + 'help_page' => 'DataPluginTranslated', + 'description' => tra("This plugin is used to create a link to a page that contains a translation. The link can be shown as an Icon for the country or as an abreviation for the language."), + 'help_function' => 'data_translated_help', + 'syntax' => "{TRANSLATED page= lang= flag= }", + 'path' => LIBERTY_PKG_PATH.'plugins/data.translated.php', + 'security' => 'registered', + 'plugin_type' => DATA_PLUGIN +); +$gLibertySystem->registerPlugin( PLUGIN_GUID_DATATRANSLATED, $pluginParams ); +$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATATRANSLATED ); + +// Help Function +function data_translated_help() { + $back = tra("^__Parameter Syntax:__ ") . "~np~{TRANSLATED" . tra("(key=>value)}~/np~\n"); + $back.= tra("||__::key::__ | __::value::__ | __::Comments::__\n"); + $back.= "::page::" . tra(" | ::page name:: | __Manditory__ Is a valid url for the page which contains the translation. The page name can be in the formats [url] or ((wikiname)) or ((inter:interwiki))\n^"); + $back.= "::lang::" . tra(" | ::abreviation:: | __Manditory__ Is a 2 letter code that specifies the language to use. See the Abreviations given below.\n"); + $back.= "::flag::" . tra(" | ::flag name:: | __Optional__ Is an image file that can be used as the link. See the Flag Names given below\n"); + $back.= "^__Flag Names:__ ~pp~American_Samoa / Angola / Antigua / Argentina / Armenia / Australia / Austria / Bahamas / Bahrain / Bangladesh / Barbados / Belgium / Bermuda / Bolivia / Brazil / Brunei / Canada / Cayman_Islands / Chile / China / Colombia / Cook_Islands / Costa_Rica / Croatia / Cuba / Cyprus / Czech_Republic / Denmark / Dominican_Republic / Ecuador / Egypt / El_Salvador / Estonia / Federated_States_of_Micronesia / Fiji / Finland / France / French_Polynesia / Germany / Greece / Guam / Guatemala / Haiti / Honduras / Hungary / Iceland / India / Indonesia / Iran / Iraq / Ireland / Israel / Italy / Jamaica / Japan / Jordan / Kazakstan / Kenya / Kiribati / Kuwait / Latvia / Lebanon / Lithuania / Malawi / Malaysia / Malta / Marshall_Islands / Mauritius / Mexico / Morocco / Mozambique / Nauru / Nepal / Netherlands / New_Caledonia / New_Zealand / Nicaragua / Nigeria / Niue / Norway / Pakistan / Panama / Papua_New_Guinea / Paraguay / Peru / Phillippines / Poland / Portugal / Puerto_Rico / Quatar / Romania / Russia / Samoa / Saudi_Arabia / Singapore / Slovakia / Slovenia / Solomon_Islands / Somalia / South_Africa / South_Korea / Spain / Sri_Lanka / St_Vincent_Grenadines / Surinam / Sweden / Switzerland / Taiwan / Thailand / Tonga / Trinidad_Tobago / Turkey / Tuvalu / Ukraine / United_Arab_Emirates / United_Kingdom / United_States / Uruguay / Vanuatu / Venezuela / Wales / Yugoslavia / Zambia / Zimbabwe~/pp~\n^"; + $back.= tra("^ __Language Abreviations:__ Chinese (Simplified)=") . "__cn__" . tra(" / Chinese Traditional=") . "__tw__" . tra(" / Czech=") . "__cs__" . tra(" / Danish=") . "__da__" . tra(" / English=") . "__en__" . tra(" / French=") . "__fr__" . tra(" / German=") . "__de__" . tra(" / Hebrew=") . "__he__" . tra(" / Italian=") . "__it__" . tra(" / Japanese=") . "__ja__" . tra(" / Norwegian=") . "__no__" . tra(" / Polish=") . "__po__" . tra(" / Russian=") . "__ru__" . tra(" / Serbian=") . "__sr__" . tra(" / Slovak=") . "__sk__" . tra(" Spanish=") . "__es__" . tra(" Swedish=") . "__sv__.||^"; + $back.= tra("^__Example:__ ") . "~np~{TRANSLATED(page=>Home Page,lang=>fr,flag=>France)}~/np~^"; + return $back; +} + +// Load Function +function data_translated($data, $params) { + extract ($params, EXTR_SKIP); + if (!isset($page) ) { // A Manditory Parameter is missing + $ret = 'The __page__ parameter was missing from the __~np~{TRANSLATED}~/np~__ plugin.'; + $ret.= data_translated_help(); + return $ret; + } + if (!isset($lang) ) { // A Manditory Parameter is missing + $ret = 'The __lang__ parameter was missing from the __~np~{TRANSLATED}~/np~__ plugin.'; + $ret.= data_translated_help(); + return $ret; + } + + $img = ''; + $h = opendir(USERS_PKG_PATH . "icons/flags/"); + while ($file = readdir($h)) { // Open the directory and read each filename + if (substr($file,0,1) != '.' and substr($file,-4,4) == '.gif') { // Operate only on gif files + $avflags[] = substr($file,0,strlen($file)-4); + } + } + if (isset($flag)) { + if (in_array($flag,$avflags)) { + $file = USERS_PKG_URL . "icons/flags/" . $flag . ".gif"; + $img = "<img src='$file' width='18' height='13' vspace='0' hspace='3' alt='($lang)' align='baseline' />"; + } + } else { + $img = "($lang) "; + } + $ret = $img . $page; + return $ret; +} +/****************************************************************************** +The code below is from the deprecated TRANSLATED plugin. All comments and the help routines have been removed. - StarRider +function wikiplugin_translated($data, $params) { + extract ($params, EXTR_SKIP); + $img = ''; + $h = opendir(USERS_PKG_URL . "icons/flags/"); + while ($file = readdir($h)) { + if (substr($file,0,1) != '.' and substr($file,-4,4) == '.gif') { + $avflags[] = substr($file,0,strlen($file)-4); + } + } + if (isset($flag)) { + if (in_array($flag,$avflags)) { + $img = "<img src=IMG_PKG_URL.'flags/$flag.gif' width='18' height='13' vspace='0' hspace='3' alt='$lang' align='baseline' /> "; + } + } + if (!$img) { + $img = "( $lang ) "; + } + if (isset($data)) { + $back = $img.$data; + } else { + $back = "''no data''"; + } + return $back; +} +*/ +?> |
