[Linpha-cvs] SF.net SVN: linpha: [4682] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2007-02-18 23:21:05
|
Revision: 4682 http://svn.sourceforge.net/linpha/?rev=4682&view=rev Author: fangehrn Date: 2007-02-18 15:21:00 -0800 (Sun, 18 Feb 2007) Log Message: ----------- 2007-02-19 flo * finished i18n - admin config - instructions (readme.txt and wiki) - i18n() and i18n_install() - editlang.php: update language files - installer: improved language support @todo check for outdated entries, handle modified entries somehow Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/settings_layout.php trunk/linpha2/install/footer.php trunk/linpha2/install/header.php trunk/linpha2/install/header_html.php trunk/linpha2/install/index.php trunk/linpha2/install/lib.install.php trunk/linpha2/install/manual_install.php trunk/linpha2/install/step10_postsettings.php trunk/linpha2/install/step11_finish.php trunk/linpha2/install/step1_license.php trunk/linpha2/install/step2_requirements.php trunk/linpha2/install/step3_dbtype.php trunk/linpha2/install/step4_selectdirectories.php trunk/linpha2/install/step5_getlogin.php trunk/linpha2/install/step6_selectdatabase.php trunk/linpha2/install/step7_selectprefix.php trunk/linpha2/install/step8_testing.php trunk/linpha2/install/step9_createtables.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.class.php trunk/linpha2/lib/classes/linpha.filesys.class.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/lang/lang.German.php Added Paths: ----------- trunk/linpha2/docs/translations.txt trunk/linpha2/install/lang/lang.Example.php trunk/linpha2/install/lang/lang.German.php trunk/linpha2/lib/lang/editlang.php Removed Paths: ------------- trunk/linpha2/lib/lang/language.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/ChangeLog 2007-02-18 23:21:00 UTC (rev 4682) @@ -1,3 +1,14 @@ + +2007-02-19 flo + * finished i18n + - admin config + - instructions (readme.txt and wiki) + - i18n() and i18n_install() + - editlang.php: update language files + - installer: improved language support + + @todo check for outdated entries, handle modified entries somehow + 2007-02-15 bzrudi * Still MetaData mining ;-) Modified: trunk/linpha2/admin/settings_layout.php =================================================================== --- trunk/linpha2/admin/settings_layout.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/admin/settings_layout.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -75,6 +75,8 @@ 'sys_style_layout_title', 'sys_style_layout_template', 'sys_style_layout_theme', + 'sys_lang_autolang', + 'sys_lang', 'sys_style_layout_color_bodybg', 'sys_style_layout_color_elembg', 'sys_style_layout_color_font', @@ -88,8 +90,10 @@ $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_template'),'sys_style_layout_template',$LinAdmin->option_value_system['sys_style_layout_template'],array('options' => LinAdmin::getTemplates())); $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_theme'),'sys_style_layout_theme',$LinAdmin->option_value_system['sys_style_layout_theme'],array('options' => LinAdmin::getThemes($LinAdmin->option_value_system['sys_style_layout_template']))); + $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_lang_autolang'),'sys_lang_autolang',$LinAdmin->option_value_system['sys_lang_autolang']); + $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_lang'),'sys_lang',$LinAdmin->option_value_system['sys_lang'],array('options' => linGetAvailableLanguageFiles( 'lib/lang', $withEnglish = true ) ) ); - echo '<h2 class="linStyle">'.i18n("Colors").'</h2>'; + echo '<br /><h2 class="linStyle">'.i18n("Colors").'</h2>'; ?> <script language="JavaScript" type="text/javascript"> function updateSelectBox(form_select) Added: trunk/linpha2/docs/translations.txt =================================================================== --- trunk/linpha2/docs/translations.txt (rev 0) +++ trunk/linpha2/docs/translations.txt 2007-02-18 23:21:00 UTC (rev 4682) @@ -0,0 +1,3 @@ + +Please see http://linpha.sourceforge.net/wiki/index.php/Translator_Instructions +for instructions how to create new and update existing language files. \ No newline at end of file Modified: trunk/linpha2/install/footer.php =================================================================== --- trunk/linpha2/install/footer.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/footer.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -27,7 +27,7 @@ <br /><br /> <div class="button button_next"> -<input type="submit" name ="next_button" value="Continue"<?php echo $show_next_button ? '' : ' disabled="disabled"'; ?>> +<input type="submit" name ="next_button" value="<?php echo i18n_install("Continue"); ?>"<?php echo $show_next_button ? '' : ' disabled="disabled"'; ?>> </div> </form> Modified: trunk/linpha2/install/header.php =================================================================== --- trunk/linpha2/install/header.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/header.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -24,28 +24,27 @@ * @package Installation */ -include_once(LINPHA_DIR."/install/lib.install.php"); +include_once(LINPHA_DIR.'/install/lib.install.php'); +include_once(LINPHA_DIR.'/lib/classes/linpha.filesys.class.php'); +include_once(LINPHA_DIR.'/lib/classes/linpha.functions.php'); - /** * language file */ + $lang = 'English'; + $folder = 'install/lang'; + $options = linGetAvailableLanguageFiles($folder); + if(isset($_SESSION['language'])) // come from install pages { /** * strict division from $_SESSION['language'] and include() !!! * make sure we don't have a include($_GET['language']) !!! */ - $array_langs = get_available_language_files(); - $key = array_search( $_SESSION['language'], $array_langs); - if( $key === false ) - { - $include_lang = 'English'; + $key = array_search( $_SESSION['language'], $options); + if( $key !== false ) { + $lang = $options[$key]; } - else - { - $include_lang = $array_langs[$key]; - } } elseif(isset($_POST['language'])) { @@ -53,33 +52,26 @@ * strict division from $_POST['language'] and include() !!! * make sure we don't have a include($_POST['language']) !!! */ - $array_langs = get_available_language_files(); - $key = @array_search( $_POST['language'], $array_langs); - if( $key === false ) - { - $include_lang = 'English'; - } - else - { - $include_lang = $array_langs[$key]; + $key = array_search( $_POST['language'], $options); + if( $key !== false ) { + $lang = $options[$key]; } } - elseif(isset($lang)) // step 1 (index.php) + else { - $include_lang = $lang; + $lang = linGetHttpAcceptLang($folder); } - else + + if( $lang && $lang!='English' && file_exists(LINPHA_DIR.'/'.$folder.'/lang.'.$lang.'.php') ) { - $include_lang = 'English'; - $_SESSION['language'] = "English"; + global $linTranslate; + $linTranslate=array(); + include_once( LINPHA_DIR.'/'.$folder.'/lang.'.$lang.'.php' ); } - if(file_exists(LINPHA_DIR."/install/lang/lang.".$include_lang.".php")) { - include_once(LINPHA_DIR."/install/lang/lang.".$include_lang.".php"); - } -$files = Array( +$files = array( "index.php", "step1_license.php", "step2_requirements.php", @@ -94,18 +86,18 @@ "step11_finish.php" ); -$title_str[0] = "Welcome"; -$title_str[1] = "Accept GPL"; -$title_str[2] = "Requirements Check"; -$title_str[3] = "Database Type"; -$title_str[4] = "Directories"; -$title_str[5] = "Database Login"; -$title_str[6] = "Select Database"; -$title_str[7] = "Select Prefix"; -$title_str[8] = "System Checks"; -$title_str[9] = "Database Tables"; -$title_str[10] = "Post Settings"; -$title_str[11] = "Finalizing"; +$title_str[0] = i18n_install("Welcome"); +$title_str[1] = i18n_install("Accept GPL"); +$title_str[2] = i18n_install("Requirements Check"); +$title_str[3] = i18n_install("Database Type"); +$title_str[4] = i18n_install("Directories"); +$title_str[5] = i18n_install("Database Login"); +$title_str[6] = i18n_install("Select Database"); +$title_str[7] = i18n_install("Select Prefix"); +$title_str[8] = i18n_install("System Checks"); +$title_str[9] = i18n_install("Database Tables"); +$title_str[10] = i18n_install("Post Settings"); +$title_str[11] = i18n_install("Finalizing"); if(! isset($is_special)) { @@ -156,7 +148,7 @@ } -if(isset($_GET ['reset'])) +if(isset($_GET['reset'])) { $_SESSION = array(); header("Location: index.php"); Modified: trunk/linpha2/install/header_html.php =================================================================== --- trunk/linpha2/install/header_html.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/header_html.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -28,7 +28,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="de"> <head> -<title><?php echo tr("LinPHA Web Installer"); echo "-". $title_str[$key]; ?></title> +<title><?php echo i18n_install("LinPHA Web Installer")." - ".$title_str[$key]; ?></title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <link rel="stylesheet" type="text/css" href="layout.css"> @@ -56,13 +56,13 @@ switch($i) { case 0: - echo tr("Welcome"); + echo i18n_install("Welcome"); break; case $end: - echo tr("Finish"); + echo i18n_install("Finish"); break; default: - echo tr("$title_str[$i]"); + echo $title_str[$i]; break; } echo "</div>"; @@ -75,7 +75,7 @@ <div class="button button_back"> <form method="POST" name="back_form" action="<?php echo $back_file; ?>"> -<input type="submit" name="submit_button" value="Back"<?php echo $show_back_button ? '' : ' disabled="disabled"'; ?>> +<input type="submit" name="submit_button" value="<?php echo i18n_install("Back"); ?>"<?php echo $show_back_button ? '' : ' disabled="disabled"'; ?>> </form> </div> @@ -83,7 +83,7 @@ </div> <div class="rightside"> -<h1><?php echo tr("$title_str[$key]"); ?></h1> +<h1><?php echo $title_str[$key]; ?></h1> <br /> <?php Modified: trunk/linpha2/install/index.php =================================================================== --- trunk/linpha2/install/index.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/index.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -25,38 +25,24 @@ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } include_once(LINPHA_DIR.'/lib/include/common.php'); -include_once(LINPHA_DIR.'/install/lib.install.php'); - -/** - * autodetect language - */ -$http_accept_lang = get_http_accept_lang(); - -if( !empty($http_accept_lang) ) -{ - $lang = $http_accept_lang; -} else { - $lang = "English"; -} - include_once(LINPHA_DIR.'/install/header.php'); include_once(LINPHA_DIR.'/install/header_html.php'); -echo tr("Welcome To LinPHA2 Installation"); +echo i18n_install("Welcome To LinPHA2 Installation"); echo "<br /><br /><br />"; -echo tr("Please Select Your Preferred Language").":"; +echo i18n_install("Please Select Your Preferred Language"); echo "<br /><select name='language' size='1'>"; -$options = get_available_language_files(); +$options = linGetAvailableLanguageFiles('install/lang' , $withEnglish=true); if(is_array($options)) { /** * always include enable English */ -echo "<option value='English' selected='selected'>English</option>\n"; + //echo "<option value='English' selected='selected'>English</option>\n"; foreach($options AS $value) { Added: trunk/linpha2/install/lang/lang.Example.php =================================================================== --- trunk/linpha2/install/lang/lang.Example.php (rev 0) +++ trunk/linpha2/install/lang/lang.Example.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -0,0 +1,12 @@ +<?php + +$linTranslate = array( + + + +// paste new language entries here + + + +); +?> \ No newline at end of file Added: trunk/linpha2/install/lang/lang.German.php =================================================================== --- trunk/linpha2/install/lang/lang.German.php (rev 0) +++ trunk/linpha2/install/lang/lang.German.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -0,0 +1,12 @@ +<?php + +$linTranslate = array( + + + +// paste new language entries here + + + +); +?> \ No newline at end of file Modified: trunk/linpha2/install/lib.install.php =================================================================== --- trunk/linpha2/install/lib.install.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/lib.install.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -19,60 +19,11 @@ if(!defined('LINPHA_DIR')) { exit(1); } -/** - * Take care of translation - * - * This simple method takes care of all translation related stuff. - * If option tr_learn is set - all new entries will be autolearned. - * @param string $text phrase/word to translate - * @package Installation - */ - function tr($text) - { - global $translate; - $tr_learn = false; //autolearn new language entries - - /** - * translation starts here - */ - if(true == isset($translate[$text])) - { - $str = "$translate[$text]"; - } - else - { - $str = "$text"; - } +function i18n_install($text) +{ + return i18n($text); +} - /** - * autolearn new language entries defined by tr() function. - */ - if($tr_learn == true) - { - $tmpfile = LINPHA_DIR."/var/lang.install.temp.txt"; - - if(false == file_exists("$tmpfile")) - { - if(false == touch("$tmpfile")) - { - echo "Unable to create ".$tmpfile." - please check permissions"; - } - } - - $filedata = file("$tmpfile"); - - if(false == in_array($text."\n", $filedata)) - { - $filedata[] = $text."\n"; - natcasesort($filedata); // Sort an array using a case insensitive "natural order" algorithm - file_put_contents($tmpfile, $filedata); - } - } - - return $str; - -} // end tr() - function installGetPATH($array_path) { /** @@ -248,109 +199,6 @@ } /** - * return an array with all language files found in the folder 'lang' - */ -function get_available_language_files() -{ - $folder = installGetFullPath('install/lang'); - - $file_handle = opendir($folder); - $file = readdir($file_handle); - - //$options = array(); - while($file != false) - { - $explode = explode(".",$file); - - /* Only files that starts with 'lang.' are language files. */ - if($explode[0] == "lang") - { - $options[$explode[1]] = $explode[1]; - } - $file = readdir($file_handle); - } - - /* Sort language files aphabetically */ - if(@is_array($options)) - { - asort($options); - } - return @$options; -} - -function get_http_accept_lang() -{ - /*########################################################## -## used in: header.php/install.php -## The magic of language auto-detection -## This alows us to welcome users with their natural language if already available -## returns: -## language to use -##########################################################*/ - - $http_accept_language = trim($_SERVER["HTTP_ACCEPT_LANGUAGE"]); - // Accept-Language Header detail, see RFC2616 - $knownlangs = array( "" => "" ); - /* - "dk" => "Danish", - "nl" => "Dutch", - "en" => "English", - "de" => "German", - "de-ch" => "German", // for IE 6 - "de-at" => "German", // for IE 6 - "ja" => "Japanese", - "it" => "Italian", - "es" => "Spanish", - "co" => "Spanish", - "fr" => "French", - "no" => "Norwegian", - "pt" => "BrazilianPortuguese", - "br" => "BrazilianPortuguese", - "zh" => "zh-tw", - "tw" => "zh-tw", - "cz" => "Czech", - "cs" => "Czech", - "ro" => "Romanian", - "cn" => "zh-cn", - "se" => "Swedish", - "sv" => "Swedish", - "ru" => "Russian" ); - */ - -$accept_lang = 'English'; -$lastquality = 0.0; - -$langtag = '((?:[a-zA-Z]{1,8})(?:-[a-zA-Z]{1,8})*)'; -$qvalue ='(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3}))'; -$eachbit = '^' . $langtag . '(?:;q=' . $qvalue . ')?(?:,\s*)?(.*)$'; - -while(strlen($http_accept_language)) -{ - $m = Array(); // do not this directly in preg_match() ! - if(preg_match( "/$eachbit/", $http_accept_language, $m)) - { - $tag = $m[1]; - $quality = $m[2]; - - if(strlen($quality) == 0) $quality = 1; - $http_accept_language = $m[3]; - - if(array_key_exists($tag, $knownlangs) && $quality > $lastquality) - { - $accept_lang = $knownlangs[$tag]; - $lastquality = $quality; - } - } - else - { - break; - } -} - -return $accept_lang; -} - -/** * creates a random password */ function random_password($len) @@ -483,12 +331,12 @@ try { $init_ok = true; - echo "<h2>".tr("Checking Directory Permissions")."</h2><br />"; + echo "<h2>".i18n_install("Checking Directory Permissions")."</h2><br />"; /** * checking album directory */ - echo tr("Album Directory")."... "; + echo i18n_install("Album Directory")."... "; if( is_dir( $dirs['album'] ) ) { if( is_writable( $dirs['album'] ) ) @@ -500,22 +348,22 @@ { echo warning_msg(); echo '<br /> ('.$_SESSION['album_dir'].' => '.installLinRealpath( $dirs['album'] ).')'; - echo "<br />".tr("Album Directory Not Writable. Some Features May Not Work")."<br />"; + echo "<br />".i18n_install("Album Directory Not Writable. Some Features May Not Work")."<br />"; } } else { - throw new Exception(failed_msg()."<br />".$_SESSION['album_dir']."<br />".tr("No Valid Directory Found")); + throw new Exception(failed_msg()."<br />".$_SESSION['album_dir']."<br />".i18n_install("No Valid Directory Found!")); } echo "<br /><br />"; - echo tr("Creating Required Directories")."... "; + echo i18n_install("Creating Required Directories...").' '; $array = array('sql','cache','tmp'); foreach($array AS $value) { - echo "<br /><br />".tr("Checking Directory").": ".$value."..."; + echo "<br /><br />".i18n_install("Checking Directory:")." ".$value."..."; if( file_exists( $dirs[$value] ) ) { @@ -526,35 +374,35 @@ if( $_SESSION[$value.'_dir'] == 'var/'.$value) { echo warning_msg(); - echo "<br />".tr("Directory Already Exists - Trying To Delete")."... "; + echo "<br />".i18n_install("Directory Already Exists - Trying To Delete...").' '; if( installRm_rf( $dirs[$value] ) ) { echo success_msg(); } else { - throw new Exception(failed_msg()."<br />".tr("Please Delete Folder Manually")); + throw new Exception(failed_msg()."<br />".i18n_install("Please Delete Folder Manually!")); } } else { - throw new Exception(failed_msg()."<br />".tr("Directory Allready Exists, Please Delete Folder Manually")); + throw new Exception(failed_msg()."<br />".i18n_install("Directory Allready Exists, Please Delete Folder Manually!")); } } - echo "<br /> ".tr("Trying To Create Directory")."... "; + echo "<br /> ".i18n_install("Trying To Create Directory...").' '; if( installMkdir_p( $dirs[$value] ) ) { echo success_msg(); if( ! is_writable( $dirs[$value] ) ) { - echo "<br />".tr("No Write Permissions. Please Change Permissions Manually!"); + echo "<br />".i18n_install("No Write Permissions. Please Change Permissions Manually!"); } } else { - throw new Exception(failed_msg()."<br />".tr("Cannot create folder, please check permissions!")); + throw new Exception(failed_msg()."<br />".i18n_install("Cannot create folder, please check permissions!")); } echo '<br /> ('.$_SESSION[$value.'_dir'].' => '.installLinRealpath( $dirs[$value] ).')<br />'; Modified: trunk/linpha2/install/manual_install.php =================================================================== --- trunk/linpha2/install/manual_install.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/manual_install.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -65,13 +65,13 @@ -echo "<h2>".tr("LinPHA Manual Install")."</h2>"; +echo "<h2>".i18n_install("LinPHA Manual Install")."</h2>"; ?> <br /> </form> <form method="POST" action="manual_install.php"> -<?php echo tr("Table Prefix").":"; ?> +<?php echo i18n_install("Table Prefix").":"; ?> <input type="text" name="sql_prefix" value="<?php echo $_SESSION['sql_prefix']; ?>"> <input type="submit" name="submit" value="Change"> </form> @@ -115,7 +115,7 @@ ?> <br /> -<?php echo tr("SQL Queries To Execute")."<br />"; ?> +<?php echo i18n_install("SQL Queries To Execute:")."<br />"; ?> <textarea style="width: 95%; " rows="8" wrap="off"><?php echo $str_query; ?></textarea> @@ -130,7 +130,7 @@ include_once(LINPHA_DIR.'/install/sql/config.dir.php'); ?> <br /><br /> -<?php echo tr("Folders To Create")."<br />"; ?> +<?php echo i18n_install("Folders To Create:")."<br />"; ?> <textarea style="width: 95%; " rows="3" wrap="off"> <?php echo $_SESSION['album_dir']."\n"; @@ -152,7 +152,7 @@ </textarea> <br /><br /> -<?php echo tr("Config File <b>sql/config.dir.php</b>")."<br />"; ?> +<?php echo i18n_install("LinPHA Config File")." <b>sql/config.dir.php</b><br />"; ?> <textarea style="width: 95%; " rows="3" wrap="off"><?php echo $str; ?></textarea> @@ -167,7 +167,7 @@ include_once(LINPHA_DIR.'/install/sql/config.sql.php'); ?> <br /><br /> -<?php echo tr("Database Connection File"); ?><b><?php echo $_SESSION['sql_dir']; ?>config.sql.php</b><br /> +<?php echo i18n_install("Database Connection File")." <b>".$_SESSION['sql_dir']."config.sql.php</b><br />"; ?> <textarea style="width: 95%; " rows="5" wrap="off"><?php echo $str; ?></textarea> Modified: trunk/linpha2/install/step10_postsettings.php =================================================================== --- trunk/linpha2/install/step10_postsettings.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step10_postsettings.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -43,7 +43,7 @@ include_once(LINPHA_DIR.'/install/header_html.php'); -echo tr("Connecting To Database")."... "; +echo i18n_install("Connecting To Database...").' '; unset($_SESSION['installmode1']); include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); @@ -57,22 +57,22 @@ * add new linpha admin user */ echo "<br /><br />"; -echo "<h2>".tr("Setup Linpha Admin User").".</h2>"; +echo "<h2>".i18n_install("Setup Linpha Admin User")."</h2>"; ?> <div class="boxalign"> -<?php echo tr("Admin Username").":"; ?> +<?php echo i18n_install("Admin Username").":"; ?> <input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" name="admin_name" value="root"> </div> <div class="boxalign"> -<?php echo tr("Admin Password").":"; ?> +<?php echo i18n_install("Admin Password").":"; ?> <input class="boxalignelement" type="password" id="check02" onKeyup="checkForm()" name="admin_pass"> </div> <div class="boxalign"> -<?php echo tr("Admin eMail").":"; ?> +<?php echo i18n_install("Admin eMail").":"; ?> <input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" name="admin_email"> </div> @@ -87,7 +87,7 @@ if(false === $data[0]) { - echo "<h2>".tr("Please Choose Thumbnail Quality")."</h2>"; + echo "<h2>".i18n_install("Please Choose Thumbnail Quality")."</h2>"; ?> <div align="center"> <div class="box2"> @@ -101,12 +101,12 @@ </div> </div> <?php - echo tr("Warning: High Quality Requires CPU > 1 GHz"); + echo i18n_install("Warning: High Quality Requires CPU > 1 GHz"); } ?> <br /><br /> <?php -echo "<h2>".tr("Please Choose Default Thumbnail Size")."</h2>"; +echo "<h2>".i18n_install("Please Choose Default Thumbnail Size")."</h2>"; ?> <div align="center"> Modified: trunk/linpha2/install/step11_finish.php =================================================================== --- trunk/linpha2/install/step11_finish.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step11_finish.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -45,9 +45,9 @@ if(isset($error_nr)) { - echo tr("Validating Information")."... "; + echo i18n_install("Validating Information...").' '; echo failed_msg(); - echo "<br />".tr("Please Fill In All Fields").""; + echo "<br />".i18n_install("Please Fill In All Fields"); echo "</form>"; $show_next_button = false; include_once(LINPHA_DIR.'/install/footer.php'); @@ -82,7 +82,7 @@ /** * save thumbnails default size */ -echo "<br />".tr("Saving Thumbnail Size To Database")."... "; +echo "<br />".i18n_install("Saving Thumbnail Size To Database...").' '; if( isset( $_POST['sys_style_tn_size'] ) ) { $result = $linpha->db->Execute("UPDATE ".LIN_PREFIX."config " . @@ -101,7 +101,7 @@ else { echo failed_msg(); - echo "<br />".tr("Error - No Value Specified")."!"; + echo "<br />".i18n_install("Error - No Value Specified!"); $error_nr = 1; } @@ -114,8 +114,8 @@ echo "<br /><br /><hr /><br />"; -echo "<h2>".tr("Congratulations")."</h2><br />"; -echo tr("Installation Finished")."!"; +echo "<h2>".i18n_install("Congratulations")."</h2><br />"; +echo i18n_install("Installation Finished!"); ?> <script language="JavaScript" type='text/javascript'> <!-- Modified: trunk/linpha2/install/step1_license.php =================================================================== --- trunk/linpha2/install/step1_license.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step1_license.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -32,7 +32,7 @@ <br /> <input type="hidden" name="language" value="<?php echo isset($_POST['language']) ? $_POST['language'] : ''; ?>"> <input type="checkbox" id="check01" onChange="checkForm()"> -<label for="check01"><?php echo tr("Please Accept The GNU General Public License"); ?></label> +<label for="check01"><?php echo i18n_install("Please Accept The GNU General Public License"); ?></label> <br /> <?php $array_check = array('check01' => 'checkbox'); Modified: trunk/linpha2/install/step2_requirements.php =================================================================== --- trunk/linpha2/install/step2_requirements.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step2_requirements.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -67,7 +67,7 @@ /** * checking php version */ - print_line_left("PHP Version"); + print_line_left( i18n_install("PHP Version") ); print_line_middle(PHP_VERSION); if(version_compare(PHP_VERSION, "5.0.0", ">=")) { @@ -76,7 +76,7 @@ else { print_line_right(failed_msg()); - print_line_info("PHP Version >= 5.0.0 is required"); + print_line_info( i18n_install("PHP Version >= 5.0.0 is required") ); $error = 1; } @@ -84,7 +84,7 @@ /** * check for supported databases */ - print_line_left("Supported Databases (MySQL, PostgreSQL, SQLite)"); + print_line_left( i18n_install("Supported Databases")." (MySQL, PostgreSQL, SQLite)" ); if(function_exists('mysql_connect')) { $supported_db['mysql'] = 1; } @@ -97,15 +97,14 @@ if(!isset($supported_db)) { - print_line_middle("NONE"); + print_line_middle( i18n_install("NONE") ); print_line_right(failed_msg()); - print_line_info("Enable at least support for one Database in " . - "your PHP configuration file (php.ini)"); + print_line_info( i18n_install("Enable at least support for one Database in your PHP configuration file (php.ini)") ); $error = 1; } else { - print_line_middle("Yes"); + print_line_middle( i18n_install("Yes") ); print_line_right(success_msg()); $str = ""; @@ -113,7 +112,7 @@ { $str .= $key.' '; } - print_line_info("Supported Databases: ".$str); + print_line_info( i18n_install("Supported Databases:")." ".$str); } /** @@ -143,9 +142,7 @@ if($convert_version == "6.1.1" OR $convert_version == "6.1.2" OR $convert_version == "6.1.3") { print_line_right(warning_msg()); - print_line_info("ImageMagick Versions 6.1.1 to 6.1.3 contain a bug " . - "which makes it unusable. Please consider using another " . - "Version or make use of GD library"); + print_line_info( i18n_install("ImageMagick Versions 6.1.1 to 6.1.3 contain a bug which makes it unusable. Please consider using another Version or make use of GD library") ); } else { @@ -200,8 +197,7 @@ else { print_line_right(warning_msg()); - print_line_info("ImageMagick was NOT found on this server. " . - "This will result in lower quality thumbnails"); + print_line_info( i18n_install("ImageMagick was NOT found on this server. This will result in lower quality thumbnails") ); } @@ -211,32 +207,31 @@ */ if(! isset($convert_ok)) { - print_line_left("GD Library"); + print_line_left( i18n_install("GD Library") ); if(extension_loaded('gd')) { - print_line_middle("Installed"); + print_line_middle( i18n_install("Installed") ); print_line_right(success_msg()); } else { - print_line_middle("Not Found"); + print_line_middle( i18n_install("Not Found") ); print_line_right(failed_msg()); $error = 1; } - print_line_left("GD JPEG Support"); + print_line_left( i18n_install("GD JPEG Support") ); if(!function_exists('imagecreatefromjpeg') || !function_exists('imagejpeg')) { - print_line_middle("No"); + print_line_middle( i18n_install("No") ); print_line_right(failed_msg()); - print_line_info("Your GD Library lacks JPEG support, " . - "LinPHA will not support JPEG Images")."!"; + print_line_info( i18n_install("Your GD Library lacks JPEG support, LinPHA will not support JPEG Images!") ); $error = 1; } else { - print_line_middle("Yes"); + print_line_middle( i18n_install("Yes") ); print_line_right(success_msg()); } } @@ -247,74 +242,70 @@ */ if( LIN_OS != "win" ) { - print_line_left("Posix Extension"); + print_line_left( i18n_install("Posix Extension") ); if(installCheckPosix()) { - print_line_middle("Yes"); + print_line_middle( i18n_install("Yes") ); print_line_right(success_msg()); } else { - print_line_middle("No"); + print_line_middle( i18n_install("No") ); print_line_right(warning_msg()); - print_line_info("Missing POSIX Extension"); + print_line_info( i18n_install("Missing POSIX Extension") ); } } /** * checking safe mode */ - print_line_left("Safe Mode Activated"); + print_line_left( i18n_install("Safe Mode Activated") ); if(! ini_get('safe_mode')) { - print_line_middle("No"); + print_line_middle( i18n_install("No") ); print_line_right(success_msg()); } else { - print_line_middle("Yes"); + print_line_middle( i18n_install("Yes") ); print_line_right(warning_msg()); - print_line_info("Safe mode is activated - Bad fun - " . - "Some things may not work as expected"); + print_line_info( i18n_install("Safe mode is activated - Bad fun - Some things may not work as expected") ); } /** * checking open basedir */ - print_line_left("Open Basedir Activated"); + print_line_left( i18n_install("Open Basedir Activated") ); $basedir_name=ini_get("open_basedir"); if(empty($basedir_name)) { - print_line_middle("No"); + print_line_middle( i18n_install("No") ); print_line_right(success_msg()); } else { - print_line_middle("Yes"); + print_line_middle( i18n_install("Yes") ); print_line_right(warning_msg()); - print_line_info("Open Basedir restrictions in effekt - " . - "Some things may not work as expected"); + print_line_info( i18n_install("Open Basedir restrictions activated - Some things may not work as expected") ); } /** * memory limit */ - print_line_left("PHP Memory limit"); + print_line_left( i18n_install("PHP Memory limit") ); $limit = installGetMemLimit(); if($limit === false) { - print_line_middle("Unlimited"); + print_line_middle( i18n_install("Unlimited") ); print_line_right(success_msg()); } elseif($limit <= 12) { print_line_middle($limit.' MB'); print_line_right(warning_msg()); - print_line_info("Your PHP memory limit is probably to low. If you " . - "encounter problems with creating thumbnails, try to increase " . - "the memory_limit in php.ini or resize your pictures to a " . - "lower resolution and try again."); + print_line_info( i18n_install("Your PHP memory limit is probably to low. If you encounter problems with creating thumbnails, try to increase the memory_limit in php.ini or resize your pictures to a lower resolution before uploading and then try again.") ); + // do not break the line above!! } else { @@ -325,81 +316,89 @@ /** * checking session variables */ - print_line_left("Session Save Path Set Correctly"); + print_line_left( i18n_install("Session Save Path Set Correctly") ); $session_path=session_save_path(); if(!empty($session_path)) { - print_line_middle("Yes"); + print_line_middle( i18n_install("Yes") ); print_line_right(success_msg()); - print_line_info("Session Save Path set to: ".$session_path); + print_line_info( sprintf(i18n_install("Session Save Path set to: %s"),$session_path) ); } else { - print_line_middle("No"); + print_line_middle( i18n_install("No") ); print_line_right(warning_msg()); - print_line_info("Session Save Path not set - Please set in " . - "php.ini first."); + print_line_info( i18n_install("Session Save Path not set - Please set in php.ini first.") ); } - print_line_left("Session Save Handler Set Correctly"); + print_line_left( i18n_install("Session Save Handler Set Correctly") ); $session_save_handler = strtolower(ini_get('session.save_handler')); if($session_save_handler == 'files') { - print_line_middle("Yes"); + print_line_middle( i18n_install("Yes") ); print_line_right(success_msg()); } else { - print_line_middle("No"); + print_line_middle( i18n_install("No") ); print_line_right(failed_msg()); - print_line_info("Session save handler NOT set correctly.<br />". - "Open php.ini and change session.save_handler value " . - "to \"files\""); + print_line_info( + i18n_install("Session save handler NOT set correctly.")."<br />". + i18n_install("Open php.ini and change session.save_handler value to \"files\"") + ); } /** * checking file permissions */ - print_line_left("File Permissions Set Correctly"); + print_line_left( i18n_install("File Permissions Set Correctly") ); - if( is_writable(LINPHA_DIR.'/var') ) + if( is_writable(LINPHA_DIR.'/var') ) // this check may not work correctly under windows! { - print_line_middle("Yes"); + print_line_middle( i18n_install("Yes") ); print_line_right(success_msg()); } else { - print_line_middle("No"); + print_line_middle( i18n_install("No") ); print_line_right(failed_msg()); - print_line_info("Please make sure the directory /linpha/var/ is writeable"); - + print_line_info( sprintf(i18n_install("Please make sure the directory %s is writeable!"),'/linpha/var/') ); $error = 1; } /** * checking album and var folder are protected from outside */ - print_line_left("Album And System Folder Protected From Outside"); + print_line_left( i18n_install("Album And System Folder Protected From Outside") ); $ret = installCheckProtectedFromOutside(); if( $ret == 1 ) { - print_line_middle("Yes"); + print_line_middle( i18n_install("Yes") ); print_line_right(success_msg()); - print_line_info("The /albums and /var folders are protected from outside. See <a href=\"http://linpha.sourceforge.net/wiki/index.php/Secure_LinPHA\">here</a> for more details."); + print_line_info( + i18n_install("The /albums and /var folders are protected from outside."). + i18n_install("Please see <a href=\"http://linpha.sourceforge.net/wiki/index.php/Secure_LinPHA\">here</a> for more details.") + ); } elseif( $ret == 2 ) { - print_line_middle("No"); + print_line_middle( i18n_install("No") ); print_line_right(warning_msg()); - print_line_info("The /albums and /var folders are not protected from outside! Please see <a href=\"http://linpha.sourceforge.net/wiki/index.php/Secure_LinPHA\">here</a> for more details."); + print_line_info( + i18n_install("The /albums and /var folders are not protected from outside!"). + i18n_install("Please see <a href=\"http://linpha.sourceforge.net/wiki/index.php/Secure_LinPHA\">here</a> for more details.") + ); } elseif( $ret == 3 ) { - print_line_middle("Unknown"); + print_line_middle( i18n_install("Unknown") ); print_line_right(warning_msg()); - print_line_info("Cannot determine wether the /albums and /var folders are protected from outside! Please see <a href=\"http://linpha.sourceforge.net/wiki/index.php/Secure_LinPHA\">here</a> for more details."); + print_line_info( + i18n_install("Cannot determine wether the /albums and /var folders are protected from outside!"). + i18n_install("Please see <a href=\"http://linpha.sourceforge.net/wiki/index.php/Secure_LinPHA\">here</a> for more details.") + ); } @@ -409,11 +408,11 @@ print_foot(); echo "<br />"; -echo tr("For more detailed info - Please click on the status info text above")."<br />"; +echo i18n_install("For more detailed info - Please click on the status info text above")."<br />"; ?> <a href="#" onclick="show_hide_tables('',<?php echo $table_lines; ?>)"> -(<?php echo tr("Show All Information"); ?></a>). +(<?php echo i18n_install("Show All Information"); ?></a>). <script language="JavaScript" type='text/javascript'> <!-- @@ -430,8 +429,8 @@ if(isset($error)) { - echo "<h2>".tr("!!! INSTALLATION ABORTED !!!")."</h2><br />"; - echo tr("There was at least one serious error - continue at your own risk"); + echo "<h2>".i18n_install("!!! INSTALLATION ABORTED !!!")."</h2><br />"; + echo i18n_install("There was at least one serious error - continue at your own risk"); echo "<br /><br />"; } @@ -445,8 +444,8 @@ <table width="95%"> <tr> <td> </td> - <td><?php echo tr("Result"); ?></td> - <td><?php echo tr("Status"); ?></td> + <td><?php echo i18n_install("Result"); ?></td> + <td><?php echo i18n_install("Status"); ?></td> </tr> <?php } @@ -456,14 +455,14 @@ $GLOBALS['table_lines']++; ?> <tr> - <td style="text-align: left;"><?php echo tr("$str"); ?></td> + <td style="text-align: left;"><?php echo $str; ?></td> <?php } function print_line_middle($str) { ?> - <td width="50"><?php echo tr("$str"); ?></td> + <td width="50"><?php echo $str; ?></td> <?php } @@ -471,7 +470,7 @@ { ?> <td width="50"><a href="#" onclick="switch_visibility(<?php echo $GLOBALS['table_lines']; ?>)"><?php - echo tr("$str"); ?></a></td> + echo $str; ?></a></td> </tr> <?php } @@ -481,7 +480,7 @@ ?> <tr id="table_line_<?php echo $GLOBALS['table_lines']; ?>" style="display:"> <td colspan="3" style="text-align: left; border-left: none; border-right: none; border-bottom: none; "> - <?php echo tr("$str"); ?><br /><br /></td> + <?php echo $str; ?><br /><br /></td> </tr> <?php } Modified: trunk/linpha2/install/step3_dbtype.php =================================================================== --- trunk/linpha2/install/step3_dbtype.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step3_dbtype.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -98,7 +98,7 @@ if(!function_exists($value)) { - echo '<b>'.tr("No Support In PHP Config (php.ini)").'</b><br />'; + echo '<b>'.i18n_install("No Support In PHP Config (php.ini)").'</b><br />'; } echo '<br />'."\n\n"; @@ -106,13 +106,13 @@ ?> <br /><br /> -<h1><?php echo tr("Select Installation Mode"); ?></h1> +<h1><?php echo i18n_install("Select Installation Mode"); ?></h1> <br /> <input type='radio' name='install_mode' value='automatic' checked="checked"> -<?php echo tr("Automatic mode"); ?> +<?php echo i18n_install("Automatic mode"); ?> <br /><br /> <input type='radio' name='install_mode' value='manual'> -<?php echo tr("Manual Mode (Experts Only)"); ?> +<?php echo i18n_install("Manual Mode (Experts Only)"); ?> <?php include_once(LINPHA_DIR.'/install/footer.php'); Modified: trunk/linpha2/install/step4_selectdirectories.php =================================================================== --- trunk/linpha2/install/step4_selectdirectories.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step4_selectdirectories.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -66,7 +66,7 @@ ?> <div class="boxalign"> -<?php echo tr("Album Directory").":"; ?> +<?php echo i18n_install("Album Directory").":"; ?> <input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" name="album_dir" size="30" value="<?php echo $album_dir; ?>"> </div> @@ -74,11 +74,11 @@ <br /><br /> <br /> -<h2 style="color: red;"><?php echo tr("Warning: All directories below will be deleted if they exists !!"); ?></h2> +<h2 style="color: red;"><?php echo i18n_install("Warning: All directories below will be deleted if they exists !!"); ?></h2> <br /> <div class="boxalign"> -<?php echo tr("Sql Directory").":"; ?> +<?php echo i18n_install("Sql Directory").":"; ?> <input class="boxalignelement" type="text" id="check02" onKeyup="checkForm()" name="sql_dir" size="30" value="<?php echo $sql_dir; ?>"> </div> @@ -86,7 +86,7 @@ <br /><br /> <div class="boxalign"> -<?php echo tr("Cache Directory").":"; ?> +<?php echo i18n_install("Cache Directory").":"; ?> <input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" name="cache_dir" size="30" value="<?php echo $cache_dir; ?>"> </div> @@ -94,7 +94,7 @@ <br /><br /> <div class="boxalign"> -<?php echo tr("Temp Directory").":"; ?> +<?php echo i18n_install("Temp Directory").":"; ?> <input class="boxalignelement" type="text" id="check04" onKeyup="checkForm()" name="tmp_dir" size="30" value="<?php echo $tmp_dir; ?>"> </div> Modified: trunk/linpha2/install/step5_getlogin.php =================================================================== --- trunk/linpha2/install/step5_getlogin.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step5_getlogin.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -38,9 +38,9 @@ { include_once(LINPHA_DIR.'/install/header_html.php'); - echo tr("Validating Information")."... "; + echo i18n_install("Validating Information...").' '; echo failed_msg(); - echo "<br />".tr("Please Fill In All Fields").""; + echo "<br />".i18n_install("Please Fill In All Fields").""; echo "</form>"; $show_next_button = false; @@ -84,54 +84,52 @@ ?> <br /><br /> <hr /> -<h1><?php echo tr("$title_str[$key]"); ?></h1> +<h1><?php echo $title_str[$key]; ?></h1> <br /> <?php if($_SESSION['sql_dbtype'] == 'mysql') { - echo tr("NOTE: If you have setup a root Password for your MySQL Database " . - "please login using your root account.")."<br /><br />"; + echo i18n_install("NOTE: If you have setup a root Password for your MySQL Database please login using your root account."); + echo "<br /><br />"; $_SESSION['sql_dbport'] = '3306'; } elseif($_SESSION['sql_dbtype'] == 'postgres') { - echo tr("NOTE: There is currently now way to let LinPHA create the required " . - "Database, so you have to create a new Database using \"createdb\" " . - "from commandline before you proceed.")."<br /><br />"; + echo i18n_install("NOTE: There is currently now way to let LinPHA create the required Database, so you have to create a new Database using \"createdb\" from commandline before you proceed."); + echo "<br /><br />"; $_SESSION['sql_dbport'] = '5432'; } elseif($_SESSION['sql_dbtype'] == 'oci8po') { - echo tr("NOTE: Oracle support is only testet on XE the \"Free\" Edition. " . - "If you get things running using a \"real\" Oracle Database please " . - "drop us a note!")."<br /><br />"; + echo i18n_install("NOTE: Oracle support is only testet on XE the \"Free\" Edition. If you get things running using a \"real\" Oracle Database please drop us a note!"); + echo "<br /><br />"; $_SESSION['sql_dbport'] = '1521'; } ?> <div class="boxalign"> -<?php echo tr("Username").":"; ?> +<?php echo i18n_install("Username").":"; ?> <input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" name="sql_username" value="<?php echo isset($_SESSION['sql_username']) ? $_SESSION['sql_username'] : 'root' ; ?>"> <br /> </div> <div class="boxalign"> -<?php echo tr("Password").":"; ?> +<?php echo i18n_install("Password").":"; ?> <input class="boxalignelement" type="password" id="check02" onKeyup="checkForm()" name="sql_password"> <br /> </div> <div class="boxalign"> -<?php echo tr("Hostname").":"; ?> +<?php echo i18n_install("Hostname").":"; ?> <input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" name="sql_hostname" value="<?php echo isset($_SESSION['sql_hostname']) ? $_SESSION['sql_hostname'] : 'localhost' ; ?>"> </div> <div class="boxalign"> -<?php echo tr("Port").":"; ?> +<?php echo i18n_install("Port").":"; ?> <input class="boxalignelement" type="text" id="check04" onKeyup="checkForm()" name="sql_dbport" value="<?php echo isset($_SESSION['sql_dbport']) ? $_SESSION['sql_dbport'] : '3306' ; ?>"> Modified: trunk/linpha2/install/step6_selectdatabase.php =================================================================== --- trunk/linpha2/install/step6_selectdatabase.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step6_selectdatabase.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -49,9 +49,9 @@ if(empty($_SESSION['sql_hostname']) OR empty($_SESSION['sql_username']) OR empty($_SESSION['sql_dbport'])) { - echo tr("Validating Information")."... "; + echo i18n_install("Validating Information...").' '; echo failed_msg(); - echo "<br />".tr("Please Fill In All Fields").""; + echo "<br />".i18n_install("Please Fill In All Fields"); echo "</form>"; $show_next_button = false; @@ -63,15 +63,15 @@ switch($_SESSION['sql_dbtype']) { case "mysql": - echo tr("Testing Server Connection")."<br /><br />"; - echo tr("Connecting MySQL-Server")."... "; + echo i18n_install("Testing Server Connection")."<br /><br />"; + echo i18n_install("Connecting MySQL-Server..."); $link = @mysql_connect($_SESSION['sql_hostname'].":".$_SESSION['sql_dbport'], $_SESSION['sql_username'], $_SESSION['sql_password']); if (!$link) { echo failed_msg(); - echo "<br />".tr("Error Connecting To Server").": ".mysql_error().""; + echo "<br />".i18n_install("Error Connecting To Server").": ".mysql_error().""; $error_nr = 2; } else @@ -164,20 +164,20 @@ $checked_dontcreate = ''; } - echo tr("You Are Allowed To Create A New Database (Recommended)"); + echo i18n_install("You Are Allowed To Create A New Database (Recommended)"); ?> <br /> <input type="radio" id="radio_db1" name="create_database" value="create"<?php echo $checked_create; ?>> - <?php echo tr("New Database Name").": "; ?> + <?php echo i18n_install("New Database Name").": "; ?> <input type="text" name="sql_dbname_create" value="<?php echo isset($_SESSION['sql_dbname']) ? $_SESSION['sql_dbname'] : $dbname ; ?>" onKeyup="document.getElementById('radio_db1').checked = true;"> <br /><br /> - <?php echo tr("Or").","; ?><br /> + <?php echo i18n_install("Or").","; ?><br /> <input type="radio" id="radio_db2" name="create_database" value="false"<?php echo $checked_dontcreate; ?>> <?php @@ -185,7 +185,7 @@ if(isset($databases)) { - echo tr("Install Into Existing Database").": "; + echo i18n_install("Install Into Existing Database:").' '; ?> <br /> <select name="sql_dbname_installinto"<?php @@ -216,13 +216,14 @@ { if($_SESSION['sql_dbtype'] == 'oci8po') { - echo tr("Name Of Database To Use, this is usually \"XE\" For Oracle Express Edition"); + echo i18n_install("Name Of Database To Use, this is usually \"XE\" For Oracle Express Edition:"); } else { - echo tr("Name Of Database To Use (Must Exist)").":<br />"; + echo i18n_install("Name Of Database To Use (Must Allready Exist):"); } ?> + <br /> <input type="text" name="sql_dbname_installinto" value="<?php echo isset($_SESSION['sql_dbname']) ? $_SESSION['sql_dbname'] : '' ; ?>"> Modified: trunk/linpha2/install/step7_selectprefix.php =================================================================== --- trunk/linpha2/install/step7_selectprefix.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step7_selectprefix.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -56,9 +56,9 @@ */ if( empty($_SESSION['sql_dbname']) ) { - echo tr("Validating Information")."... "; + echo i18n_install("Validating Information...").' '; echo failed_msg(); - echo "<br />".tr("Please Fill In All Fields").""; + echo "<br />".i18n_install("Please Fill In All Fields"); echo "</form>"; $show_next_button = false; include_once(LINPHA_DIR.'/install/footer.php'); @@ -68,14 +68,14 @@ switch($_SESSION['sql_dbtype']) { case "mysql": - echo "<h2>".tr("Checking Database")."</h2><br />"; + echo "<h2>".i18n_install("Checking Database")."</h2><br />"; $link = @mysql_connect($_SESSION['sql_hostname'].":".$_SESSION['sql_dbport'], $_SESSION['sql_username'], $_SESSION['sql_password']); if(isset($_POST['create_database']) && $_POST['create_database'] == "create") { - echo tr("Creating Database")."... "; + echo i18n_install("Creating Database...").' '; $result = @mysql_query("CREATE database ".$_SESSION['sql_dbname']); if($result) @@ -93,12 +93,12 @@ if(!isset($error_nr)) { - echo "<br />".tr("Selecting Database").". ".$_SESSION['sql_dbname'].'... '; + echo "<br />".i18n_install("Selecting Database").' '.$_SESSION['sql_dbname'].'... '; $db_selected = @mysql_select_db($_SESSION['sql_dbname'], $link); if (!$db_selected) { echo failed_msg(); - echo "<br />".tr("Failed Opening Database").". ".$_SESSION['sql_dbname'].": " . mysql_error() . "<br />"; + echo "<br />".i18n_install("Failed Opening Database").' '.$_SESSION['sql_dbname'].": " . mysql_error() . "<br />"; $error_nr = 3; } else @@ -109,8 +109,8 @@ break; case "postgres": - echo tr("Testing Server Connection")."<br /><br />"; - echo tr("Connecting PostgreSQL-Server")."... "; + echo i18n_install("Testing Server Connection")."<br /><br />"; + echo i18n_install("Connecting PostgreSQL-Server...").' '; $link = pg_connect("host=".$_SESSION['sql_hostname']." " . "port=".$_SESSION['sql_dbport']." " . @@ -121,7 +121,7 @@ if (!$link) { echo failed_msg(); - echo "<br />".tr("Error Connecting To Server").": ".pg_last_error($link); + echo "<br />".i18n_install("Error Connecting To Server").": ".pg_last_error($link); $error_nr = 2; } else @@ -142,13 +142,13 @@ exit(); } - echo tr("Testing File Connection")."<br /><br />"; - echo tr("Connecting SQLite Database")."... "; + echo i18n_install("Testing File Connection")."<br /><br />"; + echo i18n_install("Connecting SQLite Database...").' '; if(file_exists(LINPHA_DIR.'/'.$_SESSION['sql_dir'].'/'.$_SESSION['sql_dbname'])) { echo failed_msg(); - echo "<br />".tr("Database Already Exists, Delete The File ".$_SESSION['sql_dbname']." first!").""; + echo "<br />".sprintf( i18n_install("Database Already Exists, Delete First The File %s!"),$_SESSION['sql_dbname'] ); $error_nr = 3; } else @@ -165,14 +165,14 @@ else { echo failed_msg(); - echo "<br />".tr("Failed To Create Database").": ".$sqliteerror; + echo "<br />".i18n_install("Failed To Create Database").": ".$sqliteerror; $error_nr = 3; } } break; case "oci8po": - echo tr("Testing Server Connection")."<br /><br />"; - echo tr("Connecting ORACLE-Server")."... "; + echo i18n_install("Testing Server Connection")."<br /><br />"; + echo i18n_install("Connecting ORACLE-Server...").' '; /** * make already use of ADBDO as native oci_connet() sucks */ @@ -182,7 +182,7 @@ if (!$link) { echo failed_msg(); - echo "<br />".tr("Error Connecting To Server").":"; + echo "<br />".i18n_install("Error Connecting To Server").":"; $error_nr = 2; } else @@ -214,7 +214,7 @@ <br /><br /> <hr> <br /> - <?php echo tr("Please Enter Database Prefix For Linpha Tables (Default: linpha_)").": <br />" ?> + <?php echo i18n_install("Please Enter Database Prefix For Linpha Tables (Default: linpha_)").": <br />" ?> <input type="text" id="check01" onKeyup="checkForm()" name="sql_prefix" value="<?php echo isset($_SESSION['sql_prefix']) ? $_SESSION['sql_prefix'] : 'linpha_' ; ?>"> Modified: trunk/linpha2/install/step8_testing.php =================================================================== --- trunk/linpha2/install/step8_testing.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step8_testing.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -48,9 +48,9 @@ */ if( empty($_SESSION['sql_prefix']) ) { - echo tr("Validating Information")."... "; + echo i18n_install("Validating Information...").' '; echo failed_msg(); - echo "<br />".tr("Please Fill In All Fields").""; + echo "<br />".i18n_install("Please Fill In All Fields"); echo "</form>"; $show_next_button = false; include_once(LINPHA_DIR.'/install/footer.php'); @@ -61,7 +61,7 @@ * switching to AdoDB * connect to db and check if connection was succesfull */ - echo tr("Switching To AdoDB")."... "; + echo i18n_install("Switching To AdoDB...").' '; $_SESSION['installmode1'] = true; $_SESSION['installmode2'] = true; @@ -81,16 +81,16 @@ if($_SESSION['sql_dbtype'] != "sqlite") { ?> - <h2><?php echo tr("Checking Table Prefix"); ?></h2><br /> + <h2><?php echo i18n_install("Checking Table Prefix"); ?></h2><br /> - <?php echo tr("Checking For Existing Tables")."... "; ?> + <?php echo i18n_install("Checking For Existing Tables...").' '; ?> <?php $array_tables = $linpha->db->MetaTables(); if (! isset($array_tables) OR ! is_array($array_tables)) { echo failed_msg(); - echo "<br />".tr("Cannot Read Tables").": ".mysql_error(); + echo "<br />".i18n_install("Cannot Read Tables").": ".mysql_error(); $error_nr = 2; } else @@ -110,7 +110,7 @@ if(isset($result) && is_array($result) && (count($result) > 0) ) { echo failed_msg(); - echo "<br />".tr("Table Prefix Already Exists, Please Choose Another One").".!"; + echo "<br />".i18n_install("Table Prefix Already Exists, Please Choose Another One!"); echo "</form>"; $show_next_button = false; include_once(LINPHA_DIR.'/install/footer.php'); @@ -130,7 +130,7 @@ $n_runs = 1; if($_SESSION['sql_dbtype'] == "mysql") { - echo tr("Trying To Create New LinPHA Database User")."... "; + echo i18n_install("Trying To Create New LinPHA Database User...").' '; $random_pass = random_password(8); $random_user = "linpha_".random_password(4); @@ -145,18 +145,18 @@ "IDENTIFIED BY '".$random_pass."' WITH GRANT OPTION") ) { echo warning_msg(); - echo "<br />".tr("Failed To Create New LinPHA User"); - echo "<br />".tr("Seems you are not allowed to create new Database users - " . - "using given defaults (NOTE: Installation should still work)")."... "; + echo "<br />".i18n_install("Failed To Create New LinPHA User"); + echo "<br />".i18n_install("Seems you are not allowed to create new Database users using given defaults."); + echo ' ('.i18n_install("NOTE: Installation should still work").')'; } else { if(! $linpha->db->Execute("FLUSH PRIVILEGES") ) { echo warning_msg(); - echo "<br />".tr("Failed To Create New LinPHA User"); - echo "<br />".tr("Seems you are not allowed to create new Database users - " . - "using given defaults (NOTE: Installation should still work)")."... "; + echo "<br />".i18n_install("Failed To Create New LinPHA User"); + echo "<br />".i18n_install("Seems you are not allowed to create new Database users using given defaults."); + echo ' ('.i18n_install("NOTE: Installation should still work").')'; } else { @@ -167,9 +167,9 @@ if(! $test_conn->Connect($_SESSION['sql_hostname'].":".$_SESSION['sql_dbport'], $random_user, $random_pass, $_SESSION['sql_dbname']) ) { echo warning_msg(); - echo "<br />".tr("Failed To Create New LinPHA User"); - echo "<br />".tr("Seems you are not allowed to create new Database users - " . - "using given defaults (NOTE: Installation should still work)")."... "; + echo "<br />".i18n_install("Failed To Create New LinPHA User"); + echo "<br />".i18n_install("Seems you are not allowed to create new Database users using given defaults."); + echo ' ('.i18n_install("NOTE: Installation should still work").')'; } else { @@ -203,7 +203,7 @@ */ if($i == 2) { - echo "<br /><br />".tr("User Created, Now Running Tests")."...<br /><br />"; + echo "<br /><br />".i18n_install("User Created, Now Running Tests...")."<br /><br />"; $orig_conn = $linpha->db; $linpha->db = $test_conn; } @@ -211,10 +211,10 @@ /** * Test table stuff */ - echo "<h2>".tr("Testing Tables")."</h2>"; + echo "<h2>".i18n_install("Testing Tables")."</h2>"; $table_name = $_SESSION['sql_prefix']."test".time(); - echo "<br />".tr("Running Tests").": "; + echo "<br />".i18n_install("Running Tests").": "; $array_tests = array( "CREATE" => "CREATE TABLE ".$table_name." ( id INT NOT NULL )", @@ -290,14 +290,14 @@ /** * skip tests for sqlite */ - echo tr("Skipping Database Tests"); + echo i18n_install("Skipping Database Tests"); } /** * new user failed, use old connection */ if(isset($use_other_conn)) { - echo "<br /><br /><b>".tr("New User Tests Failed, Falling Back")."...</b>"; + echo "<br /><br /><b>".i18n_install("New User Tests Failed, Falling Back...")."</b>"; $linpha->db = $orig_conn; } elseif($n_runs == 2) Modified: trunk/linpha2/install/step9_createtables.php =================================================================== --- trunk/linpha2/install/step9_createtables.php 2007-02-16 15:13:33 UTC (rev 4681) +++ trunk/linpha2/install/step9_createtables.php 2007-02-18 23:21:00 UTC (rev 4682) @@ -57,7 +57,7 @@ /** * finally create tables */ - echo tr("Creating Tables")."... "; + echo i18n_install("Creating Tables...").' '; $translation_array = array_keys($linpha_tables); // only used in error case while( list($key,$query) = each($sql_tables) ) @@ -72,11 +72,11 @@ } } /** - * take care of oracle seqeunces and triggers + * take care of oracle sequences and triggers */ if($_SESSION['sql_dbtype'] == 'oci8po') { - echo tr("Creating Sequences")."...<br /> "; + echo i18n_install("Creating Sequences...")."<br /> "; /** * create sequences @@ -86,8 +86,8 @@ $result = $linpha->db->Execute($query); if(!$result) { - echo tr("Failed To Create Sequence for [$key]."); echo failed_msg(); + echo sprintf( i18n_install("Failed To Create Sequence for [%s]",$key) ); echo ' '.$linpha->db->ErrorMsg().'<br />'; $error_nr = 1; } @@ -96,14 +96,14 @@ /** * create triggers */ - echo tr("Creating Triggers")."...<br /> "; + echo i18n_install("Creating Triggers...")."<br /> "; while( list($key, $query) = each($sql_trigger) ) { $result = $linpha->db->Execute($query); if(!$result) { - echo tr("Failed To Create Trigger for [$key]."); echo failed_msg(); + echo sprintf( i18n_install("Failed To Create Trigger for [%s]",$key) ); echo ' '.$linpha->db->ErrorMsg().'<br />'; $error_nr = 1; } @@ -124,7 +124,7 @@ /** * insert data */ - echo "<br /><br />".tr("Inserting Table Data")."... "; + echo "<br /><br />".i18n_install("Inserting Table Data...").' '; include_once(LINPHA_DIR.'/install/sql/sql.data.php'); foreach($sql_queries AS $value) { @@ -154,7 +154,7 @@ /** * create cache directories */ - echo "<br /><br />".tr("Creating Cache Directories")."... "; + echo "<br /><br />".i18n_install("Creating Cache Directories...").' '; mkdir(installGetFullPath( $_SESSION['cache_dir'] ).'/img', 0700); mkdir(installGetFullPath( $_SESSION['cache_dir'] ).'/thumb', 0700); @@ -166,7 +166,7 @@ /** * create config.dir.php file */ - echo "<br /><br />".tr("Writing config.dir.php File")."... "; + echo "<br /><br />".sprintf( i18n_install("Creating... [truncated message content] |