Thread: [Phpfreechat-svn] SF.net SVN: phpfreechat: [465] trunk/src/pfci18n.class.php
Status: Beta
Brought to you by:
kerphi
From: <ne...@us...> - 2006-04-24 14:56:36
|
Revision: 465 Author: nemako Date: 2006-04-24 07:56:29 -0700 (Mon, 24 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=465&view=rev Log Message: ----------- + change the default value $type for Init in pfci18n.class.php Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-04-24 14:40:06 UTC (rev 464) +++ trunk/src/pfci18n.class.php 2006-04-24 14:56:29 UTC (rev 465) @@ -31,7 +31,7 @@ class pfcI18N { - function Init($language,$type='admin') + function Init($language,$type='main') { if (!in_array($language, pfcI18N::GetAcceptedLanguage())) $language = pfcI18N::GetDefaultLanguage(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ne...@us...> - 2006-04-24 15:15:14
|
Revision: 466 Author: nemako Date: 2006-04-24 08:15:04 -0700 (Mon, 24 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=466&view=rev Log Message: ----------- add require_once("pfctools.php"); in pfci18n.class.php to support the iconv function Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-04-24 14:56:29 UTC (rev 465) +++ trunk/src/pfci18n.class.php 2006-04-24 15:15:04 UTC (rev 466) @@ -19,6 +19,8 @@ * Free Software Foundation, 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ + +require_once("pfctools.php"); function _pfc() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-07-20 18:40:26
|
Revision: 1055 http://svn.sourceforge.net/phpfreechat/?rev=1055&view=rev Author: kerphi Date: 2007-07-20 11:40:26 -0700 (Fri, 20 Jul 2007) Log Message: ----------- Fix a possible warning Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2007-07-20 13:46:58 UTC (rev 1054) +++ trunk/src/pfci18n.class.php 2007-07-20 18:40:26 UTC (rev 1055) @@ -25,7 +25,7 @@ function _pfc() { $args = func_get_args(); - $serverid = $GLOBALS['serverid']; // serverid is used to avoid conflicts with external code using same 'i18n' key + $serverid = isset($GLOBALS['serverid']) ? $GLOBALS['serverid'] : 0; // serverid is used to avoid conflicts with external code using same 'i18n' key $args[0] = isset($GLOBALS[$serverid]["i18n"][$args[0]]) && $GLOBALS[$serverid]["i18n"][$args[0]] != "" ? ($GLOBALS["output_encoding"] == "UTF-8" ? $GLOBALS[$serverid]["i18n"][$args[0]] : @@ -40,7 +40,7 @@ function _pfc2() { $args = func_get_args(); - $serverid = $GLOBALS['serverid']; // serverid is used to avoid conflicts with external code using same 'i18n' key + $serverid = isset($GLOBALS['serverid']) ? $GLOBALS['serverid'] : 0; // serverid is used to avoid conflicts with external code using same 'i18n' key $args[0] = isset($GLOBALS[$serverid]["i18n"][$args[0]]) && $GLOBALS[$serverid]["i18n"][$args[0]] != "" ? ($GLOBALS["output_encoding"] == "UTF-8" ? $GLOBALS[$serverid]["i18n"][$args[0]] : @@ -64,7 +64,7 @@ else require_once(dirname(__FILE__)."/../i18n/".$language."/main.php"); - $serverid = $GLOBALS['serverid']; // serverid is used to avoid conflicts with external code using same 'i18n' key + $serverid = isset($GLOBALS['serverid']) ? $GLOBALS['serverid'] : 0; // serverid is used to avoid conflicts with external code using same 'i18n' key $GLOBALS[$serverid]['i18n'] = $GLOBALS['i18n']; // do not pass by reference because $GLOBALS['i18n'] is maybe used by unknown external code $GLOBALS["output_encoding"] = "UTF-8"; // by default client/server communication is utf8 encoded @@ -192,4 +192,4 @@ } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-07 20:11:19
|
Revision: 546 Author: kerphi Date: 2006-06-05 07:10:14 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=546&view=rev Log Message: ----------- Bug fix: the files to translate list was incomplete for current 1.x branche Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-06-05 14:08:56 UTC (rev 545) +++ trunk/src/pfci18n.class.php 2006-06-05 14:10:14 UTC (rev 546) @@ -119,6 +119,9 @@ { $files = array(); $files = array_merge($files, glob(dirname(__FILE__)."/*.php")); + $files = array_merge($files, glob(dirname(__FILE__)."/commands/*.php")); + $files = array_merge($files, glob(dirname(__FILE__)."/containers/*.php")); + $files = array_merge($files, glob(dirname(__FILE__)."/proxys/*.php")); $files = array_merge($files, glob(dirname(__FILE__)."/../themes/default/templates/*.php")); $res = array(); @@ -153,8 +156,9 @@ $new_content = ""; foreach($res as $str => $com) { - // echo "str=".$str."\n"; - if (preg_match("/".preg_quote($str)."/", $old_content) == 0) + //echo "com=".$com."\n"; + //echo "str=".$str."\n"; + if (preg_match("/".preg_quote($str,'/')."/", $old_content) == 0) $new_content .= $com."\n\$GLOBALS[\"i18n\"][\"".$str."\"] = \"\";\n\n"; } $content = "<?php" . $old_content . $new_content . "?>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-17 12:33:56
|
Revision: 616 Author: kerphi Date: 2006-06-17 05:33:51 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=616&view=rev Log Message: ----------- Warning fix: iconv(): Wrong charset, conversion from `UTF-8' to `UTF-8' is not allowed Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-06-17 12:33:27 UTC (rev 615) +++ trunk/src/pfci18n.class.php 2006-06-17 12:33:51 UTC (rev 616) @@ -26,7 +26,9 @@ { $args = func_get_args(); $args[0] = isset($GLOBALS["i18n"][$args[0]]) && $GLOBALS["i18n"][$args[0]] != "" ? - iconv("UTF-8", $GLOBALS["output_encoding"], $GLOBALS["i18n"][$args[0]]) : + ($GLOBALS["output_encoding"] == "UTF-8" ? + $GLOBALS["i18n"][$args[0]] : + iconv("UTF-8", $GLOBALS["output_encoding"], $GLOBALS["i18n"][$args[0]])) : "_".$args[0]."_"; return call_user_func_array('sprintf', $args); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-07-06 15:48:27
|
Revision: 644 Author: kerphi Date: 2006-07-06 08:48:11 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=644&view=rev Log Message: ----------- Fix a include path Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-07-05 16:06:18 UTC (rev 643) +++ trunk/src/pfci18n.class.php 2006-07-06 15:48:11 UTC (rev 644) @@ -20,7 +20,7 @@ * Boston, MA 02110-1301 USA */ -require_once("pfctools.php"); +require_once(dirname(__FILE__)."/pfctools.php"); function _pfc() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-01-05 23:13:23
|
Revision: 924 http://svn.sourceforge.net/phpfreechat/?rev=924&view=rev Author: kerphi Date: 2007-01-05 15:13:21 -0800 (Fri, 05 Jan 2007) Log Message: ----------- fix a problem with multiple translations on a single line Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2007-01-05 23:10:22 UTC (rev 923) +++ trunk/src/pfci18n.class.php 2007-01-05 23:13:21 UTC (rev 924) @@ -140,8 +140,8 @@ $files = array_merge($files, glob(dirname(__FILE__)."/commands/*.php")); $files = array_merge($files, glob(dirname(__FILE__)."/containers/*.php")); $files = array_merge($files, glob(dirname(__FILE__)."/proxies/*.php")); - $files = array_merge($files, glob(dirname(__FILE__)."/client/*.php")); - $files = array_merge($files, glob(dirname(__FILE__)."/../themes/default/templates/*.php")); + $files = array_merge($files, glob(dirname(__FILE__)."/client/*.php")); + $files = array_merge($files, glob(dirname(__FILE__)."/../themes/default/*.php")); $res = array(); foreach ( $files as $src_filename ) @@ -151,10 +151,13 @@ foreach( $lines as $l) { // the labels server side - if( preg_match_all('/_pfc\("([^\"]*)"(\s*\,.*|)\)/', $l, $matches) ) + if( preg_match_all('/_pfc\("([^\"]+)"/', $l, $matches) ) { - echo "line: ".$line_nb."\t- ".$matches[1][0]."\n"; - $res[$matches[1][0]] = "// line ".$line_nb." in ".basename($src_filename); + foreach($matches[1] as $label) + { + echo "line: ".$line_nb."\t- ".$label."\n"; + $res[$label] = "// line ".$line_nb." in ".basename($src_filename); + } } // the labels client side (JS) if( preg_match_all('/"([^"]*)",\s\/\/\s_pfc/', $l, $matches) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-02-14 16:54:57
|
Revision: 950 http://svn.sourceforge.net/phpfreechat/?rev=950&view=rev Author: kerphi Date: 2007-02-14 08:54:55 -0800 (Wed, 14 Feb 2007) Log Message: ----------- typo Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2007-02-14 16:39:45 UTC (rev 949) +++ trunk/src/pfci18n.class.php 2007-02-14 16:54:55 UTC (rev 950) @@ -34,7 +34,7 @@ } /** * Just like _pfc but just return the raw translated string, keeping the %s into it - * (used byt the javascript resources (i18n) class) + * (used by the javascript resources (i18n) class) */ function _pfc2() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-08-07 07:43:56
|
Revision: 1094 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1094&view=rev Author: kerphi Date: 2007-08-07 00:43:58 -0700 (Tue, 07 Aug 2007) Log Message: ----------- typo Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2007-08-06 23:58:20 UTC (rev 1093) +++ trunk/src/pfci18n.class.php 2007-08-07 07:43:58 UTC (rev 1094) @@ -103,7 +103,7 @@ */ function GetAcceptedLanguage($type="main") { - return /*<GetAcceptedLanguage>*/array('ar_LB','sv_SE','uk_RO','ja_JP','ba_BA','pt_PT','el_GR','tr_TR','nb_NO','zh_TW','ru_RU','hy_AM','fr_FR','es_ES','bg_BG','zh_CN','nl_NL','eo','bn_BD','uk_UA','de_DE-informal','pl_PL','pt_BR','it_IT','id_ID','hu_HU','en_US','sr_CS','de_DE-formal','ko_KR','da_DK','nn_NO','vi_VN','hr_HR');/*</GetAcceptedLanguage>*/ + return /*<GetAcceptedLanguage>*/array('pl_PL','pt_BR','da_DK','uk_UA','nb_NO','fr_FR','hr_HR','vi_VN','hy_AM','ru_RU','eo','en_US','es_ES','ko_KR','ba_BA','zh_TW','zh_CN','it_IT','el_GR','uk_RO','pt_PT','sr_CS','tr_TR','de_DE-informal','de_DE-formal','ja_JP','sv_SE','bn_BD','nl_NL','ar_LB','hu_HU','nn_NO','bg_BG','id_ID');/*</GetAcceptedLanguage>*/ } /** @@ -127,7 +127,7 @@ $data = preg_replace("/(\/\*<GetAcceptedLanguage>\*\/)(.*)(\/\*<\/GetAcceptedLanguage>\*\/)/", "$1".$i18n_accepted_lang_str."$3", $data); - file_put_contents(__FILE__, $data, FILE_EX); + file_put_contents(__FILE__, $data, LOCK_EX); // Now scan the source code in order to find "_pfc" patterns $files = array(); @@ -187,7 +187,7 @@ $content = "<?php" . $old_content . $new_content . "?>"; //echo $content; - file_put_contents($dst_filename, $content, FILE_EX); + file_put_contents($dst_filename, $content, LOCK_EX); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-11-11 13:55:14
|
Revision: 1210 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1210&view=rev Author: kerphi Date: 2007-11-11 05:55:17 -0800 (Sun, 11 Nov 2007) Log Message: ----------- Add gl_ES to the list of supported languages Modified Paths: -------------- trunk/src/pfci18n.class.php Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2007-11-04 12:14:10 UTC (rev 1209) +++ trunk/src/pfci18n.class.php 2007-11-11 13:55:17 UTC (rev 1210) @@ -103,7 +103,7 @@ */ function GetAcceptedLanguage($type="main") { - return /*<GetAcceptedLanguage>*/array('pl_PL','pt_BR','da_DK','uk_UA','nb_NO','fr_FR','hr_HR','vi_VN','hy_AM','ru_RU','eo','en_US','es_ES','ko_KR','nl_BE','ba_BA','zh_TW','zh_CN','it_IT','el_GR','uk_RO','pt_PT','sr_CS','tr_TR','de_DE-informal','de_DE-formal','ja_JP','sv_SE','bn_BD','nl_NL','ar_LB','hu_HU','nn_NO','bg_BG','id_ID','th_TH');/*</GetAcceptedLanguage>*/ + return /*<GetAcceptedLanguage>*/array('pl_PL','pt_BR','da_DK','uk_UA','nb_NO','fr_FR','hr_HR','vi_VN','hy_AM','ru_RU','eo','en_US','es_ES','ko_KR','nl_BE','ba_BA','zh_TW','zh_CN','it_IT','el_GR','uk_RO','pt_PT','sr_CS','tr_TR','de_DE-informal','de_DE-formal','ja_JP','sv_SE','bn_BD','nl_NL','ar_LB','hu_HU','nn_NO','bg_BG','id_ID','th_TH','gl_ES');/*</GetAcceptedLanguage>*/ } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |