Switch to gettext for i18n
Switch to gettext for i18n

--- a/include/controller/ControllerBase.class.php
+++ b/include/controller/ControllerBase.class.php
@@ -81,7 +81,7 @@
 		if (isset($_GET['p'])) {
 			$this->project = GitPHP_ProjectList::GetInstance()->GetProject(str_replace(chr(0), '', $_GET['p']));
 			if (!$this->project) {
-				throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->Format('Invalid project %1$s', $_GET['p']), true);
+				throw new GitPHP_MessageException(sprintf(GitPHP_Resource::GetInstance()->translate('Invalid project %1$s'), $_GET['p']), true);
 			}
 		}
 
@@ -166,9 +166,10 @@
 	 *
 	 * @abstract
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public abstract function GetName();
+	public abstract function GetName($local);
 
 	/**
 	 * ReadQuery
@@ -237,6 +238,7 @@
 		$this->tpl->assign('javascript', GitPHP_Config::GetInstance()->GetValue('javascript', true));
 		$this->tpl->assign('pagetitle', GitPHP_Config::GetInstance()->GetValue('title', $gitphp_appstring));
 		$this->tpl->assign('action', $this->GetName());
+		$this->tpl->assign('actionlocal', $this->GetName(true));
 		if ($this->project)
 			$this->tpl->assign('project', $this->project);
 		if (GitPHP_Config::GetInstance()->GetValue('search', true))

--- a/include/controller/Controller_Blame.class.php
+++ b/include/controller/Controller_Blame.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -70,10 +70,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('blame');
+		}
 		return 'blame';
 	}
 

--- a/include/controller/Controller_Blob.class.php
+++ b/include/controller/Controller_Blob.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -69,10 +69,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
-	{
+	public function GetName($local = false)
+	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('blob');
+		}
 		return 'blob';
 	}
 

--- a/include/controller/Controller_Blobdiff.class.php
+++ b/include/controller/Controller_Blobdiff.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -70,10 +70,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('blobdiff');
+		}
 		return 'blobdiff';
 	}
 

--- a/include/controller/Controller_Commit.class.php
+++ b/include/controller/Controller_Commit.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -70,10 +70,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('commit');
+		}
 		return 'commit';
 	}
 

--- a/include/controller/Controller_Commitdiff.class.php
+++ b/include/controller/Controller_Commitdiff.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -70,10 +70,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('commitdiff');
+		}
 		return 'commitdiff';
 	}
 

--- a/include/controller/Controller_Heads.class.php
+++ b/include/controller/Controller_Heads.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -67,10 +67,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('heads');
+		}
 		return 'heads';
 	}
 

--- a/include/controller/Controller_History.class.php
+++ b/include/controller/Controller_History.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -67,10 +67,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('history');
+		}
 		return 'history';
 	}
 

--- a/include/controller/Controller_Log.class.php
+++ b/include/controller/Controller_Log.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -70,12 +70,19 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
 		if (isset($this->params['short']) && ($this->params['short'] === true)) {
+			if ($local) {
+				return GitPHP_Resource::GetInstance()->translate('shortlog');
+			}
 			return 'shortlog';
+		}
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('log');
 		}
 		return 'log';
 	}

--- a/include/controller/Controller_Message.class.php
+++ b/include/controller/Controller_Message.class.php
@@ -66,9 +66,10 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
 		// This isn't a real controller
 		return '';

--- a/include/controller/Controller_Project.class.php
+++ b/include/controller/Controller_Project.class.php
@@ -30,7 +30,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -66,10 +66,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('summary');
+		}
 		return 'summary';
 	}
 

--- a/include/controller/Controller_ProjectList.class.php
+++ b/include/controller/Controller_ProjectList.class.php
@@ -74,14 +74,24 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
 		if (isset($this->params['opml']) && ($this->params['opml'] === true)) {
+			if ($local) {
+				return GitPHP_Resource::GetInstance()->translate('opml');
+			}
 			return 'opml';
 		} else if (isset($this->params['txt']) && ($this->params['txt'] === true)) {
+			if ($local) {
+				return GitPHP_Resource::GetInstance()->translate('project index');
+			}
 			return 'project index';
+		}
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('projects');
 		}
 		return 'projects';
 	}

--- a/include/controller/Controller_Rss.class.php
+++ b/include/controller/Controller_Rss.class.php
@@ -32,7 +32,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -68,10 +68,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('rss');
+		}
 		return 'rss';
 	}
 

--- a/include/controller/Controller_Search.class.php
+++ b/include/controller/Controller_Search.class.php
@@ -35,13 +35,13 @@
 	public function __construct()
 	{
 		if (!GitPHP_Config::GetInstance()->GetValue('search', true)) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Search has been disabled'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Search has been disabled'), true);
 		}
 
 		parent::__construct();
 
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 
 	}
@@ -81,10 +81,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('search');
+		}
 		return 'search';
 	}
 
@@ -102,13 +106,13 @@
 
 		if ($this->params['searchtype'] == GITPHP_SEARCH_FILE) {
 			if (!GitPHP_Config::GetInstance()->GetValue('filesearch', true)) {
-				throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('File search has been disabled'), true);
+				throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('File search has been disabled'), true);
 			}
 
 		}
 
 		if ((!isset($this->params['search'])) || (strlen($this->params['search']) < 2)) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->Format('You must enter search text of at least %1$d characters', 2), true);
+			throw new GitPHP_MessageException(sprintf(GitPHP_Resource::GetInstance()->ngettext('You must enter search text of at least %1$d character', 'You must enter search text of at least %1$d characters', 2), 2), true);
 		}
 
 		if (isset($_GET['h']))
@@ -152,13 +156,13 @@
 					$results = $co->SearchFiles($this->params['search'], 101, ($this->params['page'] * 100));
 					break;
 				default:
-					throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Invalid search type'));
+					throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Invalid search type'));
 
 			}
 		}
 
 		if (count($results) < 1) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->Format('No matches for "%1$s"', $this->params['search']), false);
+			throw new GitPHP_MessageException(sprintf(GitPHP_Resource::GetInstance()->translate('No matches for "%1$s"'), $this->params['search']), false);
 		}
 
 		if (count($results) > 100) {

--- a/include/controller/Controller_Snapshot.class.php
+++ b/include/controller/Controller_Snapshot.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -67,10 +67,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('snapshot');
+		}
 		return 'snapshot';
 	}
 

--- a/include/controller/Controller_Tag.class.php
+++ b/include/controller/Controller_Tag.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -70,10 +70,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('tag');
+		}
 		return 'tag';
 	}
 

--- a/include/controller/Controller_Tags.class.php
+++ b/include/controller/Controller_Tags.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -67,10 +67,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('tags');
+		}
 		return 'tags';
 	}
 

--- a/include/controller/Controller_Tree.class.php
+++ b/include/controller/Controller_Tree.class.php
@@ -31,7 +31,7 @@
 	{
 		parent::__construct();
 		if (!$this->project) {
-			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->GetResource('Project is required'), true);
+			throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('Project is required'), true);
 		}
 	}
 
@@ -67,10 +67,14 @@
 	 * Gets the name of this controller's action
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants the localized action name
 	 * @return string action name
 	 */
-	public function GetName()
+	public function GetName($local = false)
 	{
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('tree');
+		}
 		return 'tree';
 	}
 

--- a/include/git/Blob.class.php
+++ b/include/git/Blob.class.php
@@ -168,18 +168,37 @@
 	 * @access public
 	 * @static
 	 * @param string $octMode octal mode
+	 * @param boolean $local true if caller wants localized type
 	 * @return string file type
 	 */
-	public static function FileType($octMode)
+	public static function FileType($octMode, $local = false)
 	{
 		$mode = octdec($octMode);
-		if (($mode & 0x4000) == 0x4000)
-			return 'directory';
-		else if (($mode & 0xA000) == 0xA000)
-			return 'symlink';
-		else if (($mode & 0x8000) == 0x8000)
-			return 'file';
-		return 'unknown';
+		if (($mode & 0x4000) == 0x4000) {
+			if ($local) {
+				return GitPHP_Resource::GetInstance()->translate('directory');
+			} else {
+				return 'directory';
+			}
+		} else if (($mode & 0xA000) == 0xA000) {
+			if ($local) {
+				return GitPHP_Resource::GetInstance()->translate('symlink');
+			} else {
+				return 'symlink';
+			}
+		} else if (($mode & 0x8000) == 0x8000) {
+			if ($local) {
+				return GitPHP_Resource::GetInstance()->translate('file');
+			} else {
+				return 'file';
+			}
+		}
+
+		if ($local) {
+			return GitPHP_Resource::GetInstance()->translate('unknown');
+		} else {
+			return 'unknown';
+		}
 	}
 
 	/**

--- a/include/git/FileDiff.class.php
+++ b/include/git/FileDiff.class.php
@@ -400,14 +400,15 @@
 	 * Gets the from file type
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants localized type
 	 * @return string from file type
 	 */
