Anonymous Login
2019-11-15 04:13 PST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000931Pending RequestsTranslationspublic2014-06-22 21:02
Reportergiesenja 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusnewResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000931: Enhancement of the Translationsystem (with code)
DescriptionSome Minor changes to the Translationsystem:

The following changes are in the patch-file:

modules/system/translate_save.php:
 - after saving the translation, the translation Management returns to the same module and language make its easier to add multiple new entries

classes/w2p/Core/CAppUI.class.php:
 - the functions "_()", "__()" and "setMsg()" now uses any additional arguments as arguments for "sprintf". Example:
   $AppUI->_('Hello %s!', 0, 'Tom') --> 'Hallo Tom!'/*German*/

changes to multiple files to use the new function (just a few to test):
modules/system/index.php
modules/system/translate.php
modules/system/translate_save.php

added and updated $AppUI->_() statements in:
modules/system/do_module_upload.php
modules/system/syskeys/keys.php
modules/system/roles/index.php
TagsNo tags attached.
Attached Files
  • patch file icon translation.patch (9,068 bytes) 1969-12-31 16:00 -
    diff -bBEru --strip-trailing-cr web2project-2.4-org/.htaccess web2project-2.4/.htaccess
    --- web2project-2.4-org/.htaccess	2011-02-14 07:38:38.000000000 +0100
    +++ web2project-2.4/.htaccess	2011-08-23 11:27:38.000000000 +0200
    @@ -50,3 +50,25 @@
     
     # Set the default handler.
     DirectoryIndex index.php
    +
    +RewriteEngine On
    +RewriteBase /
    +
    +# Fix Apache internal dummy connections from breaking [(site_url)] cache
    +RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    +RewriteRule .* - [F,L]
    +
    +# Rewrite *.projektmanagement.giesenberg.de -> projektmanagement.giesenberg.de -- used with SEO Strict URLs plugin
    +RewriteCond %{HTTP_HOST} .
    +RewriteCond %{HTTP_HOST} !^projektmanagement\.giesenberg\.de [NC]
    +RewriteRule (.*) http://projektmanagement.giesenberg.de/$1 [R=301,L]
    +
    +# Make sure .htc files are served with the proper MIME type, which is critical
    +# for XP SP2. Un-comment if your host allows htaccess MIME type overrides.
    +#Als make sure php files are handled by php5 interpreter
    +
    +AddType text/x-component .htc
    +AddType x-mapp-php5 .php .php5
    +AddHandler x-mapp-php5 .php
    +
    +
    diff -bBEru --strip-trailing-cr web2project-2.4-org/classes/w2p/Core/CAppUI.class.php web2project-2.4/classes/w2p/Core/CAppUI.class.php
    --- web2project-2.4-org/classes/w2p/Core/CAppUI.class.php	2011-07-04 08:48:28.000000000 +0200
    +++ web2project-2.4/classes/w2p/Core/CAppUI.class.php	2011-08-24 18:51:28.604069500 +0200
    @@ -500,15 +500,16 @@
     	 * @return string
     	 */
     	public function _($str, $flags = 0) {
    -		if (is_array($str)) {
    +		if (!is_array($str)) {
    +			$str = array($str);
    +		}
     			$translated = array();
    +		$args = func_get_args();
     			foreach ($str as $s) {
    -				$translated[] = $this->__($s, $flags);
    +			$args[0] = $s;
    +			$translated[] = call_user_func_array(array( $this, '__'), $args);
     			}
     			return implode(' ', $translated);
    -		} else {
    -			return $this->__($str, $flags);
    -		}
     	}
     
     	public function __($str, $flags = 0) {
    @@ -566,6 +568,15 @@
     				$str = stripslashes($str);
     				break;
     		}
    +		
    +		if(func_num_args() > 2)
    +		{
    +			$args = func_get_args();
    +			array_splice($args, 1, 1);
    +			$args[0] = $str;
    +			$str = call_user_func_array("sprintf", $args);
    +		}
    +		
     		return $str;
     	}
     	/**
    @@ -677,17 +688,18 @@
     	public function setMsg($msg, $msgNo = 0, $append = false) {
             $this->msgNo = $msgNo;
     
    -        if (is_array($msg)) {
    +        if (!is_array($msg)) {
    +        	$msg = array($msg);
    +        }
                 $tmp_msg = '';
    +		$args = func_get_args();
    +		array_splice($args, 1, 2, UI_OUTPUT_RAW);
                 foreach ($msg as $value) {
    -                $tmp_msg .= $this->_($value, UI_OUTPUT_RAW) . '<br />';
    +        	$args[0] = $value; 
    +            $tmp_msg .= call_user_func_array(array($this,'_'), $args) . '<br />';
                 }
                 $tmp_msg = trim($tmp_msg, '<br />');
                 $this->msg = ($append) ? $this->msg . ' ' . $tmp_msg : $tmp_msg;
    -        } else {
    -            $msg = $this->_($msg, UI_OUTPUT_RAW);
    -            $this->msg = ($append) ? $this->msg . ' ' . $msg : $msg;
    -        }
     	}
     	/**
     	 * Display the formatted message and icon
    --- web2project-2.4-org/modules/system/do_module_upload.php	2011-03-08 07:58:58.000000000 +0100
    +++ web2project-2.4/modules/system/do_module_upload.php	2011-08-24 15:04:01.000000000 +0200
    @@ -17,7 +17,7 @@
         if (is_array($result)) {
             $AppUI->setMsg($result, UI_MSG_ERROR, true);
         } else {
    -        $AppUI->setMsg($AppUI->_('This module was expanded successfully.'), UI_MSG_OK, true);
    +        $AppUI->setMsg('This module was expanded successfully.', UI_MSG_OK, true);
         }
     }
     
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/index.php web2project-2.4/modules/system/index.php
    --- web2project-2.4-org/modules/system/index.php	2011-04-30 23:39:24.000000000 +0200
    +++ web2project-2.4/modules/system/index.php	2011-08-24 18:24:10.000000000 +0200
    @@ -51,8 +51,8 @@
                 $time = new DateTimeZone($tzName);
                 $x = new DateTime();
                 $offset = $time->getOffset($x);
    -            $offset = ($offset >= 0) ? '+'.$offset/3600 : $offset/3600;
    -            echo $AppUI->_('Your system has a default timezone of GMT'.$offset.'.');
    +            $offset = $offset/3600;
    +            echo $AppUI->_('Your system has a default timezone of GMT%+d.', 0, $offset);
             } else {
               ?>
               <a href="?m=system&a=systemconfig#system_timezone"><?php echo $AppUI->_('Select a Timezone'); ?></a> -
    @@ -64,7 +64,7 @@
             if (version_compare($AppUI->getVersion(), $availableVersion, '<')) {
                 ?>
                 <a href="http://sourceforge.net/projects/web2project/" target="_new"><?php echo $AppUI->_('Upgrade Available!'); ?></a> -
    -            <span class="error"><?php echo $AppUI->_('Your system should be upgraded to v'.$availableVersion.'.  Please upgrade at your earliest convenience.'); ?></span>
    +            <span class="error"><?php echo $AppUI->_('Your system should be upgraded to v%s.  Please upgrade at your earliest convenience.', 0, $availableVersion); ?></span>
                 <?php
             } else {
                 echo $AppUI->_('Your system is the latest version available.');
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/roles/index.php web2project-2.4/modules/system/roles/index.php
    --- web2project-2.4-org/modules/system/roles/index.php	2010-12-31 06:34:18.000000000 +0100
    +++ web2project-2.4/modules/system/roles/index.php	2011-08-24 22:04:06.000000000 +0200
    @@ -41,7 +41,7 @@
     if ($canDelete) {
     ?>
     function delIt(id) {
    -	if (confirm( 'Are you sure you want to delete this?' )) {
    +	if (confirm( <?php echo $AppUI->_('Are you sure you want to delete this?') ?> )) {
     		f = document.roleFrm;
     		f.del.value = 1;
     		f.role_id.value = id;
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/syskeys/keys.php web2project-2.4/modules/system/syskeys/keys.php
    --- web2project-2.4-org/modules/system/syskeys/keys.php	2011-08-07 09:08:46.000000000 +0200
    +++ web2project-2.4/modules/system/syskeys/keys.php	2011-08-24 22:24:09.000000000 +0200
    @@ -30,7 +30,7 @@
     if ($canEdit) {
     ?>
     function delIt(id) {
    -	if (confirm( 'Are you sure you want to delete this?' )) {
    +	if (confirm( <?php echo $AppUI->_('Are you sure you want to delete this?') ?> )) {
     		f = document.sysKeyFrm;
     		f.del.value = 1;
     		f.syskey_id.value = id;
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/translate.php web2project-2.4/modules/system/translate.php
    --- web2project-2.4-org/modules/system/translate.php	2011-01-16 07:57:20.000000000 +0100
    +++ web2project-2.4/modules/system/translate.php	2011-08-24 14:39:14.000000000 +0200
    @@ -75,11 +75,11 @@
      *   linebreaks, etc.
      */
     if(file_exists($localeFile) && !is_writable($localeFile)) {
    -    $titleBlock->addCell('', '', '<span class="error">' . $AppUI->_("Locales file ($localeFile) is not writable.") . '</span><br />', '');
    +    $titleBlock->addCell('', '', '<span class="error">' . $AppUI->_('Locales file (%s) is not writable.', 0, $localeFile) . '</span><br />', '');
     }
     $localeFolder = pathinfo($localeFile, PATHINFO_DIRNAME);
     if(!is_writable($localeFolder)) {
    -    $titleBlock->addCell('', '', '<span class="warning">' . $AppUI->_("Locales folder ($localeFolder) is not writable.") . '</span>', '');
    +    $titleBlock->addCell('', '', '<span class="warning">' . $AppUI->_("Locales folder (%s) is not writable.", 0, $localeFolder) . '</span>', '');
     }
     
     $titleBlock->addCell($AppUI->_('Module'), '', '<form action="?m=system&a=translate" method="post" name="modlang" accept-charset="utf-8">', '');
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/translate_save.php web2project-2.4/modules/system/translate_save.php
    --- web2project-2.4-org/modules/system/translate_save.php	2011-05-09 00:25:16.000000000 +0200
    +++ web2project-2.4/modules/system/translate_save.php	2011-08-24 21:52:43.000000000 +0200
    @@ -33,7 +33,7 @@
     		} else {
     			$res = mkdir($mod_locale, 0777);
     			if (!$res) {
    -				$AppUI->setMsg("Could not create folder ($mod_locale) to save locale file.", UI_MSG_ERROR);
    +				$AppUI->setMsg('Could not create folder (%s) to save locale file.', UI_MSG_ERROR, false, $mod_locale);
     				$AppUI->redirect('m=system');
     			} else {
     				$filename = $mod_locale . '/' . $module . '.inc';
    @@ -47,7 +47,7 @@
     $fp = fopen($filename, 'wt');
     
     if (!$fp) {
    -	$AppUI->setMsg("Could not open locales file ($filename) to save.", UI_MSG_ERROR);
    +	$AppUI->setMsg('Could not open locales file (%s) to save.', UI_MSG_ERROR, false, $filename);
     	$AppUI->redirect('m=system');
     }
     
    @@ -79,4 +79,4 @@
     fclose($fp);
     
     $AppUI->setMsg('Locales file saved', UI_MSG_OK);
    -$AppUI->redirect('m=system&a=translate');
    \ No newline at end of file
    +$AppUI->redirect('m=system&a=translate&module=' . urlencode($module) . '&lang=' . urlencode($lang));
    \ No newline at end of file
    
    patch file icon translation.patch (9,068 bytes) 1969-12-31 16:00 +
  • patch file icon translation_v2.patch (7,937 bytes) 1969-12-31 16:00 -
    diff -bBEru --strip-trailing-cr web2project-2.4-org/classes/w2p/Core/CAppUI.class.php web2project-2.4/classes/w2p/Core/CAppUI.class.php
    --- web2project-2.4-org/classes/w2p/Core/CAppUI.class.php	2011-07-04 08:48:28.000000000 +0200
    +++ web2project-2.4/classes/w2p/Core/CAppUI.class.php	2011-08-24 18:51:28.604069500 +0200
    @@ -500,15 +500,16 @@
     	 * @return string
     	 */
     	public function _($str, $flags = 0) {
    -		if (is_array($str)) {
    +		if (!is_array($str)) {
    +			$str = array($str);
    +		}
     			$translated = array();
    +		$args = func_get_args();
     			foreach ($str as $s) {
    -				$translated[] = $this->__($s, $flags);
    +			$args[0] = $s;
    +			$translated[] = call_user_func_array(array( $this, '__'), $args);
     			}
     			return implode(' ', $translated);
    -		} else {
    -			return $this->__($str, $flags);
    -		}
     	}
     
     	public function __($str, $flags = 0) {
    @@ -566,6 +568,15 @@
     				$str = stripslashes($str);
     				break;
     		}
    +		
    +		if(func_num_args() > 2)
    +		{
    +			$args = func_get_args();
    +			array_splice($args, 1, 1);
    +			$args[0] = $str;
    +			$str = call_user_func_array("sprintf", $args);
    +		}
    +		
     		return $str;
     	}
     	/**
    @@ -677,17 +688,18 @@
     	public function setMsg($msg, $msgNo = 0, $append = false) {
             $this->msgNo = $msgNo;
     
    -        if (is_array($msg)) {
    +        if (!is_array($msg)) {
    +        	$msg = array($msg);
    +        }
                 $tmp_msg = '';
    +		$args = func_get_args();
    +		array_splice($args, 1, 2, UI_OUTPUT_RAW);
                 foreach ($msg as $value) {
    -                $tmp_msg .= $this->_($value, UI_OUTPUT_RAW) . '<br />';
    +        	$args[0] = $value; 
    +            $tmp_msg .= call_user_func_array(array($this,'_'), $args) . '<br />';
                 }
                 $tmp_msg = trim($tmp_msg, '<br />');
                 $this->msg = ($append) ? $this->msg . ' ' . $tmp_msg : $tmp_msg;
    -        } else {
    -            $msg = $this->_($msg, UI_OUTPUT_RAW);
    -            $this->msg = ($append) ? $this->msg . ' ' . $msg : $msg;
    -        }
     	}
     	/**
     	 * Display the formatted message and icon
    --- web2project-2.4-org/modules/system/do_module_upload.php	2011-03-08 07:58:58.000000000 +0100
    +++ web2project-2.4/modules/system/do_module_upload.php	2011-08-24 15:04:01.000000000 +0200
    @@ -17,7 +17,7 @@
         if (is_array($result)) {
             $AppUI->setMsg($result, UI_MSG_ERROR, true);
         } else {
    -        $AppUI->setMsg($AppUI->_('This module was expanded successfully.'), UI_MSG_OK, true);
    +        $AppUI->setMsg('This module was expanded successfully.', UI_MSG_OK, true);
         }
     }
     
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/index.php web2project-2.4/modules/system/index.php
    --- web2project-2.4-org/modules/system/index.php	2011-04-30 23:39:24.000000000 +0200
    +++ web2project-2.4/modules/system/index.php	2011-08-24 18:24:10.000000000 +0200
    @@ -51,8 +51,8 @@
                 $time = new DateTimeZone($tzName);
                 $x = new DateTime();
                 $offset = $time->getOffset($x);
    -            $offset = ($offset >= 0) ? '+'.$offset/3600 : $offset/3600;
    -            echo $AppUI->_('Your system has a default timezone of GMT'.$offset.'.');
    +            $offset = $offset/3600;
    +            echo $AppUI->_('Your system has a default timezone of GMT%+d.', 0, $offset);
             } else {
               ?>
               <a href="?m=system&a=systemconfig#system_timezone"><?php echo $AppUI->_('Select a Timezone'); ?></a> -
    @@ -64,7 +64,7 @@
             if (version_compare($AppUI->getVersion(), $availableVersion, '<')) {
                 ?>
                 <a href="http://sourceforge.net/projects/web2project/" target="_new"><?php echo $AppUI->_('Upgrade Available!'); ?></a> -
    -            <span class="error"><?php echo $AppUI->_('Your system should be upgraded to v'.$availableVersion.'.  Please upgrade at your earliest convenience.'); ?></span>
    +            <span class="error"><?php echo $AppUI->_('Your system should be upgraded to v%s.  Please upgrade at your earliest convenience.', 0, $availableVersion); ?></span>
                 <?php
             } else {
                 echo $AppUI->_('Your system is the latest version available.');
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/roles/index.php web2project-2.4/modules/system/roles/index.php
    --- web2project-2.4-org/modules/system/roles/index.php	2010-12-31 06:34:18.000000000 +0100
    +++ web2project-2.4/modules/system/roles/index.php	2011-08-24 22:04:06.000000000 +0200
    @@ -41,7 +41,7 @@
     if ($canDelete) {
     ?>
     function delIt(id) {
    -	if (confirm( 'Are you sure you want to delete this?' )) {
    +	if (confirm( <?php echo $AppUI->_('Are you sure you want to delete this?') ?> )) {
     		f = document.roleFrm;
     		f.del.value = 1;
     		f.role_id.value = id;
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/syskeys/keys.php web2project-2.4/modules/system/syskeys/keys.php
    --- web2project-2.4-org/modules/system/syskeys/keys.php	2011-08-07 09:08:46.000000000 +0200
    +++ web2project-2.4/modules/system/syskeys/keys.php	2011-08-24 22:24:09.000000000 +0200
    @@ -30,7 +30,7 @@
     if ($canEdit) {
     ?>
     function delIt(id) {
    -	if (confirm( 'Are you sure you want to delete this?' )) {
    +	if (confirm( <?php echo $AppUI->_('Are you sure you want to delete this?') ?> )) {
     		f = document.sysKeyFrm;
     		f.del.value = 1;
     		f.syskey_id.value = id;
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/translate.php web2project-2.4/modules/system/translate.php
    --- web2project-2.4-org/modules/system/translate.php	2011-01-16 07:57:20.000000000 +0100
    +++ web2project-2.4/modules/system/translate.php	2011-08-24 14:39:14.000000000 +0200
    @@ -75,11 +75,11 @@
      *   linebreaks, etc.
      */
     if(file_exists($localeFile) && !is_writable($localeFile)) {
    -    $titleBlock->addCell('', '', '<span class="error">' . $AppUI->_("Locales file ($localeFile) is not writable.") . '</span><br />', '');
    +    $titleBlock->addCell('', '', '<span class="error">' . $AppUI->_('Locales file (%s) is not writable.', 0, $localeFile) . '</span><br />', '');
     }
     $localeFolder = pathinfo($localeFile, PATHINFO_DIRNAME);
     if(!is_writable($localeFolder)) {
    -    $titleBlock->addCell('', '', '<span class="warning">' . $AppUI->_("Locales folder ($localeFolder) is not writable.") . '</span>', '');
    +    $titleBlock->addCell('', '', '<span class="warning">' . $AppUI->_("Locales folder (%s) is not writable.", 0, $localeFolder) . '</span>', '');
     }
     
     $titleBlock->addCell($AppUI->_('Module'), '', '<form action="?m=system&a=translate" method="post" name="modlang" accept-charset="utf-8">', '');
    diff -bBEru --strip-trailing-cr web2project-2.4-org/modules/system/translate_save.php web2project-2.4/modules/system/translate_save.php
    --- web2project-2.4-org/modules/system/translate_save.php	2011-05-09 00:25:16.000000000 +0200
    +++ web2project-2.4/modules/system/translate_save.php	2011-08-24 21:52:43.000000000 +0200
    @@ -33,7 +33,7 @@
     		} else {
     			$res = mkdir($mod_locale, 0777);
     			if (!$res) {
    -				$AppUI->setMsg("Could not create folder ($mod_locale) to save locale file.", UI_MSG_ERROR);
    +				$AppUI->setMsg('Could not create folder (%s) to save locale file.', UI_MSG_ERROR, false, $mod_locale);
     				$AppUI->redirect('m=system');
     			} else {
     				$filename = $mod_locale . '/' . $module . '.inc';
    @@ -47,7 +47,7 @@
     $fp = fopen($filename, 'wt');
     
     if (!$fp) {
    -	$AppUI->setMsg("Could not open locales file ($filename) to save.", UI_MSG_ERROR);
    +	$AppUI->setMsg('Could not open locales file (%s) to save.', UI_MSG_ERROR, false, $filename);
     	$AppUI->redirect('m=system');
     }
     
    @@ -79,4 +79,4 @@
     fclose($fp);
     
     $AppUI->setMsg('Locales file saved', UI_MSG_OK);
    -$AppUI->redirect('m=system&a=translate');
    \ No newline at end of file
    +$AppUI->redirect('m=system&a=translate&module=' . urlencode($module) . '&lang=' . urlencode($lang));
    \ No newline at end of file
    
    patch file icon translation_v2.patch (7,937 bytes) 1969-12-31 16:00 +
  • patch file icon translation_v3.patch (17,816 bytes) 1969-12-31 16:00 -
    Index: index.php
    ===================================================================
    --- index.php	(revision 2033)
    +++ index.php	(working copy)
    @@ -291,7 +291,7 @@
     	echo '<table width="100%" cellspacing="0" cellpadding="3" border="0" class="std">';
     	echo '<tr>';
     	echo '	<td>';
    -	echo $AppUI->_('Missing file. Possible Module "' . $m . '" missing!');
    +	echo $AppUI->_('Missing file. Possible Module "%s" missing!', 0, $m);
     	echo '	</td>';
     	echo '</tr>';
     	echo '</table>';
    Index: updatecontact.php
    ===================================================================
    --- updatecontact.php	(revision 2033)
    +++ updatecontact.php	(working copy)
    @@ -20,7 +20,7 @@
     // check permissions for this record
     
     if (!$contact_id) {
    -	echo ($AppUI->_('You are not authorized to use this page. If you should be authorized please contact') . ' ' . $w2Pconfig['company_name'] . ' ' . $AppUI->_('to give you another valid link, thank you.'));
    +	echo ($AppUI->_('You are not authorized to use this page. If you should be authorized please contact %s to give you another valid link, thank you.', 0, $w2Pconfig['company_name']));
     	exit;
     }
     
    Index: classes/w2p/Core/CAppUI.class.php
    ===================================================================
    --- classes/w2p/Core/CAppUI.class.php	(revision 2033)
    +++ classes/w2p/Core/CAppUI.class.php	(working copy)
    @@ -500,15 +500,16 @@
     	 * @return string
     	 */
     	public function _($str, $flags = 0) {
    -		if (is_array($str)) {
    +		if (!is_array($str)) {
    +			$str = array($str);
    +		}
     			$translated = array();
    +		$args = func_get_args();
     			foreach ($str as $s) {
    -				$translated[] = $this->__($s, $flags);
    +			$args[0] = $s;
    +			$translated[] = call_user_func_array(array( $this, '__'), $args);
     			}
     			return implode(' ', $translated);
    -		} else {
    -			return $this->__($str, $flags);
    -		}
     	}
     
     	public function __($str, $flags = 0) {
    @@ -566,6 +567,15 @@
     				$str = stripslashes($str);
     				break;
     		}
    +		
    +		if(func_num_args() > 2)
    +		{
    +			$args = func_get_args();
    +			array_splice($args, 1, 1);
    +			$args[0] = $str;
    +			$str = call_user_func_array("sprintf", $args);
    +		}
    +		
     		return $str;
     	}
     	/**
    @@ -677,17 +687,18 @@
     	public function setMsg($msg, $msgNo = 0, $append = false) {
             $this->msgNo = $msgNo;
     
    -        if (is_array($msg)) {
    +        if (!is_array($msg)) {
    +        	$msg = array($msg);
    +        }
                 $tmp_msg = '';
    +		$args = func_get_args();
    +		array_splice($args, 1, 2, UI_OUTPUT_RAW);
                 foreach ($msg as $value) {
    -                $tmp_msg .= $this->_($value, UI_OUTPUT_RAW) . '<br />';
    +        	$args[0] = $value; 
    +            $tmp_msg .= call_user_func_array(array($this,'_'), $args) . '<br />';
                 }
                 $tmp_msg = trim($tmp_msg, '<br />');
                 $this->msg = ($append) ? $this->msg . ' ' . $tmp_msg : $tmp_msg;
    -        } else {
    -            $msg = $this->_($msg, UI_OUTPUT_RAW);
    -            $this->msg = ($append) ? $this->msg . ' ' . $msg : $msg;
    -        }
     	}
     	/**
     	 * Display the formatted message and icon
    Index: modules/projects/vw_idx_projects.php
    ===================================================================
    --- modules/projects/vw_idx_projects.php	(revision 2033)
    +++ modules/projects/vw_idx_projects.php	(working copy)
    @@ -1,4 +1,4 @@
    -<?php /* PROJECTS $Id: vw_idx_projects.php 1500 2010-11-27 22:45:35Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/projects/vw_idx_projects.php $ */
    +<?php /* PROJECTS $Id$ $URL$ */
     if (!defined('W2P_BASE_DIR')) {
     	die('You should not access this file directly.');
     }
    @@ -284,7 +284,7 @@
                         $s .= '<td class="center"><input type="checkbox" name="project_id[]" value="' . $row['project_id'] . '" /></td>';
     					if ($show_all_projects) {
     						$s .= '<td class="left" nowrap="nowrap">';
    -						$s .= $row['project_status'] == 0 ? $AppUI->_('Not Defined') : ($projectStatuses[0] ? $AppUI->_($project_statuses[$row['project_status'] + 2]) : $AppUI->_($project_statuses[$row['project_status'] + 1]));
    +						$s .= $AppUI->_( $row['project_status'] == 0 ? 'Not Defined' : ($projectStatuses[0] ? $project_statuses[$row['project_status'] + 2] : $project_statuses[$row['project_status'] + 1]));
     						$s .= '</td>';
     					}
     
    Index: modules/public/welcome.php
    ===================================================================
    --- modules/public/welcome.php	(revision 2033)
    +++ modules/public/welcome.php	(working copy)
    @@ -49,10 +49,10 @@
     	<td width="100%" valign="top">
     		<p>
     			<?php echo $AppUI->_('We have 3 main places for your assistance. Please remember that all of these places are not one-way: You can help others as well by contributing.'); ?>
    -			<br /><?php echo sprintf($AppUI->_('The %1$s%3s Online Documentation%2$s is intended to provide you with informations about how to use %3$s (e.g. explanation of modules, features, training ...).'), '<a href="http://wiki.web2Project.net/" target="_blank">', '</a>', '<b>web2Project</b>'); ?>
    -			<br /><?php echo sprintf($AppUI->_('Further Assistance can be found in the %1$s%2$s Support Forums%3$s.'), '<a href="http://forums.web2Project.net/" target="_blank">', '<b>web2Project</b>', '</a>'); ?>
    -			<br /><?php echo sprintf($AppUI->_('Information about known problems and suggested enhancements can be read and submitted at the %1$s%2$s Bugs & Suggestions%3$s site.'), '<a href="http://bugs.web2Project.net/" target="_blank">', '<b>web2Project</b>', '</a>'); ?>
    -			<br /><?php echo sprintf($AppUI->_('If you\'re looking for Professional Support concerning %s consider getting in touch with the developers directly on the forums.'), '<a href="http://www.web2Project.net/" target="_blank"><b>web2Project</b></a>'); ?>
    +			<br /><?php echo $AppUI->_('The %1$s%3s Online Documentation%2$s is intended to provide you with informations about how to use %3$s (e.g. explanation of modules, features, training ...).', 0, '<a href="http://wiki.web2Project.net/" target="_blank">', '</a>', '<b>web2Project</b>'); ?>
    +			<br /><?php echo $AppUI->_('Further Assistance can be found in the %1$s%2$s Support Forums%3$s.', 0, '<a href="http://forums.web2Project.net/" target="_blank">', '<b>web2Project</b>', '</a>'); ?>
    +			<br /><?php echo $AppUI->_('Information about known problems and suggested enhancements can be read and submitted at the %1$s%2$s Bugs & Suggestions%3$s site.', 0, '<a href="http://bugs.web2Project.net/" target="_blank">', '<b>web2Project</b>', '</a>'); ?>
    +			<br /><?php echo $AppUI->_('If you\'re looking for Professional Support concerning %s consider getting in touch with the developers directly on the forums.', 0, '<a href="http://www.web2Project.net/" target="_blank"><b>web2Project</b></a>'); ?>
     		</p>
     	</td>
     </tr>
    @@ -61,7 +61,7 @@
     </th>
     <tr>
     	<td width="100%" valign="top">
    -		<p><?php echo sprintf($AppUI->_('%s is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.'), '<b>web2Project</b>'); ?>
    +		<p><?php echo $AppUI->_('%s is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.', 0, '<b>web2Project</b>'); ?>
     		<br /><?php echo $AppUI->_('web2Project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'); ?> 
     		<br /><?php echo $AppUI->_('See the GNU General Public License for more details.'); ?>
     		<br />
    @@ -76,7 +76,7 @@
     </th>
     <tr>
     	<td width="100%" valign="top">
    -		<p><?php echo sprintf($AppUI->_('The following Third Party libraries/scripts were used in making %1$s, but %2$swe are not endorsed by any of them%3$s and only show here for proper Credit and as a token of gratitude for the amazing effort provided by their developers and communities in building such quality libraries.'), '<b>web2Project</b>', '<b>', '</b>'); ?>
    +		<p><?php echo $AppUI->_('The following Third Party libraries/scripts were used in making %1$s, but %2$swe are not endorsed by any of them%3$s and only show here for proper Credit and as a token of gratitude for the amazing effort provided by their developers and communities in building such quality libraries.', 0, '<b>web2Project</b>', '<b>', '</b>'); ?>
     		<br/>
     		<br/>
     		<?php echo $AppUI->_('We wish to thank all the following Third Party projects in alphabetical order'); ?>:
    Index: modules/calendar/week_view.php
    ===================================================================
    --- modules/calendar/week_view.php	(revision 2033)
    +++ modules/calendar/week_view.php	(working copy)
    @@ -1,4 +1,4 @@
    -<?php /* $Id: week_view.php 1514 2010-12-04 23:49:08Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/calendar/week_view.php $ */
    +<?php /* $Id$ $URL$ */
     if (!defined('W2P_BASE_DIR')) {
     	die('You should not access this file directly.');
     }
    @@ -88,7 +88,7 @@
     		<a href="<?php echo '?m=calendar&a=week_view&date=' . $prev_week->format(FMT_TIMESTAMP_DATE); ?>"><img src="<?php echo w2PfindImage('prev.gif'); ?>" width="16" height="16" alt="pre" border="0"></a>
     	</td>
     	<th width="100%">
    -		<span style="font-size:12pt"><?php echo $AppUI->_('Week') . ' ' . $first_time->format('%U - %Y') . ' - ' . $AppUI->_($first_time->format('%B')); ?></span>
    +		<span style="font-size:12pt"><?php echo $AppUI->_('Week') . ' ' . $first_time->format('%U - %Y - ') . $AppUI->_($first_time->format('%B')); ?></span>
     	</th>
     	<td>
     		<a href="<?php echo '?m=calendar&a=week_view&date=' . $next_week->format(FMT_TIMESTAMP_DATE); ?>"><img src="<?php echo w2PfindImage('next.gif'); ?>" width="16" height="16" alt="next" border="0"></a>
    Index: modules/calendar/view.php
    ===================================================================
    --- modules/calendar/view.php	(revision 2033)
    +++ modules/calendar/view.php	(working copy)
    @@ -127,7 +127,7 @@
     			</tr>
     			<tr>
     				<td align="right" nowrap="nowrap"><?php echo $AppUI->_('Recurs'); ?>:</td>
    -				<td class="hilite"><?php echo $AppUI->_($recurs[$event->event_recurs]) . ($event->event_recurs ? ' (' . $event->event_times_recuring . '&nbsp;' . $AppUI->_('times') . ')' : ''); ?></td>
    +				<td class="hilite"><?php echo $AppUI->_($recurs[$event->event_recurs]) . ($event->event_recurs ? ' (' . $AppUI->_('%d&nbsp;times', UI_OUTPUT_RAW, $event->event_times_recuring) . ')' : ''); ?></td>
     			</tr>
     			<tr>
     				<td align="right" nowrap="nowrap"><?php echo $AppUI->_('Attendees'); ?>:</td>
    Index: modules/calendar/links_events.php
    ===================================================================
    --- modules/calendar/links_events.php	(revision 2033)
    +++ modules/calendar/links_events.php	(working copy)
    @@ -102,7 +102,7 @@
     	$tt .= '		</tr>';
     	$tt .= '		<tr>';
     	$tt .= '			<td style="border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;" align="right" nowrap="nowrap">' . $AppUI->_('Recurs') . '</td>';
    -	$tt .= '			<td nowrap="nowrap">' . $AppUI->_($recurs[$event->event_recurs]) . ($event->event_recurs ? ' (' . $event->event_times_recuring . '&nbsp;' . $AppUI->_('times') . ')' : '') . '</td>';
    +	$tt .= '			<td nowrap="nowrap">' . $AppUI->_($recurs[$event->event_recurs]) . ($event->event_recurs ? ' (' . $AppUI->_('%d&nbsp;times', UI_OUTPUT_RAW, $event->event_times_recuring) . ')' : '') . '</td>';
     	$tt .= '		</tr>';
     	$tt .= '		<tr>';
     	$tt .= '			<td style="border: 1px solid white;-moz-border-radius:3.5px;-webkit-border-radius:3.5px;" align="right" nowrap="nowrap">' . $AppUI->_('Attendees') . '</td>';
    Index: modules/system/do_module_upload.php
    ===================================================================
    --- modules/system/do_module_upload.php	(revision 2033)
    +++ modules/system/do_module_upload.php	(working copy)
    @@ -17,7 +17,7 @@
         if (is_array($result)) {
             $AppUI->setMsg($result, UI_MSG_ERROR, true);
         } else {
    -        $AppUI->setMsg($AppUI->_('This module was expanded successfully.'), UI_MSG_OK, true);
    +        $AppUI->setMsg('This module was expanded successfully.', UI_MSG_OK, true);
         }
     }
     
    Index: modules/system/translate_save.php
    ===================================================================
    --- modules/system/translate_save.php	(revision 2033)
    +++ modules/system/translate_save.php	(working copy)
    @@ -33,7 +33,7 @@
     		} else {
     			$res = mkdir($mod_locale, 0777);
     			if (!$res) {
    -				$AppUI->setMsg("Could not create folder ($mod_locale) to save locale file.", UI_MSG_ERROR);
    +				$AppUI->setMsg('Could not create folder (%s) to save locale file.', UI_MSG_ERROR, false, $mod_locale);
     				$AppUI->redirect('m=system');
     			} else {
     				$filename = $mod_locale . '/' . $module . '.inc';
    @@ -47,7 +47,7 @@
     $fp = fopen($filename, 'wt');
     
     if (!$fp) {
    -	$AppUI->setMsg("Could not open locales file ($filename) to save.", UI_MSG_ERROR);
    +	$AppUI->setMsg('Could not open locales file (%s) to save.', UI_MSG_ERROR, false, $filename);
     	$AppUI->redirect('m=system');
     }
     
    @@ -79,4 +79,4 @@
     fclose($fp);
     
     $AppUI->setMsg('Locales file saved', UI_MSG_OK);
    -$AppUI->redirect('m=system&a=translate');
    \ No newline at end of file
    +$AppUI->redirect('m=system&a=translate&module=' . urlencode($module) . '&lang=' . urlencode($lang));
    \ No newline at end of file
    Index: modules/system/roles/index.php
    ===================================================================
    --- modules/system/roles/index.php	(revision 2033)
    +++ modules/system/roles/index.php	(working copy)
    @@ -41,7 +41,7 @@
     if ($canDelete) {
     ?>
     function delIt(id) {
    -	if (confirm( 'Are you sure you want to delete this?' )) {
    +	if (confirm( <?php echo $AppUI->_('Are you sure you want to delete this role?', UI_OUTPUT_JS) ?> )) {
     		f = document.roleFrm;
     		f.del.value = 1;
     		f.role_id.value = id;
    Index: modules/system/translate.php
    ===================================================================
    --- modules/system/translate.php	(revision 2033)
    +++ modules/system/translate.php	(working copy)
    @@ -75,11 +75,11 @@
      *   linebreaks, etc.
      */
     if(file_exists($localeFile) && !is_writable($localeFile)) {
    -    $titleBlock->addCell('', '', '<span class="error">' . $AppUI->_("Locales file ($localeFile) is not writable.") . '</span><br />', '');
    +    $titleBlock->addCell('', '', '<span class="error">' . $AppUI->_('Locales file (%s) is not writable.', 0, $localeFile) . '</span><br />', '');
     }
     $localeFolder = pathinfo($localeFile, PATHINFO_DIRNAME);
     if(!is_writable($localeFolder)) {
    -    $titleBlock->addCell('', '', '<span class="warning">' . $AppUI->_("Locales folder ($localeFolder) is not writable.") . '</span>', '');
    +    $titleBlock->addCell('', '', '<span class="warning">' . $AppUI->_("Locales folder (%s) is not writable.", 0, $localeFolder) . '</span>', '');
     }
     
     $titleBlock->addCell($AppUI->_('Module'), '', '<form action="?m=system&a=translate" method="post" name="modlang" accept-charset="utf-8">', '');
    Index: modules/system/index.php
    ===================================================================
    --- modules/system/index.php	(revision 2033)
    +++ modules/system/index.php	(working copy)
    @@ -51,8 +51,8 @@
                 $time = new DateTimeZone($tzName);
                 $x = new DateTime();
                 $offset = $time->getOffset($x);
    -            $offset = ($offset >= 0) ? '+'.$offset/3600 : $offset/3600;
    -            echo $AppUI->_('Your system has a default timezone of GMT'.$offset.'.');
    +            $offset = $offset/3600;
    +            echo $AppUI->_('Your system has a default timezone of GMT%+d.', 0, $offset);
             } else {
               ?>
               <a href="?m=system&a=systemconfig#system_timezone"><?php echo $AppUI->_('Select a Timezone'); ?></a> -
    @@ -64,7 +64,7 @@
             if (version_compare($AppUI->getVersion(), $availableVersion, '<')) {
                 ?>
                 <a href="http://sourceforge.net/projects/web2project/" target="_new"><?php echo $AppUI->_('Upgrade Available!'); ?></a> -
    -            <span class="error"><?php echo $AppUI->_('Your system should be upgraded to v'.$availableVersion.'.  Please upgrade at your earliest convenience.'); ?></span>
    +            <span class="error"><?php echo $AppUI->_('Your system should be upgraded to v%s.  Please upgrade at your earliest convenience.', 0, $availableVersion); ?></span>
                 <?php
             } else {
                 echo $AppUI->_('Your system is the latest version available.');
    Index: modules/system/syskeys/keys.php
    ===================================================================
    --- modules/system/syskeys/keys.php	(revision 2033)
    +++ modules/system/syskeys/keys.php	(working copy)
    @@ -30,7 +30,7 @@
     if ($canEdit) {
     ?>
     function delIt(id) {
    -	if (confirm( 'Are you sure you want to delete this?' )) {
    +	if (confirm( <?php echo $AppUI->_('Are you sure you want to delete this key?', UI_OUTPUT_JS) ?> )) {
     		f = document.sysKeyFrm;
     		f.del.value = 1;
     		f.syskey_id.value = id;
    Index: modules/contacts/select_contact_company.php
    ===================================================================
    --- modules/contacts/select_contact_company.php	(revision 2033)
    +++ modules/contacts/select_contact_company.php	(working copy)
    @@ -90,7 +90,7 @@
     			<tr>
     				<td colspan="2">
     					<?php
    -						echo $AppUI->_('Select') . ' ' . $AppUI->_($selection_string) . ':<br />';
    +						echo $AppUI->_('Select %s', 0, $AppUI->_($selection_string)) . ':<br />';
     						echo arraySelect($select_list, $id_field, 'class="text" style="width:300px" size="10"', $dataId);
     					?>
     				</td>
    patch file icon translation_v3.patch (17,816 bytes) 1969-12-31 16:00 +

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2011-08-25 00:00 giesenja New Issue
2011-08-25 00:00 giesenja File Added: translation.patch
2011-08-25 00:26 giesenja File Added: translation_v2.patch
2011-08-25 05:39 giesenja File Added: translation_v3.patch
2014-06-22 21:02 caseydk Category General => Translations
+Issue History