Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made the default template translatable, fixes #986

  • Loading branch information...
commit 9789d097248f76f875d4457998b21679a88b12e2 1 parent 25101ee
isaiah authored
View
3  application/controllers/welcome.php
@@ -49,7 +49,8 @@ public function __call($method, $arguments)
// By defining a __call method, all pages routed to this controller
// that result in 404 errors will be handled by this method, instead of
// 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
View
8 application/views/welcome_content.php
@@ -1,15 +1,15 @@
<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
<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>
- 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 what gets displayed for this page, edit')?> <code>application/controllers/welcome.php</code>.<br />
+ <?php echo __('To change this text, edit')?> <code>application/views/welcome_content.php</code>.
</p>
</div>
<ul>
<?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 ?>
</ul>
View
6 system/views/kohana/template.php
@@ -5,7 +5,7 @@
<head>
<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">
html { background: #83c018 url(<?php echo url::base(FALSE) ?>kohana.png) 50% 0 no-repeat; }
@@ -24,11 +24,11 @@
</head>
<body>
- <h1><?php echo html::chars($title) ?></h1>
+ <h1><?php echo html::chars(__($title)) ?></h1>
<?php echo $content ?>
<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
</p>
Please sign in to comment.
Something went wrong with that request. Please try again.