-	public function GetFromFileType()
-	{
-		if (!$this->diffInfoRead)
-			$this->ReadDiffInfo();
-
-		return GitPHP_Blob::FileType($this->fromMode);
+	public function GetFromFileType($local = false)
+	{
+		if (!$this->diffInfoRead)
+			$this->ReadDiffInfo();
+
+		return GitPHP_Blob::FileType($this->fromMode, $local);
 	}
 
 	/**
@@ -416,14 +417,15 @@
 	 * Gets the to file type
 	 *
 	 * @access public
+	 * @param boolean $local true if caller wants localized type
 	 * @return string to file type
 	 */
-	public function GetToFileType()
-	{
-		if (!$this->diffInfoRead)
-			$this->ReadDiffInfo();
-
-		return GitPHP_Blob::FileType($this->toMode);
+	public function GetToFileType($local = false)
+	{
+		if (!$this->diffInfoRead)
+			$this->ReadDiffInfo();
+
+		return GitPHP_Blob::FileType($this->toMode, $local);
 	}
 
 	/**
@@ -611,19 +613,19 @@
 		$tmpdir = GitPHP_Config::GetInstance()->GetValue('gittmp', '/tmp/gitphp/');
 
 		if (empty($tmpdir)) {
-			throw new Exception(GitPHP_Resource::GetInstance()->GetResource('No tmpdir defined'));
+			throw new Exception(GitPHP_Resource::GetInstance()->translate('No tmpdir defined'));
 		}
 
 		if (file_exists($tmpdir)) {
 			if (is_dir($tmpdir)) {
 				if (!is_writeable($tmpdir)) {
-					throw new Exception(GitPHP_Resource::GetInstance()->Format('Specified tmpdir %1$s is not writeable', $tmpdir));
+					throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('Specified tmpdir %1$s is not writable'), $tmpdir));
 				}
 			} else {
-				throw new Exception(GitPHP_Resource::GetInstance()->Format('Specified tmpdir %1$s is not a directory', $tmpdir));
+				throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('Specified tmpdir %1$s is not a directory'), $tmpdir));
 			}
 		} else if (!mkdir($tmpdir, 0700)) {
-			throw new Exception(GitPHP_Resource::GetInstance()->Format('Could not create tmpdir %1$s', $tmpdir));
+			throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('Could not create tmpdir %1$s'), $tmpdir));
 		}
 	}
 

--- a/include/git/GitObject.class.php
+++ b/include/git/GitObject.class.php
@@ -92,7 +92,7 @@
 	protected function SetHash($hash)
 	{
 		if (!(preg_match('/[0-9a-f]{40}/i', $hash))) {
-			throw new Exception(GitPHP_Resource::GetInstance()->Format('Invalid hash %1$s', $hash));
+			throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('Invalid hash %1$s'), $hash));
 		}
 		$this->hash = $hash;
 	}

--- a/include/git/Project.class.php
+++ b/include/git/Project.class.php
@@ -191,21 +191,21 @@
 		$fullPath = realpath($path);
 
 		if (!is_dir($fullPath)) {
-			throw new Exception(GitPHP_Resource::GetInstance()->Format('%1$s is not a directory', $project));
+			throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('%1$s is not a directory'), $project));
 		}
 
 		if (!is_file($fullPath . '/HEAD')) {
-			throw new Exception(GitPHP_Resource::GetInstance()->Format('%1$s is not a git repository', $project));
+			throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('%1$s is not a git repository'), $project));
 		}
 
 		if (preg_match('/(^|\/)\.{0,2}(\/|$)/', $project)) {
-			throw new Exception(GitPHP_Resource::GetInstance()->Format('%1$s is attempting directory traversal', $project));
+			throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('%1$s is attempting directory traversal'), $project));
 		}
 
 		$pathPiece = substr($fullPath, 0, strlen($realProjectRoot));
 
 		if ((!is_link($path)) && (strcmp($pathPiece, $realProjectRoot) !== 0)) {
-			throw new Exception(GitPHP_Resource::GetInstance()->Format('%1$s is outside of the projectroot', $project));
+			throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('%1$s is outside of the projectroot'), $project));
 		}
 
 		$this->project = $project;

--- a/include/git/ProjectListDirectory.class.php
+++ b/include/git/ProjectListDirectory.class.php
@@ -44,7 +44,7 @@
 	public function __construct($projectDir)
 	{
 		if (!is_dir($projectDir)) {
-			throw new Exception(GitPHP_Resource::GetInstance()->Format('%1$s is not a directory', $projectDir));
+			throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('%1$s is not a directory'), $projectDir));
 		}
 
 		$this->projectDir = $projectDir;

--- a/include/git/ProjectListFile.class.php
+++ b/include/git/ProjectListFile.class.php
@@ -35,7 +35,7 @@
 	public function __construct($projectFile)
 	{
 		if (!(is_string($projectFile) && is_file($projectFile))) {
-			throw new Exception(GitPHP_Resource::GetInstance()->Format('%1$s is not a file', $projectFile));
+			throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('%1$s is not a file'), $projectFile));
 		}
 
 		$this->projectConfig = $projectFile;
@@ -54,7 +54,7 @@
 	protected function PopulateProjects()
 	{
 		if (!($fp = fopen($this->projectConfig, 'r'))) {
-			throw new Exception(GitPHP_Resource::GetInstance()->Format('Failed to open project list file %1$s', $this->projectConfig));
+			throw new Exception(sprintf(GitPHP_Resource::GetInstance()->translate('Failed to open project list file %1$s'), $this->projectConfig));
 		}
 
 		$projectRoot = GitPHP_Config::GetInstance()->GetValue('projectroot');

--- a/include/resource/Resource.class.php
+++ b/include/resource/Resource.class.php
@@ -10,7 +10,8 @@
  * @subpackage Resource
  */
 
-require_once(GITPHP_RESOURCEDIR . 'ResourceBase.class.php');
+require_once(GITPHP_BASEDIR . 'lib/php-gettext/streams.php');
+require_once(GITPHP_BASEDIR . 'lib/php-gettext/gettext.php');
 
 /**
  * Resource
@@ -58,19 +59,13 @@
 	 */
 	public static function Instantiate($locale)
 	{
-		switch ($locale) {
-			case 'en_US':
-				require_once(GITPHP_LOCALEDIR . 'en_US.class.php');
-				self::$instance = new GitPHP_Resource_en_US();
-				break;
-			case 'zz_Debug':
-				require_once(GITPHP_LOCALEDIR . 'zz_Debug.class.php');
-				self::$instance = new GitPHP_Resource_zz_Debug();
-				break;
-			default:
-				throw new Exception('Invalid locale: ' . $locale);
-				break;
+		$reader = null;
+
+		if (!(($locale == 'en_US') || ($locale == 'en'))) {
+			$reader = new FileReader(GITPHP_LOCALEDIR . $locale . '/LC_MESSAGES/gitphp.mo');
 		}
+
+		self::$instance = new gettext_reader($reader);
 	}
 
 }

--- a/include/smartyplugins/modifier.agestring.php
+++ b/include/smartyplugins/modifier.agestring.php
@@ -9,21 +9,46 @@
 
 function smarty_modifier_agestring($age)
 {
-	if ($age > 60*60*24*365*2)
-		return sprintf(GitPHP_Resource::GetInstance()->GetResource('%1$d years ago'), (int)($age/60/60/24/365));
-	else if ($age > 60*60*24*(365/12)*2)
-		return sprintf(GitPHP_Resource::GetInstance()->GetResource('%1$d months ago'), (int)($age/60/60/24/(365/12)));
-	else if ($age > 60*60*24*7*2)
-		return sprintf(GitPHP_Resource::GetInstance()->GetResource('%1$d weeks ago'), (int)($age/60/60/24/7));
-	else if ($age > 60*60*24*2)
-		return sprintf(GitPHP_Resource::GetInstance()->GetResource('%1$d days ago'), (int)($age/60/60/24));
-	else if ($age > 60*60*2)
-		return sprintf(GitPHP_Resource::GetInstance()->GetResource('%1$d hours ago'), (int)($age/60/60));
-	else if ($age > 60*2)
-		return sprintf(GitPHP_Resource::GetInstance()->GetResource('%1$d min ago'), (int)($age/60));
-	else if ($age > 2)
-		return sprintf(GitPHP_Resource::GetInstance()->GetResource('%1$d sec ago'), (int)$age);
-	return GitPHP_Resource::GetInstance()->GetResource('right now');
+	$resource = GitPHP_Resource::GetInstance();
+
+	if ($age > 60*60*24*365*2) {
+
+		$years = (int)($age/60/60/24/365);
+		return sprintf($resource->ngettext('%1$d year ago', '%1$d years ago', $years), $years);
+
+	} else if ($age > 60*60*24*(365/12)*2) {
+
+		$months = (int)($age/60/60/24/(365/12));
+		return sprintf($resource->ngettext('%1$d month ago', '%1$d months ago', $months), $months);
+
+	} else if ($age > 60*60*24*7*2) {
+
+		$weeks = (int)($age/60/60/24/7);
+		return sprintf($resource->ngettext('%1$d week ago', '%1$d weeks ago', $weeks), $weeks);
+
+	} else if ($age > 60*60*24*2) {
+
+		$days = (int)($age/60/60/24);
+		return sprintf($resource->ngettext('%1$d day ago', '%1$d days ago', $days), $days);
+
+	} else if ($age > 60*60*2) {
+
+		$hours = (int)($age/60/60);
+		return sprintf($resource->ngettext('%1$d hour ago', '%1$d hours ago', $hours), $hours);
+
+	} else if ($age > 60*2) {
+
+		$min = (int)($age/60);
+		return sprintf($resource->ngettext('%1$d min ago', '%1$d min ago', $min), $min);
+
+	} else if ($age > 2) {
+
+		$sec = (int)$age;
+		return sprintf($resource->ngettext('%1$d sec ago', '%1$d sec ago', $sec), $sec);
+
+	}
+
+	return $resource->translate('right now');
 }
 
 ?>

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -21,7 +21,7 @@
 define('GITPHP_GITOBJECTDIR', GITPHP_INCLUDEDIR . 'git/');
 define('GITPHP_CONTROLLERDIR', GITPHP_INCLUDEDIR . 'controller/');
 define('GITPHP_RESOURCEDIR', GITPHP_INCLUDEDIR . 'resource/');
-define('GITPHP_LOCALEDIR', GITPHP_RESOURCEDIR . 'locale/');
+define('GITPHP_LOCALEDIR', GITPHP_BASEDIR . 'locale/');
 
 include_once(GITPHP_INCLUDEDIR . 'version.php');
 
@@ -65,7 +65,7 @@
 	}
 
 	if (!GitPHP_Config::GetInstance()->GetValue('projectroot', null)) {
-		throw new GitPHP_MessageException('A projectroot must be set in the config', true);
+		throw new GitPHP_MessageException(GitPHP_Resource::GetInstance()->translate('A projectroot must be set in the config'), true);
 	}
 
 	/*

--- a/templates/blame.tpl
+++ b/templates/blame.tpl
@@ -11,11 +11,11 @@
  <div class="page_nav">
    {include file='nav.tpl' treecommit=$commit}
    <br />
-   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob_plain&h={$blob->GetHash()}&f={$blob->GetPath()}">{$resources->GetResource('plain')}</a> | 
+   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob_plain&h={$blob->GetHash()}&f={$blob->GetPath()}">{t}plain{/t}</a> | 
    {if $commit->GetHash() != $head->GetHash()}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blame&hb=HEAD&f={$blob->GetPath()}">{$resources->GetResource('HEAD')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blame&hb=HEAD&f={$blob->GetPath()}">{t}HEAD{/t}</a>
    {else}
-     {$resources->GetResource('HEAD')}
+     {t}HEAD{/t}
    {/if}
     | blame
    <br />

--- a/templates/blob.tpl
+++ b/templates/blob.tpl
@@ -11,13 +11,13 @@
  <div class="page_nav">
    {include file='nav.tpl' treecommit=$commit}
    <br />
-   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob_plain&h={$blob->GetHash()}&f={$blob->GetPath()}">{$resources->GetResource('plain')}</a> | 
+   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob_plain&h={$blob->GetHash()}&f={$blob->GetPath()}">{t}plain{/t}</a> | 
    {if ($commit->GetHash() != $head->GetHash()) && ($head->PathToHash($blob->GetPath()))}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&hb=HEAD&f={$blob->GetPath()}">{$resources->GetResource('HEAD')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&hb=HEAD&f={$blob->GetPath()}">{t}HEAD{/t}</a>
    {else}
-     {$resources->GetResource('HEAD')}
+     {t}HEAD{/t}
    {/if}
-   {if !$datatag} | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blame&h={$blob->GetHash()}&f={$blob->GetPath()}&hb={$commit->GetHash()}" id="blameLink">{$resources->GetResource('blame')}</a>{/if}
+   {if !$datatag} | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blame&h={$blob->GetHash()}&f={$blob->GetPath()}&hb={$commit->GetHash()}" id="blameLink">{t}blame{/t}</a>{/if}
    <br />
  </div>
 

--- a/templates/blobdiff.tpl
+++ b/templates/blobdiff.tpl
@@ -11,7 +11,7 @@
  <div class="page_nav">
    {include file='nav.tpl' treecommit=$commit}
    <br />
-   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blobdiff_plain&h={$blob->GetHash()}&hp={$blobparent->GetHash()}&f={$file}">{$resources->GetResource('plain')}</a>
+   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blobdiff_plain&h={$blob->GetHash()}&hp={$blobparent->GetHash()}&f={$file}">{t}plain{/t}</a>
  </div>
 
  {include file='title.tpl' titlecommit=$commit}
@@ -21,7 +21,7 @@
  <div class="page_body">
    <div class="diff_info">
      {* Display the from -> to diff header *}
-     {$resources->GetResource('blob')}:<a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$blobparent->GetHash()}&hb={$commit->GetHash()}&f={$file}">{if $file}a/{$file}{else}{$blobparent->GetHash()}{/if}</a> -&gt; {$resources->GetResource('blob')}:<a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$blob->GetHash()}&hb={$commit->GetHash()}&f={$file}">{if $file}b/{$file}{else}{$blob->GetHash()}{/if}</a>
+     {t}blob{/t}:<a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$blobparent->GetHash()}&hb={$commit->GetHash()}&f={$file}">{if $file}a/{$file}{else}{$blobparent->GetHash()}{/if}</a> -&gt; {t}blob{/t}:<a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$blob->GetHash()}&hb={$commit->GetHash()}&f={$file}">{if $file}b/{$file}{else}{$blob->GetHash()}{/if}</a>
    </div>
    {* Display the diff *}
    {include file='filediff.tpl' diff=$filediff->GetDiff($file, false, true)}

--- a/templates/commit.tpl
+++ b/templates/commit.tpl
@@ -23,7 +23,7 @@
    {* Commit data *}
    <table cellspacing="0">
      <tr>
-       <td>{$resources->GetResource('author')}</td>
+       <td>{t}author{/t}</td>
        <td>{$commit->GetAuthorName()}</td>
      </tr>
      <tr>
@@ -37,7 +37,7 @@
        {/if}
      </tr>
      <tr>
-       <td>{$resources->GetResource('committer')}</td>
+       <td>{t}committer{/t}</td>
        <td>{$commit->GetCommitterName()}</td>
      </tr>
      <tr>
@@ -45,19 +45,19 @@
        <td> {$commit->GetCommitterEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"} ({$commit->GetCommitterLocalEpoch()|date_format:"%R"} {$commit->GetCommitterTimezone()})</td>
      </tr>
      <tr>
-       <td>{$resources->GetResource('commit')}</td>
+       <td>{t}commit{/t}</td>
        <td class="monospace">{$commit->GetHash()}</td>
      <tr>
      <tr>
-       <td>{$resources->GetResource('tree')}</td>
+       <td>{t}tree{/t}</td>
        <td class="monospace"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$tree->GetHash()}&hb={$commit->GetHash()}" class="list">{$tree->GetHash()}</a></td>
-       <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$tree->GetHash()}&hb={$commit->GetHash()}">{$resources->GetResource('tree')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$commit->GetHash()}">{$resources->GetResource('snapshot')}</a></td>
+       <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$tree->GetHash()}&hb={$commit->GetHash()}">{t}tree{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$commit->GetHash()}">{t}snapshot{/t}</a></td>
      </tr>
      {foreach from=$commit->GetParents() item=par}
        <tr>
-         <td>{$resources->GetResource('parent')}</td>
+         <td>{t}parent{/t}</td>
 	 <td class="monospace"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$par->GetHash()}" class="list">{$par->GetHash()}</a></td>
-         <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$par->GetHash()}">{$resources->GetResource('commit')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$commit->GetHash()}&hp={$par->GetHash()}">{$resources->GetResource('commitdiff')}</a></td>
+         <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$par->GetHash()}">{t}commit{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$commit->GetHash()}&hp={$par->GetHash()}">{t}commitdiff{/t}</a></td>
        </tr>
      {/foreach}
    </table>
@@ -69,7 +69,7 @@
  </div>
  <div class="list_head">
    {if $treediff->Count() > 10}
-     {$resources->Format('%1$d files changed:', $treediff->Count())|escape}
+     {t count=$treediff->Count() 1=$treediff->Count() plural="%1 files changed:"}%1 file changed:{/t}
    {/if}
  </div>
  <table cellspacing="0">
@@ -85,18 +85,19 @@
 	 </td>
          <td>
 	   <span class="newfile">
-	     {assign var=localtotype value=$resources->GetResource($diffline->GetToFileType())}
+	     {assign var=localtotype value=$diffline->GetToFileType(1)}
 	     [
 	     {if $diffline->ToFileIsRegular()}
-	     {$resources->Format('new %1$s with mode %2$s', $localtotype, $diffline->GetToModeShort())|escape}
+	       {assign var=tomode value=$diffline->GetToModeShort()}
+	       {t 1=$localtotype 2=$tomode}new %1 with mode %2{/t}
 	     {else}
-	     {$resources->Format('new %1$s', $localtotype)|escape}
+	     {t 1=$localtotype}new %1{/t}
 	     {/if}
 	     ]
 	   </span>
 	 </td>
          <td class="link">
-	   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$diffline->GetToHash()}&hb={$commit->GetHash()}&f={$diffline->GetFromFile()}">{$resources->GetResource('blob')}</a>
+	   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$diffline->GetToHash()}&hb={$commit->GetHash()}&f={$diffline->GetFromFile()}">{t}blob{/t}</a>
 	 </td>
        {elseif $diffline->GetStatus() == "D"}
          <td>
@@ -106,12 +107,12 @@
 	 </td>
          <td>
 	   <span class="deletedfile">
-	     {assign var=localfromtype value=$resources->GetResource($diffline->GetFromFileType())}
-	     [ {$resources->Format('deleted %1$s', $localfromtype)|escape} ]
+	     {assign var=localfromtype value=$diffline->GetFromFileType(1)}
+	     [ {t 1=$localfromtype}deleted %1{/t} ]
 	   </span>
 	 </td>
          <td class="link">
-	   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$diffline->GetFromHash()}&hb={$commit->GetHash()}&f={$diffline->GetFromFile()}">{$resources->GetResource('blob')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=history&h={$commit->GetHash()}&f={$diffline->GetFromFile()}">{$resources->GetResource('history')}</a>
+	   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$diffline->GetFromHash()}&hb={$commit->GetHash()}&f={$diffline->GetFromFile()}">{t}blob{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=history&h={$commit->GetHash()}&f={$diffline->GetFromFile()}">{t}history{/t}</a>
 	 </td>
        {elseif $diffline->GetStatus() == "M" || $diffline->GetStatus() == "T"}
          <td>
@@ -130,30 +131,36 @@
 	     <span class="changedfile">
 	       [
 	       {if $diffline->FileTypeChanged()}
-	     	 {assign var=localfromtype value=$resources->GetResource($diffline->GetFromFileType())}
-	     	 {assign var=localtotype value=$resources->GetResource($diffline->GetToFileType())}
+	     	 {assign var=localfromtype value=$diffline->GetFromFileType(1)}
+	     	 {assign var=localtotype value=$diffline->GetToFileType(1)}
 	         {if $diffline->FileModeChanged()}
 		   {if $diffline->FromFileIsRegular() && $diffline->ToFileIsRegular()}
-		     {$resources->Format('changed from %1$s to %2$s mode: %3$s -> %4$s', $localfromtype, $localtotype, $diffline->GetFromModeShort(), $diffline->GetToModeShort())|escape}
+		     {assign var=frommode value=$diffline->GetFromModeShort()}
+		     {assign var=tomode value=$diffline->GetToModeShort()}
+		     {t 1=$localfromtype 2=$localtotype 3=$frommode 4=$tomode}changed from %1 to %2 mode: %3 -> %4{/t}
 		   {elseif $diffline->ToFileIsRegular()}
-		     {$resources->Format('changed from %1$s to %2$s mode: %3$s', $localfromtype, $localtotype, $diffline->GetToModeShort())|escape}
+		     {assign var=tomode value=$diffline->GetToModeShort()}
+		     {t 1=$localfromtype 2=$localtotype 3=$tomode}changed from %1 to %2 mode: %3{/t}
 		   {else}
-		     {$resources->Format('changed from %1$s to %2$s', $localfromtype, $localtotype)|escape}
+		     {t 1=$localfromtype 2=$localtotype}changed from %1 to %2{/t}
 		   {/if}
 		 {else}
-		   {$resources->Format('changed from %1$s to %2$s', $localfromtype, $localtotype)|escape}
+		   {t 1=$localfromtype 2=$localtotype}changed from %1 to %2{/t}
 		 {/if}
 	       {else}
 	         {if $diffline->FileModeChanged()}
 		   {if $diffline->FromFileIsRegular() && $diffline->ToFileIsRegular()}
-		     {$resources->Format('changed mode: %1$s -> %2$s', $diffline->GetFromModeShort(), $diffline->GetToModeShort())|escape}
+		     {assign var=frommode value=$diffline->GetFromModeShort()}
+		     {assign var=tomode value=$diffline->GetToModeShort()}
+		     {t 1=$frommode 2=$tomode}changed mode: %1 -> %2{/t}
 		   {elseif $diffline->ToFileIsRegular()}
-		     {$resources->Format('changed mode: %1$s', $diffline->GetToModeShort())|escape}
+		     {assign var=tomode value=$diffline->GetToModeShort()}
+		     {t 1=$tomode}changed mode: %1{/t}
 		   {else}
-		     {$resources->GetResource('changed')}
+		     {t}changed{/t}
 		   {/if}
 		 {else}
-		   {$resources->GetResource('changed')}
+		   {t}changed{/t}
 		 {/if}
 	       {/if}
 	       ]
@@ -161,11 +168,11 @@
 	   {/if}
 	 </td>
          <td class="link">
-           <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$diffline->GetToHash()}&hb={$commit->GetHash()}&f={$diffline->GetToFile()}">{$resources->GetResource('blob')}</a>
+           <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$diffline->GetToHash()}&hb={$commit->GetHash()}&f={$diffline->GetToFile()}">{t}blob{/t}</a>
 	   {if $diffline->GetToHash() != $diffline->GetFromHash()}
-	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blobdiff&h={$diffline->GetToHash()}&hp={$diffline->GetFromHash()}&hb={$par->GetHash()}&f={$diffline->GetToFile()}">{$resources->GetResource('diff')}</a>
+	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blobdiff&h={$diffline->GetToHash()}&hp={$diffline->GetFromHash()}&hb={$par->GetHash()}&f={$diffline->GetToFile()}">{t}diff{/t}</a>
 	   {/if}
-	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=history&h={$commit->GetHash()}&f={$diffline->GetFromFile()}">{$resources->GetResource('history')}</a>
+	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=history&h={$commit->GetHash()}&f={$diffline->GetFromFile()}">{t}history{/t}</a>
 	 </td>
        {elseif $diffline->GetStatus() == "R"}
          <td>
@@ -178,18 +185,20 @@
 	     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$diffline->GetFromHash()}&hb={$commit->GetHash()}&f={$diffline->GetFromFile()}" class="list">{$diffline->GetFromFile()}</a>
 	     {/capture}
 	     [
+	     {assign var=similarity value=$diffline->GetSimilarity()}
 	     {if $diffline->GetFromMode() != $diffline->GetToMode()}
-	       {$resources->Format('moved from %1$s with %2$d%% similarity, mode: %3$s', $fromfilelink, $diffline->GetSimilarity(), $diffline->GetToModeShort())}
+	       {assign var=tomode value=$diffline->GetToModeShort()}
+	       {t escape=0 1=$fromfilelink 2=$similarity 3=$tomode}moved from %1 with %2%% similarity, mode: %3{/t}
 	     {else}
-	       {$resources->Format('moved from %1$s with %2$d%% similarity', $fromfilelink, $diffline->GetSimilarity())}
+	       {t escape=0 1=$fromfilelink 2=$similarity}moved from %1 with %2%% similarity{/t}
 	     {/if}
 	     ]
 	   </span>
 	 </td>
          <td class="link">
-	   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$diffline->GetToHash()}&hb={$commit->GetHash()}&f={$diffline->GetToFile()}">{$resources->GetResource('blob')}</a>
+	   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$diffline->GetToHash()}&hb={$commit->GetHash()}&f={$diffline->GetToFile()}">{t}blob{/t}</a>
 	   {if $diffline->GetToHash() != $diffline->GetFromHash()}
-	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blobdiff&h={$diffline->GetToHash()}&hp={$diffline->GetFromHash()}&hb={$par->GetHash()}&f={$diffline->GetToFile()}">{$resources->GetResource('diff')}</a>
+	     | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blobdiff&h={$diffline->GetToHash()}&hp={$diffline->GetFromHash()}&hb={$par->GetHash()}&f={$diffline->GetToFile()}">{t}diff{/t}</a>
 	   {/if}
 	 </td>
        {/if}

--- a/templates/commitdiff.tpl
+++ b/templates/commitdiff.tpl
@@ -15,7 +15,7 @@
    {/if}
    {include file='nav.tpl' current='commitdiff' logcommit=$commit treecommit=$commit}
    <br />
-   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff_plain&h={$commit->GetHash()}{if $hashparent}&hp={$hashparent}{/if}">{$resources->GetResource('plain')}</a>
+   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff_plain&h={$commit->GetHash()}{if $hashparent}&hp={$hashparent}{/if}">{t}plain{/t}</a>
  </div>
 
  {include file='title.tpl' titlecommit=$commit}
@@ -29,10 +29,10 @@
    {foreach from=$treediff item=filediff}
      <div class="diff_info">
      {if ($filediff->GetStatus() == 'D') || ($filediff->GetStatus() == 'M')}
-       {assign var=localfromtype value=$resources->GetResource($filediff->GetFromFileType())}
+       {assign var=localfromtype value=$filediff->GetFromFileType(1)}
        {$localfromtype}:<a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$filediff->GetFromHash()}&hb={$commit->GetHash()}{if $filediff->GetFromFile()}&f={$filediff->GetFromFile()}{/if}">{if $filediff->GetFromFile()}{$filediff->GetFromFile()}{else}{$filediff->GetFromHash()}{/if}</a>
        {if $filediff->GetStatus() == 'D'}
-         {$resources->GetResource('(deleted)')}
+         {t}(deleted){/t}
        {/if}
      {/if}
 
@@ -41,11 +41,11 @@
      {/if}
 
      {if ($filediff->GetStatus() == 'A') || ($filediff->GetStatus() == 'M')}
-       {assign var=localtotype value=$resources->GetResource($filediff->GetToFileType())}
+       {assign var=localtotype value=$filediff->GetToFileType(1)}
        {$localtotype}:<a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$filediff->GetToHash()}&hb={$commit->GetHash()}{if $filediff->GetToFile()}&f={$filediff->GetToFile()}{/if}">{if $filediff->GetToFile()}b/{$filediff->GetToFile()}{else}{$filediff->GetToHash()}{/if}</a>
 
        {if $filediff->GetStatus() == 'A'}
-         {$resources->GetResource('(new)')}
+         {t}(new){/t}
        {/if}
      {/if}
      </div>

--- a/templates/committip.tpl
+++ b/templates/committip.tpl
@@ -6,9 +6,9 @@
  *  Copyright (C) 2010 Christopher Han <xiphux@gmail.com>
  *}
 <div>
-{$resources->GetResource('author')}: {$commit->GetAuthor()} ({$commit->GetAuthorEpoch()|date_format:"%F %X"})
+{t}author{/t}: {$commit->GetAuthor()} ({$commit->GetAuthorEpoch()|date_format:"%F %X"})
 <br />
-{$resources->GetResource('committer')}: {$commit->GetCommitter()} ({$commit->GetCommitterEpoch()|date_format:"%F %X"})
+{t}committer{/t}: {$commit->GetCommitter()} ({$commit->GetCommitterEpoch()|date_format:"%F %X"})
 <br /><br />
 {foreach from=$commit->GetComment() item=line}
 {$line}<br />

--- a/templates/header.tpl
+++ b/templates/header.tpl
@@ -10,7 +10,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   <!-- gitphp web interface {$version}, (C) 2006-2010 Christopher Han <xiphux@gmail.com> -->
   <head>
-    <title>{$pagetitle}{if $project} :: {$project->GetProject()}{if $action}/{$action}{/if}{/if}</title>
+    <title>{$pagetitle}{if $project} :: {$project->GetProject()}{if $actionlocal}/{$actionlocal}{/if}{/if}</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     {if $project}
       <link rel="alternate" title="{$project->GetProject()} log" href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=rss" type="application/rss+xml" />
@@ -25,8 +25,8 @@
     {/if}
     {if $javascript}
     <script language="javascript">
-      var GITPHP_RES_LOADING="{$resources->GetResource('Loading...')}";
-      var GITPHP_RES_LOADING_BLAME_DATA="{$resources->GetResource('Loading blame data...')}";
+      var GITPHP_RES_LOADING="{t escape='js'}Loading...{/t}";
+      var GITPHP_RES_LOADING_BLAME_DATA="{t escape='js'}Loading blame data...{/t}";
     </script>
     <link rel="stylesheet" href="css/ext/jquery.qtip.css" type="text/css" />
     <script language="javascript" src="js/ext/jquery-1.4.2.min.js"></script>
@@ -43,11 +43,11 @@
       <a href="http://git-scm.com" title="git homepage">
         <img src="images/git-logo.png" width="72" height="27" alt="git" class="logo" />
       </a>
-      <a href="index.php">{$resources->GetResource('projects')}</a> / 
+      <a href="index.php">{t}projects{/t}</a> / 
       {if $project}
         <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=summary">{$project->GetProject()}</a>
-        {if $action}
-           / {$resources->GetResource($action)}
+        {if $actionlocal}
+           / {$actionlocal}
         {/if}
         {if $enablesearch}
           <form method="get" action="index.php" enctype="application/x-www-form-urlencoded">
@@ -56,13 +56,13 @@
               <input type="hidden" name="a" value="search" />
               <input type ="hidden" name="h" value="{if $commit}{$commit->GetHash()}{else}HEAD{/if}" />
               <select name="st">
-                <option {if $searchtype == 'commit'}selected="selected"{/if} value="commit">{$resources->GetResource('commit')}</option>
-                <option {if $searchtype == 'author'}selected="selected"{/if} value="author">{$resources->GetResource('author')}</option>
-                <option {if $searchtype == 'committer'}selected="selected"{/if} value="committer">{$resources->GetResource('committer')}</option>
+                <option {if $searchtype == 'commit'}selected="selected"{/if} value="commit">{t}commit{/t}</option>
+                <option {if $searchtype == 'author'}selected="selected"{/if} value="author">{t}author{/t}</option>
+                <option {if $searchtype == 'committer'}selected="selected"{/if} value="committer">{t}committer{/t}</option>
                 {if $filesearch}
-                  <option {if $searchtype == 'file'}selected="selected"{/if} value="file">{$resources->GetResource('file')}</option>
+                  <option {if $searchtype == 'file'}selected="selected"{/if} value="file">{t}file{/t}</option>
                 {/if}
-              </select> {$resources->GetResource('search')}: <input type="text" name="s" {if $search}value="{$search}"{/if} />
+              </select> {t}search{/t}: <input type="text" name="s" {if $search}value="{$search}"{/if} />
             </div>
           </form>
         {/if}

--- a/templates/headlist.tpl
+++ b/templates/headlist.tpl
@@ -19,7 +19,7 @@
        <tr class="{cycle values="light,dark"}">
          <td><em>{$headcommit->GetAge()|agestring}</em></td>
          <td><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h=refs/heads/{$head->GetName()}" class="list"><strong>{$head->GetName()}</strong></a></td>
-         <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h=refs/heads/{$head->GetName()}">{$resources->GetResource('shortlog')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log&h=refs/heads/{$head->GetName()}">{$resources->GetResource('log')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&hb={$headcommit->GetHash()}">{$resources->GetResource('tree')}</a></td>
+         <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h=refs/heads/{$head->GetName()}">{t}shortlog{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log&h=refs/heads/{$head->GetName()}">{t}log{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&hb={$headcommit->GetHash()}">{t}tree{/t}</a></td>
        </tr>
      {/if}
    {/foreach}

--- a/templates/history.tpl
+++ b/templates/history.tpl
@@ -28,7 +28,7 @@
        <td><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$historycommit->GetHash()}" class="list commitTip" {if strlen($historycommit->GetTitle()) > 50}title="{$historycommit->GetTitle()}"{/if}><strong>{$historycommit->GetTitle(50)}</strong></a>
        {include file='refbadges.tpl' commit=$historycommit}
        </td>
-       <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$historycommit->GetHash()}">{$resources->GetResource('commit')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$historycommit->GetHash()}">{$resources->GetResource('commitdiff')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&hb={$historycommit->GetHash()}&f={$blob->GetPath()}">{$resources->GetResource('blob')}</a>{if $blob->GetHash() != $historyitem->GetToHash()} | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blobdiff&h={$blob->GetHash()}&hp={$historyitem->GetToHash()}&hb={$historycommit->GetHash()}&f={$blob->GetPath()}">{$resources->GetResource('diff to current')}</a>{/if}
+       <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$historycommit->GetHash()}">{t}commit{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$historycommit->GetHash()}">{t}commitdiff{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&hb={$historycommit->GetHash()}&f={$blob->GetPath()}">{t}blob{/t}</a>{if $blob->GetHash() != $historyitem->GetToHash()} | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blobdiff&h={$blob->GetHash()}&hp={$historyitem->GetToHash()}&hb={$historycommit->GetHash()}&f={$blob->GetPath()}">{t}diff to current{/t}</a>{/if}
        </td>
      </tr>
    {/foreach}

--- a/templates/log.tpl
+++ b/templates/log.tpl
@@ -13,21 +13,21 @@
    {include file='nav.tpl' current='log' logcommit=$commit treecommit=$commit}
    <br />
    {if ($commit && $head) && (($commit->GetHash() != $head->GetHash()) || ($page > 0))}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log">{$resources->GetResource('HEAD')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log">{t}HEAD{/t}</a>
    {else}
-     {$resources->GetResource('HEAD')}
+     {t}HEAD{/t}
    {/if}
    &sdot; 
    {if $page > 0}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log&h={$commit->GetHash()}&pg={$page-1}" accesskey="p" title="Alt-p">{$resources->GetResource('prev')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log&h={$commit->GetHash()}&pg={$page-1}" accesskey="p" title="Alt-p">{t}prev{/t}</a>
    {else}
-     {$resources->GetResource('prev')}
+     {t}prev{/t}
    {/if}
    &sdot; 
    {if $hasmorerevs}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log&h={$commit->GetHash()}&pg={$page+1}" accesskey="n" title="Alt-n">{$resources->GetResource('next')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log&h={$commit->GetHash()}&pg={$page+1}" accesskey="n" title="Alt-n">{t}next{/t}</a>
    {else}
-     {$resources->GetResource('next')}
+     {t}next{/t}
    {/if}
    <br />
  </div>
@@ -38,7 +38,7 @@
    </div>
    <div class="title_text">
      <div class="log_link">
-       <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$rev->GetHash()}">{$resources->GetResource('commit')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$rev->GetHash()}">{$resources->GetResource('commitdiff')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$rev->GetHash()}&hb={$rev->GetHash()}">{$resources->GetResource('tree')}</a>
+       <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$rev->GetHash()}">{t}commit{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$rev->GetHash()}">{t}commitdiff{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$rev->GetHash()}&hb={$rev->GetHash()}">{t}tree{/t}</a>
        <br />
      </div>
      <em>{$rev->GetAuthorName()} [{$rev->GetAuthorEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"}]</em><br />
@@ -57,9 +57,10 @@
    </div>
    <div class="page_body">
      {if $commit}
-     Last change {$commit->GetAge()|agestring}
+       {assign var=commitage value=$commit->GetAge()|agestring}
+       {t 1=$commitage}Last change %1{/t}
      {else}
-     <em>No commits</em>
+     <em>{t}No commits{/t}</em>
      {/if}
      <br /><br />
    </div>

--- a/templates/nav.tpl
+++ b/templates/nav.tpl
@@ -10,38 +10,38 @@
  *}
 
    {if $current=='summary'}
-     {$resources->GetResource('summary')}
+     {t}summary{/t}
    {else}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=summary">{$resources->GetResource('summary')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=summary">{t}summary{/t}</a>
    {/if}
    | 
    {if $current=='shortlog' || !$commit}
-     {$resources->GetResource('shortlog')}
+     {t}shortlog{/t}
    {else}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog{if $logcommit}&h={$logcommit->GetHash()}{/if}">{$resources->GetResource('shortlog')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog{if $logcommit}&h={$logcommit->GetHash()}{/if}">{t}shortlog{/t}</a>
    {/if}
    | 
    {if $current=='log' || !$commit}
-     {$resources->GetResource('log')}
+     {t}log{/t}
    {else}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log{if $logcommit}&h={$logcommit->GetHash()}{/if}">{$resources->GetResource('log')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log{if $logcommit}&h={$logcommit->GetHash()}{/if}">{t}log{/t}</a>
    {/if}
    | 
    {if $current=='commit' || !$commit}
-     {$resources->GetResource('commit')}
+     {t}commit{/t}
    {else}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$commit->GetHash()}">{$resources->GetResource('commit')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$commit->GetHash()}">{t}commit{/t}</a>
    {/if}
    | 
    {if $current=='commitdiff' || !$commit}
-     {$resources->GetResource('commitdiff')}
+     {t}commitdiff{/t}
    {else}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$commit->GetHash()}">{$resources->GetResource('commitdiff')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$commit->GetHash()}">{t}commitdiff{/t}</a>
    {/if}
    | 
    {if $current=='tree' || !$commit}
-     {$resources->GetResource('tree')}
+     {t}tree{/t}
    {else}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree{if $treecommit}&hb={$treecommit->GetHash()}{/if}{if $tree}&h={$tree->GetHash()}{/if}">{$resources->GetResource('tree')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree{if $treecommit}&hb={$treecommit->GetHash()}{/if}{if $tree}&h={$tree->GetHash()}{/if}">{t}tree{/t}</a>
    {/if}
 

--- a/templates/project.tpl
+++ b/templates/project.tpl
@@ -17,16 +17,16 @@
 
  {* Project brief *}
  <table cellspacing="0">
-   <tr><td>{$resources->GetResource('description')}</td><td>{$project->GetDescription()}</td></tr>
-   <tr><td>{$resources->GetResource('owner')}</td><td>{$project->GetOwner()}</td></tr>
+   <tr><td>{t}description{/t}</td><td>{$project->GetDescription()}</td></tr>
+   <tr><td>{t}owner{/t}</td><td>{$project->GetOwner()}</td></tr>
    {if $head}
-   <tr><td>{$resources->GetResource('last change')}</td><td>{$head->GetCommitterEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"}</td></tr>
+   <tr><td>{t}last change{/t}</td><td>{$head->GetCommitterEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"}</td></tr>
    {/if}
    {if $project->GetCloneUrl()}
-     <tr><td>{$resources->GetResource('clone url')}</td><td>{$project->GetCloneUrl()}</td></tr>
+     <tr><td>{t}clone url{/t}</td><td>{$project->GetCloneUrl()}</td></tr>
    {/if}
    {if $project->GetPushUrl()}
-     <tr><td>{$resources->GetResource('push url')}</td><td>{$project->GetPushUrl()}</td></tr>
+     <tr><td>{t}push url{/t}</td><td>{$project->GetPushUrl()}</td></tr>
    {/if}
  </table>
 

--- a/templates/projectlist.tpl
+++ b/templates/projectlist.tpl
@@ -16,26 +16,26 @@
       {* Header *}
       <tr>
         {if $order == "project"}
-          <th>{$resources->GetResource('Project', 'Header')}</th>
+          <th>{t}Project{/t}</th>
         {else}
-          <th><a class="header" href="{$SCRIPT_NAME}?o=project">{$resources->GetResource('Project', 'Header')}</a></th>
+          <th><a class="header" href="{$SCRIPT_NAME}?o=project">{t}Project{/t}</a></th>
         {/if}
         {if $order == "descr"}
-          <th>{$resources->GetResource('Description', 'Header')}</th>
+          <th>{t}Description{/t}</th>
         {else}
-          <th><a class="header" href="{$SCRIPT_NAME}?o=descr">{$resources->GetResource('Description', 'Header')}</a></th>
+          <th><a class="header" href="{$SCRIPT_NAME}?o=descr">{t}Description{/t}</a></th>
         {/if}
         {if $order == "owner"}
-          <th>{$resources->GetResource('Owner', 'Header')}</th>
+          <th>{t}Owner{/t}</th>
         {else}
-          <th><a class="header" href="{$SCRIPT_NAME}?o=owner">{$resources->GetResource('Owner', 'Header')}</a></th>
+          <th><a class="header" href="{$SCRIPT_NAME}?o=owner">{t}Owner{/t}</a></th>
         {/if}
         {if $order == "age"}
-          <th>{$resources->GetResource('Last Change', 'Header')}</th>
+          <th>{t}Last Change{/t}</th>
         {else}
-          <th><a class="header" href="{$SCRIPT_NAME}?o=age">{$resources->GetResource('Last Change', 'Header')}</a></th>
+          <th><a class="header" href="{$SCRIPT_NAME}?o=age">{t}Last Change{/t}</a></th>
         {/if}
-        <th>{$resources->GetResource('Actions', 'Header')}</th>
+        <th>{t}Actions{/t}</th>
       </tr>
     {/if}
 
@@ -71,18 +71,18 @@
 	{/if}
       </td>
       <td class="link">
-        <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=summary">{$resources->GetResource('summary')}</a>
+        <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=summary">{t}summary{/t}</a>
 	{if $projecthead}
 	| 
-	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=shortlog">{$resources->GetResource('shortlog')}</a> | 
-	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=log">{$resources->GetResource('log')}</a> | 
-	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=tree">{$resources->GetResource('tree')}</a> | 
-	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=snapshot&h=HEAD">{$resources->GetResource('snapshot')}</a>
+	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=shortlog">{t}shortlog{/t}</a> | 
+	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=log">{t}log{/t}</a> | 
+	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=tree">{t}tree{/t}</a> | 
+	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=snapshot&h=HEAD">{t}snapshot{/t}</a>
 	{/if}
       </td>
     </tr>
   {foreachelse}
-    <div class="message">No projects found</div>
+    <div class="message">{t}No projects found{/t}</div>
   {/foreach}
 
 </table>

--- a/templates/search.tpl
+++ b/templates/search.tpl
@@ -13,21 +13,21 @@
   {include file='nav.tpl' logcommit=$commit treecommit=$commit}
   <br />
   {if $page > 0}
-    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}">{$resources->GetResource('first')}</a>
+    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}">{t}first{/t}</a>
   {else}
-    {$resources->GetResource('first')}
+    {t}first{/t}
   {/if}
     &sdot; 
   {if $page > 0}
-    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}{if $page > 1}&pg={$page-1}{/if}" accesskey="p" title="Alt-p">{$resources->GetResource('prev')}</a>
+    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}{if $page > 1}&pg={$page-1}{/if}" accesskey="p" title="Alt-p">{t}prev{/t}</a>
   {else}
-    {$resources->GetResource('prev')}
+    {t}prev{/t}
   {/if}
     &sdot; 
   {if $hasmore}
-    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}&pg={$page+1}" accesskey="n" title="Alt-n">{$resources->GetResource('next')}</a>
+    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}&pg={$page+1}" accesskey="n" title="Alt-n">{t}next{/t}</a>
   {else}
-    {$resources->GetResource('next')}
+    {t}next{/t}
   {/if}
   <br />
 </div>
@@ -58,14 +58,14 @@
       {/if}
       </td>
       {assign var=resulttree value=$result->GetTree()}
-      <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$result->GetHash()}">{$resources->GetResource('commit')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$result->GetHash()}">{$resources->GetResource('commitdiff')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$resulttree->GetHash()}&hb={$result->GetHash()}">{$resources->GetResource('tree')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$result->GetHash()}">{$resources->GetResource('snapshot')}</a>
+      <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$result->GetHash()}">{t}commit{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$result->GetHash()}">{t}commitdiff{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$resulttree->GetHash()}&hb={$result->GetHash()}">{t}tree{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$result->GetHash()}">{t}snapshot{/t}</a>
       </td>
     </tr>
   {/foreach}
 
   {if $hasmore}
     <tr>
-      <td><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}&pg={$page+1}" title="Alt-n">{$resources->GetResource('next')}</a></td>
+      <td><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}&pg={$page+1}" title="Alt-n">{t}next{/t}</a></td>
     </tr>
   {/if}
 </table>

--- a/templates/searchfiles.tpl
+++ b/templates/searchfiles.tpl
@@ -13,21 +13,21 @@
   {include file='nav.tpl' logcommit=$commit treecommit=$commit}
   <br />
   {if $page > 0}
-    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}">{$resources->GetResource('first')}</a>
+    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}">{t}first{/t}</a>
   {else}
-    {$resources->GetResource('first')}
+    {t}first{/t}
   {/if}
     &sdot; 
   {if $page > 0}
-    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}{if $page > 1}&pg={$page-1}{/if}" accesskey="p" title="Alt-p">{$resources->GetResource('prev')}</a>
+    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}{if $page > 1}&pg={$page-1}{/if}" accesskey="p" title="Alt-p">{t}prev{/t}</a>
   {else}
-    {$resources->GetResource('prev')}
+    {t}prev{/t}
   {/if}
     &sdot; 
   {if $hasmore}
-    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}&pg={$page+1}" accesskey="n" title="Alt-n">{$resources->GetResource('next')}</a>
+    <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}&pg={$page+1}" accesskey="n" title="Alt-n">{t}next{/t}</a>
   {else}
-    {$resources->GetResource('next')}
+    {t}next{/t}
   {/if}
   <br />
 </div>
@@ -44,7 +44,7 @@
 		  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$resultobject->GetHash()}&hb={$commit->GetHash()}&f={$path}" class="list"><strong>{$path}</strong></a>
 	      </td>
 	      <td class="link">
-		  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$resultobject->GetHash()}&hb={$commit->GetHash()}&f={$path}">{$resources->GetResource('tree')}</a>
+		  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$resultobject->GetHash()}&hb={$commit->GetHash()}&f={$path}">{t}tree{/t}</a>
 	      </td>
       {else}
 	      <td>
@@ -54,7 +54,7 @@
 		  {/foreach}
 	      </td>
 	      <td class="link">
-		  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$resultobject->GetHash()}&hb={$commit->GetHash()}&f={$path}">{$resources->GetResource('blob')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=history&h={$commit->GetHash()}&f={$path}">{$resources->GetResource('history')}</a>
+		  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$resultobject->GetHash()}&hb={$commit->GetHash()}&f={$path}">{t}blob{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=history&h={$commit->GetHash()}&f={$path}">{t}history{/t}</a>
 	      </td>
       {/if}
     </tr>
@@ -62,7 +62,7 @@
 
   {if $hasmore}
     <tr>
-      <td><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}&pg={$page+1}" title="Alt-n">{$resources->GetResource('next')}</a></td>
+      <td><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=search&h={$commit->GetHash()}&s={$search}&st={$searchtype}&pg={$page+1}" title="Alt-n">{t}next{/t}</a></td>
     </tr>
   {/if}
 </table>

--- a/templates/shortlog.tpl
+++ b/templates/shortlog.tpl
@@ -13,21 +13,21 @@
    {include file='nav.tpl' current='shortlog' logcommit=$commit treecommit=$commit}
    <br />
    {if ($commit && $head) && (($commit->GetHash() != $head->GetHash()) || ($page > 0))}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog">{$resources->GetResource('HEAD')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog">{t}HEAD{/t}</a>
    {else}
-     {$resources->GetResource('HEAD')}
+     {t}HEAD{/t}
    {/if}
      &sdot; 
    {if $page > 0}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h={$commit->GetHash()}&pg={$page-1}" accesskey="p" title="Alt-p">{$resources->GetResource('prev')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h={$commit->GetHash()}&pg={$page-1}" accesskey="p" title="Alt-p">{t}prev{/t}</a>
    {else}
-     {$resources->GetResource('prev')}
+     {t}prev{/t}
    {/if}
      &sdot; 
    {if $hasmorerevs}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h={$commit->GetHash()}&pg={$page+1}" accesskey="n" title="Alt-n">{$resources->GetResource('next')}</a>
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h={$commit->GetHash()}&pg={$page+1}" accesskey="n" title="Alt-n">{t}next{/t}</a>
    {else}
-     {$resources->GetResource('next')}
+     {t}next{/t}
    {/if}
    <br />
  </div>

--- a/templates/shortloglist.tpl
+++ b/templates/shortloglist.tpl
@@ -18,11 +18,11 @@
          <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$rev->GetHash()}" class="list commitTip" {if strlen($rev->GetTitle()) > 50}title="{$rev->GetTitle()}"{/if}><strong>{$rev->GetTitle(50)}</strong></a>
 	 {include file='refbadges.tpl' commit=$rev}
        </td>
-       <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$rev->GetHash()}">{$resources->GetResource('commit')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$rev->GetHash()}">{$resources->GetResource('commitdiff')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$rev->GetHash()}&hb={$rev->GetHash()}">{$resources->GetResource('tree')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$rev->GetHash()}">{$resources->GetResource('snapshot')}</a>
+       <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$rev->GetHash()}">{t}commit{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$rev->GetHash()}">{t}commitdiff{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$rev->GetHash()}&hb={$rev->GetHash()}">{t}tree{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$rev->GetHash()}">{t}snapshot{/t}</a>
        </td>
      </tr>
    {foreachelse}
-     <tr><td><em>No commits</em></td></tr>
+     <tr><td><em>{t}No commits{/t}</em></td></tr>
    {/foreach}
 
    {if $hasmorerevs}
@@ -30,7 +30,7 @@
      {if $source == 'summary'}
        <td><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog">...</a></td>
      {else}
-       <td><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h={$commit->GetHash()}&pg={$page+1}" title="Alt-n">{$resources->GetResource('next')}</a></td>
+       <td><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h={$commit->GetHash()}&pg={$page+1}" title="Alt-n">{t}next{/t}</a></td>
      {/if}
      </tr>
    {/if}

--- a/templates/tag.tpl
+++ b/templates/tag.tpl
@@ -22,18 +22,18 @@
  <div class="title_text">
    <table cellspacing="0">
      <tr>
-       <td>object</td>
+       <td>{t}object{/t}</td>
        {if $objtype == 'commit'}
          <td class="monospace"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$object->GetHash()}" class="list">{$object->GetHash()}</a></td>
-         <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$object->GetHash()}">{$resources->GetResource('commit')}</a></td>
+         <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$object->GetHash()}">{t}commit{/t}</a></td>
        {elseif $objtype == 'tag'}
          <td class="monospace"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tag&h={$object->GetName()}" class="list">{$object->GetHash()}</a></td>
-         <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tag&h={$object->GetName()}">{$resources->GetResource('tag')}</a></td>
+         <td class="link"><a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tag&h={$object->GetName()}">{t}tag{/t}</a></td>
        {/if}
      </tr>
      {if $tag->GetTagger()}
        <tr>
-         <td>author</td>
+         <td>{t}author{/t}</td>
 	 <td>{$tag->GetTagger()}</td>
        </tr>
        <tr>

--- a/templates/taglist.tpl
+++ b/templates/taglist.tpl
@@ -34,10 +34,10 @@
            </td>
            <td class="link">
              {if !$tag->LightTag()}
-   	       <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tag&h={$tag->GetName()}">{$resources->GetResource('tag')}</a> | 
+   	       <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tag&h={$tag->GetName()}">{t}tag{/t}</a> | 
              {/if}
-             <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$tagcommit->GetHash()}">{$resources->GetResource('commit')}</a>
-	      | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h={$tagcommit->GetHash()}">{$resources->GetResource('shortlog')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log&h={$tagcommit->GetHash()}">{$resources->GetResource('log')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$tagcommit->GetHash()}">{$resources->GetResource('snapshot')}</a>
+             <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$tagcommit->GetHash()}">{t}commit{/t}</a>
+	      | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog&h={$tagcommit->GetHash()}">{t}shortlog{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=log&h={$tagcommit->GetHash()}">{t}log{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$tagcommit->GetHash()}">{t}snapshot{/t}</a>
            </td>
          {/if}
        </tr>

--- a/templates/tagtip.tpl
+++ b/templates/tagtip.tpl
@@ -10,7 +10,7 @@
  *}
 
 <div>
-{$resources->GetResource('tag')}: {$tag->GetName()}
+{t}tag{/t}: {$tag->GetName()}
 <br />
 {foreach from=$tag->GetComment() item=line}
 <br />{$line}

--- a/templates/title.tpl
+++ b/templates/title.tpl
@@ -24,21 +24,21 @@
 			<a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=summary" class="title">&nbsp;</a>
 		{elseif $target == 'shortlog'}
 			{if $disablelink}
-			  {$resources->GetResource('shortlog')}
+			  {t}shortlog{/t}
 			{else}
-			  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog" class="title">{$resources->GetResource('shortlog')}</a>
+			  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=shortlog" class="title">{t}shortlog{/t}</a>
 			{/if}
 		{elseif $target == 'tags'}
 			{if $disablelink}
-			  {$resources->GetResource('tags')}
+			  {t}tags{/t}
 			{else}
-			  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tags" class="title">{$resources->GetResource('tags')}</a>
+			  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tags" class="title">{t}tags{/t}</a>
 			{/if}
 		{elseif $target == 'heads'}
 			{if $disablelink}
-			  {$resources->GetResource('heads')}
+			  {t}heads{/t}
 			{else}
-			  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=heads" class="title">{$resources->GetResource('heads')}</a>
+			  <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=heads" class="title">{t}heads{/t}</a>
 			{/if}
 		{else}
 			&nbsp;

--- a/templates/tree.tpl
+++ b/templates/tree.tpl
@@ -30,7 +30,7 @@
              <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$treeitem->GetHash()}&hb={$commit->GetHash()}&f={$treeitem->GetPath()}" class="list">{$treeitem->GetName()}</a>
 	   </td>
            <td class="link">
-	     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$treeitem->GetHash()}&hb={$commit->GetHash()}&f={$treeitem->GetPath()}">{$resources->GetResource('blob')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=history&h={$commit->GetHash()}&f={$treeitem->GetPath()}">{$resources->GetResource('history')}</a>
+	     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=blob&h={$treeitem->GetHash()}&hb={$commit->GetHash()}&f={$treeitem->GetPath()}">{t}blob{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=history&h={$commit->GetHash()}&f={$treeitem->GetPath()}">{t}history{/t}</a>
 	   </td>
          {elseif $treeitem instanceof GitPHP_Tree}
 	   <td></td>
@@ -38,7 +38,7 @@
              <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$treeitem->GetHash()}&hb={$commit->GetHash()}&f={$treeitem->GetPath()}">{$treeitem->GetName()}</a>
 	   </td>
            <td class="link">
-	     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$treeitem->GetHash()}&hb={$commit->GetHash()}&f={$treeitem->GetPath()}">{$resources->GetResource('tree')}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$commit->GetHash()}&f={$treeitem->GetPath()}">{$resources->GetResource('snapshot')}</a>
+	     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=tree&h={$treeitem->GetHash()}&hb={$commit->GetHash()}&f={$treeitem->GetPath()}">{t}tree{/t}</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=snapshot&h={$commit->GetHash()}&f={$treeitem->GetPath()}">{t}snapshot{/t}</a>
 	   </td>
          {/if}
        </tr>

comments