Skip to content

Commit

Permalink
Made the default template translatable, fixes #986
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiah committed Oct 8, 2009
1 parent 25101ee commit 9789d09
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion application/controllers/welcome.php
Expand Up @@ -49,7 +49,8 @@ public function __call($method, $arguments)
// By defining a __call method, all pages routed to this controller // By defining a __call method, all pages routed to this controller
// that result in 404 errors will be handled by this method, instead of // that result in 404 errors will be handled by this method, instead of
// being displayed as "Page Not Found" errors. // being displayed as "Page Not Found" errors.
echo 'This text is generated by __call. If you expected the index page, you need to use: welcome/index/'.substr(Router::$current_uri, 8); echo __('This text is generated by __call. If you expected the index page, you need to use: :uri:',
array(':uri:' => 'welcome/index/'.substr(Router::$current_uri, 8)));
} }


} // End Welcome Controller } // End Welcome Controller
8 changes: 4 additions & 4 deletions application/views/welcome_content.php
@@ -1,15 +1,15 @@
<?php defined('SYSPATH') OR die('No direct access allowed.'); ?> <?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
<div class="box"> <div class="box">
<p>This is the default Kohana index page. You may also access this page as <code><?php echo html::anchor('welcome/index', 'welcome/index') ?></code>.</p> <p><?php echo __('This is the default Kohana index page. You may also access this page as')?> <code><?php echo html::anchor('welcome/index', 'welcome/index') ?></code>.</p>


<p> <p>
To change what gets displayed for this page, edit <code>application/controllers/welcome.php</code>.<br /> <?php echo __('To change what gets displayed for this page, edit')?> <code>application/controllers/welcome.php</code>.<br />
To change this text, edit <code>application/views/welcome_content.php</code>. <?php echo __('To change this text, edit')?> <code>application/views/welcome_content.php</code>.
</p> </p>
</div> </div>


<ul> <ul>
<?php foreach ($links as $title => $url): ?> <?php foreach ($links as $title => $url): ?>
<li><?php echo ($title === 'License') ? html::file_anchor($url, html::chars($title)) : html::anchor($url, html::chars($title)) ?></li> <li><?php echo ($title === 'License') ? html::file_anchor($url, html::chars(__($title))) : html::anchor($url, html::chars(__($title))) ?></li>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
6 changes: 3 additions & 3 deletions system/views/kohana/template.php
Expand Up @@ -5,7 +5,7 @@
<head> <head>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><?php echo html::chars($title) ?></title> <title><?php echo html::chars(__($title)) ?></title>


<style type="text/css"> <style type="text/css">
html { background: #83c018 url(<?php echo url::base(FALSE) ?>kohana.png) 50% 0 no-repeat; } html { background: #83c018 url(<?php echo url::base(FALSE) ?>kohana.png) 50% 0 no-repeat; }
Expand All @@ -24,11 +24,11 @@
</head> </head>
<body> <body>


<h1><?php echo html::chars($title) ?></h1> <h1><?php echo html::chars(__($title)) ?></h1>
<?php echo $content ?> <?php echo $content ?>


<p class="copyright"> <p class="copyright">
Rendered in {execution_time} seconds, using {memory_usage} of memory<br /> <?php echo __('Rendered in {execution_time} seconds, using {memory_usage} of memory')?><br />
Copyright ©2007–2008 Kohana Team Copyright ©2007–2008 Kohana Team
</p> </p>


Expand Down

0 comments on commit 9789d09

Please sign in to comment.