summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-01-08 17:13:06 +0000
committerAndy Staudacher <andy.st@gmail.com>2009-01-08 17:13:06 +0000
commita631fe29f3950f8db1f7fb4ce1f47261a9b0feff (patch)
treeb5af3ad39362dea97ce01be63d5ec09b7846bb9c /themes
parentfd081159f1783918d81e355e25e262ccc5249913 (diff)
i18n refactoring: Rename all _() (reserved by gettext) calls to t().
- And refactor printf to our string interpolation / pluralization syntax - Also, a slight change to the translations_incomings table, using binary(16) instead of char(32) as message key.
Diffstat (limited to 'themes')
-rw-r--r--themes/admin_default/views/admin.html.php2
-rw-r--r--themes/admin_default/views/pager.html.php23
-rw-r--r--themes/default/views/header.html.php2
-rw-r--r--themes/default/views/page.html.php4
-rw-r--r--themes/default/views/pager.html.php23
-rw-r--r--themes/default/views/photo.html.php12
6 files changed, 38 insertions, 28 deletions
diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php
index a8650068..9385a346 100644
--- a/themes/admin_default/views/admin.html.php
+++ b/themes/admin_default/views/admin.html.php
@@ -30,7 +30,7 @@
<div id="gHeader">
<?= $theme->site_status() ?>
<?= $theme->admin_header_top() ?>
- <a href="http://gallery.menalto.com/"><img src="<?= $theme->url("images/logo-sm.png") ?>" id="gLogo" alt="<?= _("Gallery 3: Your Photos on Your Web Site") ?>" /></a>
+ <a href="http://gallery.menalto.com/"><img src="<?= $theme->url("images/logo-sm.png") ?>" id="gLogo" alt="<?= t("Gallery 3: Your Photos on Your Web Site") ?>" /></a>
<div id="gSiteAdminMenu">
<?= $theme->admin_menu() ?>
</div>
diff --git a/themes/admin_default/views/pager.html.php b/themes/admin_default/views/pager.html.php
index a07800c2..5c7c5396 100644
--- a/themes/admin_default/views/pager.html.php
+++ b/themes/admin_default/views/pager.html.php
@@ -1,25 +1,30 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? // See http://docs.kohanaphp.com/libraries/pagination ?>
<ul id="gPager">
- <li><?= sprintf(_("%d - %d of %d"), $current_first_item, $current_last_item, $total_items) ?></li>
+ <? /* XXX: This message isn't easily localizable */
+ $from_to_msg = t("{{from_number}} - {{to_number}} of {{total}}",
+ array("from_number" => $current_first_item,
+ "to_number" => $current_last_item,
+ "total" => $total_items)) ?>
+ <li><?= $from_to_msg?></li>
<? if ($first_page): ?>
- <li class="first"><a href="<?= str_replace('{page}', 1, $url) ?>"><?= _("first") ?></a></li>
+ <li class="first"><a href="<?= str_replace('{page}', 1, $url) ?>"><?= t("first") ?></a></li>
<? else: ?>
- <li class="first_inactive"><?= _("first") ?></li>
+ <li class="first_inactive"><?= t("first") ?></li>
<? endif ?>
<? if ($previous_page): ?>
- <li class="previous"><a href="<?= str_replace('{page}', $previous_page, $url) ?>"><?= _("previous") ?></a></li>
+ <li class="previous"><a href="<?= str_replace('{page}', $previous_page, $url) ?>"><?= t("previous") ?></a></li>
<? else: ?>
- <li class="previous_inactive"><?= _("previous") ?></li>
+ <li class="previous_inactive"><?= t("previous") ?></li>
<? endif ?>
<? if ($next_page): ?>
- <li class="next"><a href="<?= str_replace('{page}', $next_page, $url) ?>"><?= _("next") ?></a></li>
+ <li class="next"><a href="<?= str_replace('{page}', $next_page, $url) ?>"><?= t("next") ?></a></li>
<? else: ?>
- <li class="next_inactive"><?= _("next") ?></li>
+ <li class="next_inactive"><?= t("next") ?></li>
<? endif ?>
<? if ($last_page): ?>
- <li class="last"><a href="<?= str_replace('{page}', $last_page, $url) ?>"><?= _("last") ?></a></li>
+ <li class="last"><a href="<?= str_replace('{page}', $last_page, $url) ?>"><?= t("last") ?></a></li>
<? else: ?>
- <li class="last_inactive"><?= _("last") ?></li>
+ <li class="last_inactive"><?= t("last") ?></li>
<? endif ?>
</ul>
diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php
index 262f6540..0be8eb56 100644
--- a/themes/default/views/header.html.php
+++ b/themes/default/views/header.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?= $theme->site_status() ?>
<?= $theme->header_top() ?>
-<img id="gLogo" alt="<?= _("Logo") ?>" src="<?= $theme->url("images/logo.png") ?>" />
+<img id="gLogo" alt="<?= t("Logo") ?>" src="<?= $theme->url("images/logo.png") ?>" />
<div id="gSiteMenu">
<?= $theme->site_menu() ?>
diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php
index fca5daae..b779b110 100644
--- a/themes/default/views/page.html.php
+++ b/themes/default/views/page.html.php
@@ -6,9 +6,9 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>
<? if ($page_type == "tag"): ?>
- <?= _("Browse Tags") ?> :: <?= $tag->name ?>
+ <?= t("Browse Tags") ?> :: <?= $tag->name ?>
<? else: ?>
- <?= _("Browse Photos") ?> :: <?= $item->title ?>
+ <?= t("Browse Photos") ?> :: <?= $item->title ?>
<? endif ?>
</title>
<link rel="shortcut icon" href="<?= $theme->url("images/favicon.ico") ?>" type="image/x-icon" />
diff --git a/themes/default/views/pager.html.php b/themes/default/views/pager.html.php
index 1bc746eb..00185711 100644
--- a/themes/default/views/pager.html.php
+++ b/themes/default/views/pager.html.php
@@ -1,25 +1,30 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? // See http://docs.kohanaphp.com/libraries/pagination ?>
<ul id="gPager">
- <li><?= sprintf(_("Photos %d - %d of %d"), $current_first_item, $current_last_item, $total_items) ?></li>
+ <? /* XXX: This message isn't easily localizable */
+ $from_to_msg = t("Photos {{from_number}} - {{to_number}} of {{total}}",
+ array("from_number" => $current_first_item,
+ "to_number" => $current_last_item,
+ "total" => $total_items)) ?>
+ <li><?= $from_to_msg ?></li>
<? if ($first_page): ?>
- <li class="first"><a href="<?= str_replace('{page}', 1, $url) ?>"><?= _("first") ?></a></li>
+ <li class="first"><a href="<?= str_replace('{page}', 1, $url) ?>"><?= t("first") ?></a></li>
<? else: ?>
- <li class="first_inactive"><?= _("first") ?></li>
+ <li class="first_inactive"><?= t("first") ?></li>
<? endif ?>
<? if ($previous_page): ?>
- <li class="previous"><a href="<?= str_replace('{page}', $previous_page, $url) ?>"><?= _("previous") ?></a></li>
+ <li class="previous"><a href="<?= str_replace('{page}', $previous_page, $url) ?>"><?= t("previous") ?></a></li>
<? else: ?>
- <li class="previous_inactive"><?= _("previous") ?></li>
+ <li class="previous_inactive"><?= t("previous") ?></li>
<? endif ?>
<? if ($next_page): ?>
- <li class="next"><a href="<?= str_replace('{page}', $next_page, $url) ?>"><?= _("next") ?></a></li>
+ <li class="next"><a href="<?= str_replace('{page}', $next_page, $url) ?>"><?= t("next") ?></a></li>
<? else: ?>
- <li class="next_inactive"><?= _("next") ?></li>
+ <li class="next_inactive"><?= t("next") ?></li>
<? endif ?>
<? if ($last_page): ?>
- <li class="last"><a href="<?= str_replace('{page}', $last_page, $url) ?>"><?= _("last") ?></a></li>
+ <li class="last"><a href="<?= str_replace('{page}', $last_page, $url) ?>"><?= t("last") ?></a></li>
<? else: ?>
- <li class="last_inactive"><?= _("last") ?></li>
+ <li class="last_inactive"><?= t("last") ?></li>
<? endif ?>
</ul>
diff --git a/themes/default/views/photo.html.php b/themes/default/views/photo.html.php
index 887b451c..d374d4f8 100644
--- a/themes/default/views/photo.html.php
+++ b/themes/default/views/photo.html.php
@@ -1,20 +1,20 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="gItem">
<?= $theme->photo_top() ?>
-
+
<ul id="gPager">
- <li><?= sprintf(_("%d of %d"), $position, $sibling_count) ?></li>
+ <li><?= t("{{position}} of {{total}}", array("position" => $position, "total" => $sibling_count)) ?></li>
<? if ($previous_item): ?>
- <li class="previous"><a href="<?= $previous_item->url() ?>"><?= _("previous") ?></a></li>
+ <li class="previous"><a href="<?= $previous_item->url() ?>"><?= t("previous") ?></a></li>
<? endif ?>
<? if ($next_item): ?>
- <li class="next"><a href="<?= $next_item->url() ?>"><?= _("next") ?></a></li>
+ <li class="next"><a href="<?= $next_item->url() ?>"><?= t("next") ?></a></li>
<? endif ?>
</ul>
- <img id="gPhotoId-<?= $item->id ?>"
+ <img id="gPhotoId-<?= $item->id ?>"
src="<?= $item->resize_url() ?>"
- alt="<?= $item->title ?>"
+ alt="<?= $item->title ?>"
width="<?= $item->resize_width ?>"
height="<?= $item->resize_height ?>" />