summaryrefslogtreecommitdiff
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
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.
-rw-r--r--core/controllers/admin_graphics.php4
-rw-r--r--core/controllers/admin_maintenance.php47
-rw-r--r--core/controllers/admin_modules.php4
-rw-r--r--core/controllers/admin_themes.php6
-rw-r--r--core/controllers/albums.php6
-rw-r--r--core/controllers/photos.php2
-rw-r--r--core/helpers/album.php20
-rw-r--r--core/helpers/core_block.php12
-rw-r--r--core/helpers/core_installer.php6
-rw-r--r--core/helpers/core_menu.php46
-rw-r--r--core/helpers/graphics.php17
-rw-r--r--core/helpers/module.php4
-rw-r--r--core/helpers/photo.php22
-rw-r--r--core/hooks/register_i18n.php21
-rw-r--r--core/libraries/I18n.php2
-rw-r--r--core/tests/I18n_Test.php2
-rw-r--r--core/views/admin_block_platform.html.php8
-rw-r--r--core/views/admin_block_stats.html.php6
-rw-r--r--core/views/admin_block_welcome.html.php11
-rw-r--r--core/views/admin_graphics.html.php38
-rw-r--r--core/views/admin_maintenance.html.php62
-rw-r--r--core/views/admin_maintenance_task.html.php4
-rw-r--r--core/views/admin_modules.html.php18
-rw-r--r--core/views/admin_themes.html.php6
-rw-r--r--core/views/permissions_form.html.php6
-rw-r--r--core/views/quick_pane.html.php6
-rw-r--r--modules/akismet/controllers/admin_akismet.php8
-rw-r--r--modules/akismet/helpers/akismet.php8
-rw-r--r--modules/akismet/helpers/akismet_menu.php4
-rw-r--r--modules/akismet/views/admin_akismet.html.php6
-rw-r--r--modules/atom/libraries/Gallery_Atom_Link.php4
-rw-r--r--modules/comment/controllers/admin_comments.php27
-rw-r--r--modules/comment/helpers/comment.php24
-rw-r--r--modules/comment/helpers/comment_block.php4
-rw-r--r--modules/comment/helpers/comment_menu.php4
-rw-r--r--modules/comment/views/admin_block_recent_comments.html.php5
-rw-r--r--modules/comment/views/admin_comments.html.php31
-rw-r--r--modules/comment/views/comment.html.php4
-rw-r--r--modules/comment/views/comments.html.php4
-rw-r--r--modules/gmaps/helpers/gmaps_block.php2
-rw-r--r--modules/info/helpers/info_block.php6
-rw-r--r--modules/info/views/info_block.html.php8
-rw-r--r--modules/media_rss/controllers/media_rss.php2
-rw-r--r--modules/search/views/search_link.html.php4
-rw-r--r--modules/slideshow/helpers/slideshow_menu.php4
-rw-r--r--modules/tag/controllers/admin_tags.php10
-rw-r--r--modules/tag/helpers/tag.php18
-rw-r--r--modules/tag/helpers/tag_block.php2
-rw-r--r--modules/tag/helpers/tag_menu.php2
-rw-r--r--modules/tag/views/admin_tags.html.php20
-rw-r--r--modules/user/controllers/admin_groups.php15
-rw-r--r--modules/user/controllers/admin_users.php15
-rw-r--r--modules/user/controllers/login.php14
-rw-r--r--modules/user/controllers/logout.php2
-rw-r--r--modules/user/helpers/group.php20
-rw-r--r--modules/user/helpers/user.php44
-rw-r--r--modules/user/helpers/user_menu.php6
-rw-r--r--modules/user/views/admin_groups.html.php12
-rw-r--r--modules/user/views/admin_users.html.php12
-rw-r--r--modules/user/views/login.html.php10
-rw-r--r--modules/watermark/controllers/admin_watermarks.php14
-rw-r--r--modules/watermark/helpers/watermark.php40
-rw-r--r--modules/watermark/helpers/watermark_menu.php2
-rw-r--r--modules/watermark/views/admin_watermarks.html.php24
-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
70 files changed, 479 insertions, 414 deletions
diff --git a/core/controllers/admin_graphics.php b/core/controllers/admin_graphics.php
index e6e42672..babad3d4 100644
--- a/core/controllers/admin_graphics.php
+++ b/core/controllers/admin_graphics.php
@@ -38,8 +38,8 @@ class Admin_Graphics_Controller extends Admin_Controller {
}
site_status::clear("missing_graphics_toolkit");
- message::success(_("Updated Graphics Toolkit"));
- log::success("graphics", sprintf(_("Changed graphics toolkit to %s"), $toolkit));
+ message::success(t("Updated Graphics Toolkit"));
+ log::success("graphics", t("Changed graphics toolkit to: {{toolkit}}", array("toolkit" => $toolkit)));
}
url::redirect("admin/graphics");
diff --git a/core/controllers/admin_maintenance.php b/core/controllers/admin_maintenance.php
index ea844a1f..3eec16fc 100644
--- a/core/controllers/admin_maintenance.php
+++ b/core/controllers/admin_maintenance.php
@@ -26,13 +26,14 @@ class Admin_Maintenance_Controller extends Admin_Controller {
$dirty_count = graphics::find_dirty_images_query()->count();
return array(
"graphics::rebuild_dirty_images" => new ArrayObject(
- array("name" => _("Rebuild Images"),
+ array("name" => t("Rebuild Images"),
"callback" => "graphics::rebuild_dirty_images",
"description" => (
$dirty_count ?
- sprintf(
- _("You have %d out-of-date images"), $dirty_count)
- : _("All your images are up to date")),
+ t(array("one" => "You have one image which is out of date",
+ "other" => "You have {{count}} out-of-date images"),
+ array("count" => $dirty_count))
+ : t("All your images are up to date")),
"severity" => $dirty_count ? log::WARNING : log::SUCCESS),
ArrayObject::ARRAY_AS_PROPS));
}
@@ -49,10 +50,12 @@ class Admin_Maintenance_Controller extends Admin_Controller {
$stalled_count = $query->count();
if ($stalled_count) {
log::warning("tasks",
- sprintf(_("%d tasks are stalled"), $stalled_count),
- sprintf(_("%sview%s"),
- "<a href=\"" . url::site("admin/maintenance") . "\">",
- "</a>"));
+ t(array("one" => "One task is stalled",
+ "other" => "{{count}} tasks are stalled"),
+ array("count" => $stalled_count)),
+ t("{{link_start}}view{{link_end}}",
+ array("link_start" => "<a href=\"" . url::site("admin/maintenance") . "\">",
+ "link_start" => "</a>")));
}
$view = new Admin_View("admin.html");
@@ -86,8 +89,9 @@ class Admin_Maintenance_Controller extends Admin_Controller {
$view->csrf = access::csrf_token();
$view->task = $task;
- log::info("tasks", sprintf(_("Task %s started (task id %d)"), $task->name, $task->id),
- html::anchor(url::site("admin/maintenance"), _("maintenance")));
+ log::info("tasks", t("Task {{task_name}} started (task id {{task_id}})",
+ array("task_name" => $task->name, "task_id" => $task->id)),
+ html::anchor(url::site("admin/maintenance"), t("maintenance")));
print $view;
}
@@ -106,8 +110,9 @@ class Admin_Maintenance_Controller extends Admin_Controller {
$view->csrf = access::csrf_token();
$view->task = $task;
- log::info("tasks", sprintf(_("Task %s resumed (task id %d)"), $task->name, $task->id),
- html::anchor(url::site("admin/maintenance"), _("maintenance")));
+ log::info("tasks", t("Task {{task_name}} resumed (task id {{task_id}})",
+ array("task_name" => $task->name, "task_id" => $task->id)),
+ html::anchor(url::site("admin/maintenance"), t("maintenance")));
print $view;
}
@@ -126,7 +131,7 @@ class Admin_Maintenance_Controller extends Admin_Controller {
$task->state = "cancelled";
$task->save();
- message::success(_("Task cancelled"));
+ message::success(t("Task cancelled"));
url::redirect("admin/maintenance");
}
@@ -142,7 +147,7 @@ class Admin_Maintenance_Controller extends Admin_Controller {
throw new Exception("@todo MISSING_TASK");
}
$task->delete();
- message::success(_("Task removed"));
+ message::success(t("Task removed"));
url::redirect("admin/maintenance");
}
@@ -166,15 +171,17 @@ class Admin_Maintenance_Controller extends Admin_Controller {
if ($task->done) {
switch ($task->state) {
case "success":
- log::success("tasks", sprintf(_("Task %s completed (task id %d)"), $task->name, $task->id),
- html::anchor(url::site("admin/maintenance"), _("maintenance")));
- message::success(_("Task completed successfully"));
+ log::success("tasks", t("Task {{task_name}} completed (task id {{task_id}})",
+ array("task_name" => $task->name, "task_id" => $task->id)),
+ html::anchor(url::site("admin/maintenance"), t("maintenance")));
+ message::success(t("Task completed successfully"));
break;
case "error":
- log::error("tasks", sprintf(_("Task %s failed (task id %d)"), $task->name, $task->id),
- html::anchor(url::site("admin/maintenance"), _("maintenance")));
- message::success(_("Task failed"));
+ log::error("tasks", t("Task {{task_name}} failed (task id {{task_id}})",
+ array("task_name" => $task->name, "task_id" => $task->id)),
+ html::anchor(url::site("admin/maintenance"), t("maintenance")));
+ message::success(t("Task failed"));
break;
}
print json_encode(
diff --git a/core/controllers/admin_modules.php b/core/controllers/admin_modules.php
index c416a699..e345f8c6 100644
--- a/core/controllers/admin_modules.php
+++ b/core/controllers/admin_modules.php
@@ -34,10 +34,10 @@ class Admin_Modules_Controller extends Admin_Controller {
$desired = $this->input->post($module_name) == 1;
if ($info->installed && !$desired) {
module::uninstall($module_name);
- message::success(sprintf(_("Uninstalled %s module"), $info->name));
+ message::success(t("Uninstalled {{module_name}} module", array("module_name" => $info->name)));
} else if (!$info->installed && $desired) {
module::install($module_name);
- message::success(sprintf(_("Installed %s module"), $info->name));
+ message::success(t("Installed {{module_name}} module", array("module_name" => $info->name)));
}
}
url::redirect("admin/modules");
diff --git a/core/controllers/admin_themes.php b/core/controllers/admin_themes.php
index 5c9a2ad1..6641221f 100644
--- a/core/controllers/admin_themes.php
+++ b/core/controllers/admin_themes.php
@@ -26,14 +26,14 @@ class Admin_Themes_Controller extends Admin_Controller {
$view->content->active = module::get_var("core", "active_theme");
print $view;
}
-
+
public function save() {
access::verify_csrf();
$theme = $this->input->post("theme");
if ($theme != module::get_var("core", "active_theme")) {
module::set_var("core", "active_theme", $theme);
- message::success(_("Updated Theme"));
- log::success("graphics", sprintf(_("Changed theme to %s"), $theme));
+ message::success(t("Updated Theme"));
+ log::success("graphics", t("Changed theme to {{theme_name}}", array("theme_name" => $theme)));
}
url::redirect("admin/themes");
}
diff --git a/core/controllers/albums.php b/core/controllers/albums.php
index 20291315..d87bd640 100644
--- a/core/controllers/albums.php
+++ b/core/controllers/albums.php
@@ -93,7 +93,7 @@ class Albums_Controller extends Items_Controller {
log::success("content", "Created an album",
html::anchor("albums/$new_album->id", "view album"));
- message::success(sprintf(_("Created album %s"), $new_album->title));
+ message::success(t("Created album {{album_title}}", array("album_title" => $new_album->title)));
print json_encode(
array("result" => "success",
@@ -123,7 +123,7 @@ class Albums_Controller extends Items_Controller {
user::active()->id);
log::success("content", "Added a photo", html::anchor("photos/$photo->id", "view photo"));
- message::success(sprintf(_("Added photo %s"), $photo->title));
+ message::success(t("Added photo {{photo_title}}", array("photo_title" => $photo->title)));
print json_encode(
array("result" => "success",
@@ -155,7 +155,7 @@ class Albums_Controller extends Items_Controller {
module::event("album_changed", $orig, $album);
log::success("content", "Updated album", "<a href=\"albums/$album->id\">view</a>");
- message::success(sprintf(_("Saved album %s"), $album->title));
+ message::success(t("Saved album {{album_title}}", array("album_title" => $album->title)));
print json_encode(
array("result" => "success",
diff --git a/core/controllers/photos.php b/core/controllers/photos.php
index 6b5e84ba..b177b205 100644
--- a/core/controllers/photos.php
+++ b/core/controllers/photos.php
@@ -81,7 +81,7 @@ class Photos_Controller extends Items_Controller {
module::event("photo_changed", $orig, $photo);
log::success("content", "Updated photo", "<a href=\"photos/$photo->id\">view</a>");
- message::success(sprintf(_("Saved photo %s"), $photo->title));
+ message::success(t("Saved photo {{photo_title}}", array("photo_title" => $photo->title)));
print json_encode(
array("result" => "success",
diff --git a/core/helpers/album.php b/core/helpers/album.php
index 82697254..8998c8d0 100644
--- a/core/helpers/album.php
+++ b/core/helpers/album.php
@@ -65,12 +65,12 @@ class album_Core {
static function get_add_form($parent) {
$form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gAddAlbumForm"));
- $group = $form->group("add_album")->label(sprintf(_("Add Album to %s"), $parent->title));
- $group->input("name")->label(_("Name"));
- $group->input("title")->label(_("Title"));
- $group->textarea("description")->label(_("Description"));
+ $group = $form->group("add_album")->label(t("Add Album to {{album_title}}", array("album_title" => $parent->title)));
+ $group->input("name")->label(t("Name"));
+ $group->input("title")->label(t("Title"));
+ $group->textarea("description")->label(t("Description"));
$group->hidden("type")->value("album");
- $group->submit(_("Create"));
+ $group->submit(t("Create"));
$form->add_rules_from(ORM::factory("item"));
return $form;
}
@@ -78,14 +78,14 @@ class album_Core {
static function get_edit_form($parent) {
$form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gEditAlbumForm"));
$form->hidden("_method")->value("put");
- $group = $form->group("edit_album")->label(_("Edit Album"));
+ $group = $form->group("edit_album")->label(t("Edit Album"));
if ($parent->id != 1) {
- $group->input("name")->label(_("Name"))->value($parent->name);
+ $group->input("name")->label(t("Name"))->value($parent->name);
}
- $group->input("title")->label(_("Title"))->value($parent->title);
- $group->textarea("description")->label(_("Description"))->value($parent->description);
+ $group->input("title")->label(t("Title"))->value($parent->title);
+ $group->textarea("description")->label(t("Description"))->value($parent->description);
$group->hidden("type")->value("album");
- $group->submit(_("Modify"));
+ $group->submit(t("Modify"));
$form->add_rules_from(ORM::factory("item"));
return $form;
}
diff --git a/core/helpers/core_block.php b/core/helpers/core_block.php
index f4224190..8c65b1ad 100644
--- a/core/helpers/core_block.php
+++ b/core/helpers/core_block.php
@@ -70,13 +70,13 @@ class core_block_Core {
public static function admin_dashboard_blocks($theme) {
$block = new Block();
$block->id = "gWelcome";
- $block->title = _("Welcome to Gallery3");
+ $block->title = t("Welcome to Gallery3");
$block->content = new View("admin_block_welcome.html");
$blocks[] = $block;
$block = new Block();
$block->id = "gPhotoStream";
- $block->title = _("Photo Stream");
+ $block->title = t("Photo Stream");
$block->content = new View("admin_block_photo_stream.html");
$block->content->photos =
ORM::factory("item")->where("type", "photo")->orderby("created", "desc")->find_all(10);
@@ -84,7 +84,7 @@ class core_block_Core {
$block = new Block();
$block->id = "gLogEntries";
- $block->title = _("Log Entries");
+ $block->title = t("Log Entries");
$block->content = new View("admin_block_log_entries.html");
$block->content->entries = ORM::factory("log")->orderby("timestamp", "DESC")->find_all(5);
$blocks[] = $block;
@@ -95,7 +95,7 @@ class core_block_Core {
public static function admin_sidebar_blocks($theme) {
$block = new Block();
$block->id = "gStats";
- $block->title = _("Gallery Stats");
+ $block->title = t("Gallery Stats");
$block->content = new View("admin_block_stats.html");
$block->content->album_count = ORM::factory("item")->where("type", "album")->count_all();
$block->content->photo_count = ORM::factory("item")->where("type", "photo")->count_all();
@@ -103,13 +103,13 @@ class core_block_Core {
$block = new Block();
$block->id = "gPlatform";
- $block->title = _("Platform Information");
+ $block->title = t("Platform Information");
$block->content = new View("admin_block_platform.html");
$blocks[] = $block;
$block = new Block();
$block->id = "gProjectNews";
- $block->title = _("Gallery Project News");
+ $block->title = t("Gallery Project News");
$block->content = new View("admin_block_news.html");
$block->content->feed = feed::parse("http://gallery.menalto.com/node/feed", 3);
$blocks[] = $block;
diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php
index 15b97809..043af641 100644
--- a/core/helpers/core_installer.php
+++ b/core/helpers/core_installer.php
@@ -122,7 +122,7 @@ class core_installer {
$db->query("CREATE TABLE `translations_incomings` (
`id` int(9) NOT NULL auto_increment,
- `key` char(32) NOT NULL,
+ `key` binary(16) NOT NULL,
`locale` char(10) NOT NULL,
`message` text NOT NULL,
`translation` text,
@@ -211,8 +211,8 @@ class core_installer {
}
if (!module::get_var("core", "graphics_toolkit")) {
site_status::warning(
- sprintf(_("Graphics toolkit missing! Please %schoose a toolkit%s."),
- "<a href=\"" . url::site("admin/graphics") . "\">", "</a>"),
+ t("Graphics toolkit missing! Please {{link_start}}choose a toolkit{{link_start}}.",
+ array("link_start" => "<a href=\"" . url::site("admin/graphics") . "\">", "link_end" => "</a>")),
"missing_graphics_toolkit");
}
diff --git a/core/helpers/core_menu.php b/core/helpers/core_menu.php
index ef866c1a..9a35e244 100644
--- a/core/helpers/core_menu.php
+++ b/core/helpers/core_menu.php
@@ -22,11 +22,11 @@ class core_menu_Core {
$menu
->append(Menu::factory("link")
->id("home")
- ->label(_("Home"))
+ ->label(t("Home"))
->url(url::base()))
->append(Menu::factory("link")
->id("browse")
- ->label(_("Browse"))
+ ->label(t("Browse"))
->url(url::site("albums/1")));
$item = $theme->item();
@@ -34,31 +34,31 @@ class core_menu_Core {
if (!user::active()->guest) {
$menu->append($admin_menu = Menu::factory("submenu")
->id("admin_menu")
- ->label(_("Admin")));
+ ->label(t("Admin")));
}
if ($item && access::can("edit", $item)) {
$menu->append($options_menu = Menu::factory("submenu")
->id("options_menu")
- ->label(_("Options"))
+ ->label(t("Options"))
->append(Menu::factory("dialog")
->id("edit_item")
- ->label($item->type == "album" ? _("Edit album") : _("Edit photo"))
+ ->label($item->type == "album" ? t("Edit album") : t("Edit photo"))
->url(url::site("form/edit/{$item->type}s/$item->id"))));
if ($item->type == "album") {
$options_menu
->append(Menu::factory("dialog")
->id("add_item")
- ->label(_("Add a photo"))
+ ->label(t("Add a photo"))
->url(url::site("form/add/albums/$item->id?type=photo")))
->append(Menu::factory("dialog")
->id("add_album")
- ->label(_("Add an album"))
+ ->label(t("Add an album"))
->url(url::site("form/add/albums/$item->id?type=album")))
->append(Menu::factory("dialog")
->id("edit_permissions")
- ->label(_("Edit permissions"))
+ ->label(t("Edit permissions"))
->url(url::site("permissions/browse/$item->id")));
}
}
@@ -66,7 +66,7 @@ class core_menu_Core {
if (user::active()->admin) {
$admin_menu->append(Menu::factory("link")
->id("site_admin")
- ->label(_("Site Admin"))
+ ->label(t("Site Admin"))
->url(url::site("admin")));
}
}
@@ -75,7 +75,7 @@ class core_menu_Core {
$menu
->append(Menu::factory("link")
->id("hybrid")
- ->label(_("View album hybrid mode"))
+ ->label(t("View album hybrid mode"))
->url("#")
->css_id("gHybridLink"));
}
@@ -84,12 +84,12 @@ class core_menu_Core {
$menu
->append(Menu::factory("link")
->id("fullsize")
- ->label(_("View full size"))
+ ->label(t("View full size"))
->url("#")
->css_id("gFullsizeLink"))
->append(Menu::factory("link")
->id("album")
- ->label(_("Return to album"))
+ ->label(t("Return to album"))
->url($theme->item()->parent()->url("show={$theme->item->id}"))
->css_id("gAlbumLink"));
}
@@ -98,43 +98,43 @@ class core_menu_Core {
$menu
->append(Menu::factory("link")
->id("dashboard")
- ->label(_("Dashboard"))
+ ->label(t("Dashboard"))
->url(url::site("admin")))
->append(Menu::factory("submenu")
->id("settings_menu")
- ->label(_("Settings"))
+ ->label(t("Settings"))
->append(Menu::factory("link")
->id("graphics_toolkits")
- ->label(_("Graphics"))
+ ->label(t("Graphics"))
->url(url::site("admin/graphics"))))
->append(Menu::factory("link")
->id("modules")
- ->label(_("Modules"))
+ ->label(t("Modules"))
->url(url::site("admin/modules")))
->append(Menu::factory("submenu")
->id("content_menu")
- ->label(_("Content")))
+ ->label(t("Content")))
->append(Menu::factory("submenu")
->id("presentation_menu")
- ->label(_("Presentation"))
+ ->label(t("Presentation"))
->append(Menu::factory("link")
->id("themes")
- ->label(_("Themes"))
+ ->label(t("Themes"))
->url(url::site("admin/themes")))
->append(Menu::factory("link")
->id("image_sizes")
- ->label(_("Image Sizes"))
+ ->label(t("Image Sizes"))
->url("#")))
->append(Menu::factory("submenu")
->id("users_groups_menu")
- ->label(_("Users/Groups")))
+ ->label(t("Users/Groups")))
->append(Menu::factory("link")
->id("maintenance")
- ->label(_("Maintenance"))
+ ->label(t("Maintenance"))
->url(url::site("admin/maintenance")))
->append(Menu::factory("submenu")
->id("statistics_menu")
- ->label(_("Statistics"))
+ ->label(t("Statistics"))
->url("#"));
}
}
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php
index 83a08004..847de665 100644
--- a/core/helpers/graphics.php
+++ b/core/helpers/graphics.php
@@ -217,10 +217,13 @@ class graphics_Core {
$count = self::find_dirty_images_query()->count();
if ($count) {
site_status::warning(
- sprintf(_("%d of your photos are out of date. %sClick here to fix them%s"),
- $count, "<a href=\"" .
- url::site("admin/maintenance/start/graphics::rebuild_dirty_images?csrf=__CSRF__") .
- "\" class=\"gDialogLink\">", "</a>"),
+ t(array("one" => "One of your photos is out of date. {{link_start}}Click here to fix it{{link_end}}",
+ "other" => "{{count}} of your photos are out of date. {{link_start}}Click here to fix them{{link_end}}"),
+ array("count" => $count,
+ "link_start" => "<a href=\"" .
+ url::site("admin/maintenance/start/graphics::rebuild_dirty_images?csrf=__CSRF__") .
+ "\" class=\"gDialogLink\">",
+ "link_end" => "</a>")),
"graphics_dirty");
}
}
@@ -251,8 +254,10 @@ class graphics_Core {
}
}
- $task->status = sprintf(
- _("Updated %d out of %d images"), $completed, $remaining + $completed);
+ $task->status = t(array("one" => "Updated: 1 image. Total: {{total_count}}.",
+ "other" => "Updated: {{count}} images. Total: {{total_count}}."),
+ array("count" => $completed,
+ "total_count" => ($remaining + $completed)));
if ($completed + $remaining > 0) {
$task->percent_complete = (int)(100 * $completed / ($completed + $remaining));
diff --git a/core/helpers/module.php b/core/helpers/module.php
index 9bce7a44..4b98674e 100644
--- a/core/helpers/module.php
+++ b/core/helpers/module.php
@@ -127,7 +127,7 @@ class module_Core {
}
self::load_modules();
- log::success("module", sprintf(_("Installed module %s"), $module_name));
+ log::success("module", t("Installed module {{module_name}}", array("module_name" => $module_name)));
}
/**
@@ -137,7 +137,7 @@ class module_Core {
$installer_class = "{$module_name}_installer";
Kohana::log("debug", "$installer_class uninstall");
call_user_func(array($installer_class, "uninstall"));
- log::success("module", sprintf(_("Uninstalled module %s"), $module_name));
+ log::success("module", t("Uninstalled module {{module_name}}", array("module_name" => $module_name)));
}
/**
diff --git a/core/helpers/photo.php b/core/helpers/photo.php
index 29f2ac6f..749efb87 100644
--- a/core/helpers/photo.php
+++ b/core/helpers/photo.php
@@ -96,13 +96,13 @@ class photo_Core {
static function get_add_form($parent) {
$form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gAddPhotoForm"));
- $group = $form->group("add_photo")->label(sprintf(_("Add Photo to %s"), $parent->title));
- $group->input("name")->label(_("Name"));
- $group->input("title")->label(_("Title"));
- $group->textarea("description")->label(_("Description"));
- $group->upload("file")->label(_("File"))->rules("required|allow[jpg,png,gif]");
+ $group = $form->group("add_photo")->label(t("Add Photo to {{album_title}}", array("album_title" =>$parent->title)));
+ $group->input("name")->label(t("Name"));
+ $group->input("title")->label(t("Title"));
+ $group->textarea("description")->label(t("Description"));
+ $group->upload("file")->label(t("File"))->rules("required|allow[jpg,png,gif]");
$group->hidden("type")->value("photo");
- $group->submit(_("Upload"));
+ $group->submit(t("Upload"));
$form->add_rules_from(ORM::factory("item"));
return $form;
}
@@ -110,11 +110,11 @@ class photo_Core {
static function get_edit_form($photo) {
$form = new Forge("photos/$photo->id", "", "post", array("id" => "gEditPhotoForm"));
$form->hidden("_method")->value("put");
- $group = $form->group("edit_photo")->label(_("Edit Photo"));
- $group->input("name")->label(_("Name"))->value($photo->name);
- $group->input("title")->label(_("Title"))->value($photo->title);
- $group->textarea("description")->label(_("Description"))->value($photo->description);
- $group->submit(_("Modify"));
+ $group = $form->group("edit_photo")->label(t("Edit Photo"));
+ $group->input("name")->label(t("Name"))->value($photo->name);
+ $group->input("title")->label(t("Title"))->value($photo->title);
+ $group->textarea("description")->label(t("Description"))->value($photo->description);
+ $group->submit(t("Modify"));
$form->add_rules_from(ORM::factory("item"));
return $form;
}
diff --git a/core/hooks/register_i18n.php b/core/hooks/register_i18n.php
new file mode 100644
index 00000000..2a8c8019
--- /dev/null
+++ b/core/hooks/register_i18n.php
@@ -0,0 +1,21 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+Event::add("system.ready", array("I18n", "instance"));
diff --git a/core/libraries/I18n.php b/core/libraries/I18n.php
index 786274dd..6a8bf3ed 100644
--- a/core/libraries/I18n.php
+++ b/core/libraries/I18n.php
@@ -81,7 +81,7 @@ class I18n_Core {
$entry = Database::instance()
->select("translation")
->from("translations_incomings")
- ->where(array("key" => md5($key),
+ ->where(array("key" => md5($key, true),
"locale" => $locale))
->limit(1)
->get()
diff --git a/core/tests/I18n_Test.php b/core/tests/I18n_Test.php
index 2a13189a..5d505eb1 100644
--- a/core/tests/I18n_Test.php
+++ b/core/tests/I18n_Test.php
@@ -44,7 +44,7 @@ class I18n_Test extends Unit_Test_Case {
$key = $message;
$key = is_array($key) ? array_shift($key) : $key;
$entry = ORM::factory("translations_incoming");
- $entry->key = md5($key);
+ $entry->key = md5($key, true);
$entry->message = serialize($message);
$entry->translation = serialize($translation);
$entry->locale = 'te_ST';
diff --git a/core/views/admin_block_platform.html.php b/core/views/admin_block_platform.html.php
index 958097a1..2f13d5d9 100644
--- a/core/views/admin_block_platform.html.php
+++ b/core/views/admin_block_platform.html.php
@@ -1,15 +1,15 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul>
<li>
- <? printf(_("Operating System: %s"), PHP_OS) ?>
+ <?= t("Operating System: {{operating_system}}", array("operating_system" => PHP_OS)) ?>
</li>
<li>
- <? printf(_("Apache: %s"), function_exists("apache_get_version") ? apache_get_version() : _("Unknown")) ?>
+ <?= t("Apache: {{apache_version}}", array("apache_version" => function_exists("apache_get_version") ? apache_get_version() : t("Unknown"))) ?>
</li>
<li>
- <? printf(_("PHP: %s"), phpversion()) ?>
+ <?= t("PHP: {{php_version}}", array("php_version" => phpversion())) ?>
</li>
<li>
- <? printf(_("MySQL: %s"), mysql_get_server_info()) ?>
+ <?= t("MySQL: {{mysql_version}}", array("mysql_version" => mysql_get_server_info())) ?>
</li>
</ul>
diff --git a/core/views/admin_block_stats.html.php b/core/views/admin_block_stats.html.php
index b83add10..c3b9ee98 100644
--- a/core/views/admin_block_stats.html.php
+++ b/core/views/admin_block_stats.html.php
@@ -1,12 +1,12 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul>
<li>
- <? printf(_("Version: %s"), "3.0") ?>
+ <?= t("Version: {{version}}", array("version" => "3.0")) ?>
</li>
<li>
- <? printf(_("Albums: %d"), $album_count) ?>
+ <?= t("Albums: {{count}}", array("count" => $album_count)) ?>
</li>
<li>
- <? printf(_("Photos: %d"), $photo_count) ?>
+ <?= t("Photos: {{count}}", array("count" => $photo_count)) ?>
</li>
</ul>
diff --git a/core/views/admin_block_welcome.html.php b/core/views/admin_block_welcome.html.php
index a221c9bd..35501ffc 100644
--- a/core/views/admin_block_welcome.html.php
+++ b/core/views/admin_block_welcome.html.php
@@ -1,15 +1,18 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<p>
- <?= _("This is your administration dashboard and it provides a quick overview of status messages, recent updates, and frequently used options. Add or remove blocks and rearrange them to tailor to your needs. The admin menu provides quick access to all of Gallery 3's options and settings. Here are a few of the most used options to get you started.") ?>
+ <?= t("This is your administration dashboard and it provides a quick overview of status messages, recent updates, and frequently used options. Add or remove blocks and rearrange them to tailor to your needs. The admin menu provides quick access to all of Gallery 3's options and settings. Here are a few of the most used options to get you started.") ?>
</p>
<ul>
<li>
- <?= sprintf(_("%sGeneral Settings%s - General configuation options for your Gallery."), "<a href=\"#\">", "</a>") ?>
+ <?= t("{{link_start}}General Settings{{link_end}} - General configuation options for your Gallery.",
+ array("link_start" => "<a href=\"#\">", "link_end" => "</a>")) ?>
</li>
<li>
- <?= sprintf(_("%sModules%s - Manage available and installed modules."), "<a href=\"" . url::site("admin/modules") . "\">", "</a>") ?>
+ <?= t("{{link_start}}Modules{{link_end}} - Manage available and installed modules.",
+ array("link_start" => "<a href=\"" . url::site("admin/modules") . "\">", "link_end" => "</a>")) ?>
</li>
<li>
- <?= sprintf(_("%sPresentation%s - Choose a theme, set image sizes."), "<a href=\"#\">", "</a>") ?>
+ <?= t("{{link_start}}Presentation{{link_end}} - Choose a theme, set image sizes.",
+ array("link_start" => "<a href=\"#\">", "link_end" => "</a>")) ?>
</li>
</ul>
diff --git a/core/views/admin_graphics.html.php b/core/views/admin_graphics.html.php
index 19f80cba..7d57ec6f 100644
--- a/core/views/admin_graphics.html.php
+++ b/core/views/admin_graphics.html.php
@@ -1,13 +1,13 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="gGraphics">
- <h1> <?= _("Graphics Settings") ?> </h1>
+ <h1> <?= t("Graphics Settings") ?> </h1>
<p>
- <?= _("Gallery needs a graphics toolkit in order to manipulate your photos. Please choose one from the list below.") ?>
+ <?= t("Gallery needs a graphics toolkit in order to manipulate your photos. Please choose one from the list below.") ?>
</p>
<form method="post" action="<?= url::site("admin/graphics/save") ?>">
<?= access::csrf_form_field() ?>
- <h2> <?= _("Graphics Toolkits") ?> </h2>
+ <h2> <?= t("Graphics Toolkits") ?> </h2>
<table>
<tr>
<td valign="top" style="width: 100px">
@@ -19,21 +19,23 @@
</center>
</td>
<td>
- <h3> <?= _("GD") ?> </h3>
+ <h3> <?= t("GD") ?> </h3>
<p>
- <? printf(_("The GD graphics library is an extension to PHP commonly installed most webservers. Please refer to the %sGD website%s for more information."), "<a href=\"http://www.boutell.com/gd/\">", "</a>") ?>
+ <?= t("The GD graphics library is an extension to PHP commonly installed most webservers. Please refer to the {{link_start}}GD website{{link_end}} for more information.",
+ array("link_start" => "<a href=\"http://www.boutell.com/gd/\">", "link_end" => "</a>")) ?>
</p>
<? if ($tk->gd["GD Version"] && function_exists('imagerotate')): ?>
<p class="gSuccess">
- <? printf(_("You have GD version %s."), $tk->gd["GD Version"]) ?>
+ <?= t("You have GD version {{version}}.", array("version" => $tk->gd["GD Version"])) ?>
</p>
<? elseif ($tk->gd["GD Version"]): ?>
<p class="gWarning">
- <? printf(_("You have GD version %s, but it lacks image rotation."), $tk->gd["GD Version"]) ?>
+ <?= t("You have GD version {{version}}, but it lacks image rotation.",
+ array("version" => $tk->gd["GD Version"])) ?>
</p>
<? else: ?>
<p class="gInfo">
- <?= _("You do not have GD installed.") ?>
+ <?= t("You do not have GD installed.") ?>
</p>
<? endif ?>
</td>
@@ -49,17 +51,18 @@
</center>
</td>
<td>
- <h3> <?= _("ImageMagick") ?> </h3>
+ <h3> <?= t("ImageMagick") ?> </h3>
<p>
- <? printf(_("ImageMagick is a standalone graphics program available on most Linux systems. Please refer to the %sImageMagick website%s for more information."), "<a href=\"http://www.imagemagick.org/\">", "</a>") ?>
+ <?= t("ImageMagick is a standalone graphics program available on most Linux systems. Please refer to the {{link_start}}ImageMagick website{{link_end}} for more information.",
+ array("link_start" => "<a href=\"http://www.imagemagick.org/\">", "link_end" => "</a>")) ?>
</p>
<? if ($tk->imagemagick): ?>
<p class="gSuccess">
- <? printf(_("You have ImageMagick installed in %s"), $tk->imagemagick) ?>
+ <?= t("You have ImageMagick installed in {{path}}", array("path" => $tk->imagemagick)) ?>
</p>
<? else: ?>
<p class="gInfo">
- <?= _("ImageMagick is not available on your system.") ?>
+ <?= t("ImageMagick is not available on your system.") ?>
</p>
<? endif ?>
</td>
@@ -75,22 +78,23 @@
</center>
</td>
<td>
- <h3> <?= _("GraphicsMagick") ?> </h3>
+ <h3> <?= t("GraphicsMagick") ?> </h3>
<p>
- <? printf(_("GraphicsMagick is a standalone graphics program available on most Linux systems. Please refer to the %sGraphicsMagick website%s for more information."), "<a href=\"http://www.graphicsmagick.org/\">", "</a>") ?>
+ <?= t("GraphicsMagick is a standalone graphics program available on most Linux systems. Please refer to the {{link_start}}GraphicsMagick website{{link_end}} for more information.",
+ array("link_start" => "<a href=\"http://www.graphicsmagick.org/\">", "link_end" => "</a>")) ?>
</p>
<? if ($tk->graphicsmagick): ?>
<p class="gSuccess">
- <? printf(_("You have GraphicsMagick installed in %s"), $tk->graphicsmagick) ?>
+ <?= t("You have GraphicsMagick installed in {{path}}", array("path" => $tk->graphicsmagick)) ?>
</p>
<? else: ?>
<p class="gInfo">
- <?= _("GraphicsMagick is not available on your system.") ?>
+ <?= t("GraphicsMagick is not available on your system.") ?>
</p>
<? endif ?>
</td>
</tr>
</table>
- <input type="submit" value="<?= _("Save") ?>"/>
+ <input type="submit" value="<?= t("Save") ?>"/>
</form>
</div>
diff --git a/core/views/admin_maintenance.html.php b/core/views/admin_maintenance.html.php
index 1f9809ac..49a2f364 100644
--- a/core/views/admin_maintenance.html.php
+++ b/core/views/admin_maintenance.html.php
@@ -1,22 +1,22 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="gMaintenance">
- <h1> <?= _("Maintenance Tasks") ?> </h1>
+ <h1> <?= t("Maintenance Tasks") ?> </h1>
<p>
- <?= _("Occasionally your Gallery will require some maintenance. Here are some tasks you can use to keep it running smoothly.") ?>
+ <?= t("Occasionally your Gallery will require some maintenance. Here are some tasks you can use to keep it running smoothly.") ?>
</p>
<div id="gAvailableTasks">
- <h2> <?= _("Available Tasks") ?> </h2>
+ <h2> <?= t("Available Tasks") ?> </h2>
<table style="width: 680px" border="1">
<tr>
<th>
- <?= _("Name") ?>
+ <?= t("Name") ?>
</th>
<th>
- <?= _("Description") ?>
+ <?= t("Description") ?>
</th>
<th>
- <?= _("Action") ?>
+ <?= t("Action") ?>
</th>
</tr>
<? foreach ($task_definitions as $task) ?>
@@ -30,7 +30,7 @@
<td>
<a href="<?= url::site("admin/maintenance/start/$task->callback?csrf=$csrf") ?>"
class="gDialogLink">
- <?= _("run") ?>
+ <?= t("run") ?>
</a>
</td>
</tr>
@@ -38,24 +38,24 @@
</div>
<div id="gRunningTasks">
- <h2> <?= _("Running Tasks") ?> </h2>
+ <h2> <?= t("Running Tasks") ?> </h2>
<table style="width: 680px" border="1">
<tr>
<th>
- <?= _("Last Updated") ?>
+ <?= t("Last Updated") ?>
</th>
<th>
- <?= _("Name") ?>
+ <?= t("Name") ?>
</th>
<th>
- <?= _("Status") ?>
+ <?= t("Status") ?>
</th>
<th>
- <?= _("Info") ?>
+ <?= t("Info") ?>
</th>
<th>
- <?= _("Action") ?>
+ <?= t("Action") ?>
</th>
</tr>
<? foreach ($running_tasks as $task): ?>
@@ -69,13 +69,13 @@
<td>
<? if ($task->done): ?>
<? if ($task->state == "cancelled"): ?>
- <?= _("Cancelled") ?>
+ <?= t("Cancelled") ?>
<? endif ?>
- <?= _("Done") ?>
+ <?= t("Done") ?>
<? elseif ($task->state == "stalled"): ?>
- <?= _("Stalled") ?>
+ <?= t("Stalled") ?>
<? else: ?>
- <?= sprintf(_("%d%% Complete"), $task->percent_complete) ?>
+ <?= t("{{percent_complete}}% Complete", array("percent_complete" => $task->percent_complete)) ?>
<? endif ?>
</td>
<td>
@@ -84,11 +84,11 @@
<td>
<? if ($task->state == "stalled"): ?>
<a href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>" class="gDialogLink">
- <?= _("resume") ?>
+ <?= t("resume") ?>
</a>
<? endif ?>
<a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>">
- <?= _("cancel") ?>
+ <?= t("cancel") ?>
</a>
</td>
</tr>
@@ -97,24 +97,24 @@
</div>
<div id="gFinishedTasks">
- <h2> <?= _("Finished Tasks") ?> </h2>
+ <h2> <?= t("Finished Tasks") ?> </h2>
<table style="width: 680px" border="1">
<tr>
<th>
- <?= _("Last Updated") ?>
+ <?= t("Last Updated") ?>
</th>
<th>
- <?= _("Name") ?>
+ <?= t("Name") ?>
</th>
<th>
- <?= _("Status") ?>
+ <?= t("Status") ?>
</th>
<th>
- <?= _("Info") ?>
+ <?= t("Info") ?>
</th>
<th>
- <?= _("Action") ?>
+ <?= t("Action") ?>
</th>
</tr>
<? foreach ($finished_tasks as $task): ?>
@@ -127,11 +127,11 @@
</td>
<td>
<? if ($task->state == "success"): ?>
- <?= _("Success") ?>
+ <?= t("Success") ?>
<? elseif ($task->state == "error"): ?>
- <?= _("Failed") ?>
+ <?= t("Failed") ?>
<? elseif ($task->state == "cancelled"): ?>
- <?= _("Cancelled") ?>
+ <?= t("Cancelled") ?>
<? endif ?>
</td>
<td>
@@ -140,14 +140,14 @@
<td>
<? if ($task->done): ?>
<a href="<?= url::site("admin/maintenance/remove/$task->id?csrf=$csrf") ?>">
- <?= _("remove") ?>
+ <?= t("remove") ?>
</a>
<? else: ?>
<a href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>">
- <?= _("resume") ?>
+ <?= t("resume") ?>
</a>
<a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>">
- <?= _("cancel") ?>
+ <?= t("cancel") ?>
</a>
<? endif ?>
</td>
diff --git a/core/views/admin_maintenance_task.html.php b/core/views/admin_maintenance_task.html.php
index bcbdba0d..52e1f00d 100644
--- a/core/views/admin_maintenance_task.html.php
+++ b/core/views/admin_maintenance_task.html.php
@@ -26,7 +26,7 @@
<br/>
percent_complete: <span id="gPercentComplete"></span>
<div>
- <button id="gPauseButton" onclick="dismiss()"><?= _("Pause") ?></button>
- <button id="gDoneButton" style="display: none" onclick="dismiss()"><?= _("Done") ?></button>
+ <button id="gPauseButton" onclick="dismiss()"><?= t("Pause") ?></button>
+ <button id="gDoneButton" style="display: none" onclick="dismiss()"><?= t("Done") ?></button>
</div>
</div>
diff --git a/core/views/admin_modules.html.php b/core/views/admin_modules.html.php
index 4aa36a96..67fdfa32 100644
--- a/core/views/admin_modules.html.php
+++ b/core/views/admin_modules.html.php
@@ -1,30 +1,30 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="gModules">
- <h1> <?= _("Gallery Modules") ?> </h1>
+ <h1> <?= t("Gallery Modules") ?> </h1>
<p>
- <?= _("Power up your Gallery by adding more modules! Each module provides new cool features.") ?>
+ <?= t("Power up your Gallery by adding more modules! Each module provides new cool features.") ?>
</p>
<form method="post" action="<?= url::site("admin/modules/save") ?>">
<?= access::csrf_form_field() ?>
<table>
<tr>
- <th> <?= _("Installed") ?> </th>
- <th> <?= _("Name") ?> </th>
- <th> <?= _("Version") ?> </th>
- <th> <?= _("Description") ?> </th>
+ <th> <?= t("Installed") ?> </th>
+ <th> <?= t("Name") ?> </th>
+ <th> <?= t("Version") ?> </th>
+ <th> <?= t("Description") ?> </th>
</tr>
<? foreach ($available as $module_name => $module_info): ?>
<tr>
<? $data = array("name" => $module_name); ?>
<? if ($module_info->locked) $data["disabled"] = 1; ?>
<td> <?= form::checkbox($data, '1', module::is_installed($module_name)) ?> </td>
- <td> <?= _($module_info->name) ?> </td>
+ <td> <?= t($module_info->name) ?> </td>
<td> <?= $module_info->version ?> </td>
- <td> <?= _($module_info->description) ?> </td>
+ <td> <?= t($module_info->description) ?> </td>
</tr>
<? endforeach ?>
</table>
- <input type="submit" value="<?= _("Update") ?>"/>
+ <input type="submit" value="<?= t("Update") ?>"/>
</form>
</div>
diff --git a/core/views/admin_themes.html.php b/core/views/admin_themes.html.php
index cff6de7d..1064ae5e 100644
--- a/core/views/admin_themes.html.php
+++ b/core/views/admin_themes.html.php
@@ -1,8 +1,8 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="gThemes">
- <h1><?= _("Theme Administration") ?></h1>
+ <h1><?= t("Theme Administration") ?></h1>
<p>
- <?= _("These are the themes in your system") ?>
+ <?= t("These are the themes in your system") ?>
</p>
<form method="post" action="<?= url::site("admin/themes/save") ?>">
<?= access::csrf_form_field() ?>
@@ -12,6 +12,6 @@
/>
<?= $theme ?>
<? endforeach ?>
- <input type="submit" value="<?= _("Save") ?>"/>
+ <input type="submit" value="<?= t("Save") ?>"/>
</form>
</div>
diff --git a/core/views/permissions_form.html.php b/core/views/permissions_form.html.php
index 94a3bead..ba3191e1 100644
--- a/core/views/permissions_form.html.php
+++ b/core/views/permissions_form.html.php
@@ -2,7 +2,7 @@
<form method="post" action="<?= url::site("permissions/edit/$item->id") ?>">
<?= access::csrf_form_field() ?>
<fieldset>
- <legend><?= _("Edit Permissions") ?> </legend>
+ <legend><?= t("Edit Permissions") ?> </legend>
<table>
<tr>
@@ -14,7 +14,7 @@
<? foreach ($permissions as $permission): ?>
<tr>
- <td> <?= _($permission->display_name) ?> </td>
+ <td> <?= t($permission->display_name) ?> </td>
<? foreach ($groups as $group): ?>
<td>
<? $intent = access::group_intent($group, $permission->name, $item) ?>
@@ -22,7 +22,7 @@
<? $lock = access::locked_by($group, $permission->name, $item) ?>
<? if ($lock): ?>
- <?= _("denied and locked by") ?> <a href="javascript:show(<?= $lock->id ?>)"><?= _("parent") ?></a>
+ <?= t("denied and locked by") ?> <a href="javascript:show(<?= $lock->id ?>)"><?= t("parent") ?></a>
<? else: ?>
<? if ($intent === null): ?>
<? if ($allowed): ?>
diff --git a/core/views/quick_pane.html.php b/core/views/quick_pane.html.php
index 7ae0a856..9a0e56d5 100644
--- a/core/views/quick_pane.html.php
+++ b/core/views/quick_pane.html.php
@@ -4,7 +4,7 @@
<div class="rotate-counter-clockwise"
href="<?= url::site("quick/rotate/$item->id/ccw?csrf=" . access::csrf_token()) ?>">
<span>
- <?= _("Rotate CCW") ?>
+ <?= t("Rotate CCW") ?>
</span>
</div>
<? endif ?>
@@ -12,7 +12,7 @@
<div class="edit gDialogLink"
href="<?= url::site("quick/form_edit/$item->id") ?>">
<span>
- <?= _("Edit") ?>
+ <?= t("Edit") ?>
</span>
</div>
@@ -20,7 +20,7 @@
<div class="rotate-clockwise"
href="<?= url::site("quick/rotate/$item->id/cw?csrf=" . access::csrf_token()) ?>">
<span>
- <?= _("Rotate CCW") ?>
+ <?= t("Rotate CCW") ?>
</span>
</div>
<? endif ?>
diff --git a/modules/akismet/controllers/admin_akismet.php b/modules/akismet/controllers/admin_akismet.php
index 6d32868f..487c68ce 100644
--- a/modules/akismet/controllers/admin_akismet.php
+++ b/modules/akismet/controllers/admin_akismet.php
@@ -35,14 +35,14 @@ class Admin_Akismet_Controller extends Admin_Controller {
if ($valid) {
$old_key = module::get_var("akismet", "api_key");
if ($old_key && !$new_key) {
- message::success(_("Your Akismet key has been cleared."));
+ message::success(t("Your Akismet key has been cleared."));
} else if ($old_key && $new_key && $old_key != $new_key) {
- message::success(_("Your Akismet key has been changed."));
+ message::success(t("Your Akismet key has been changed."));
} else if (!$old_key && $new_key) {
- message::success(_("Your Akismet key has been saved."));
+ message::success(t("Your Akismet key has been saved."));
}
- log::success("akismet", _("Akismet key changed to $new_key"));
+ log::success("akismet", t("Akismet key changed to $new_key"));
module::set_var("akismet", "api_key", $new_key);
url::redirect("admin/akismet");
} else {
diff --git a/modules/akismet/helpers/akismet.php b/modules/akismet/helpers/akismet.php
index 12d7a106..df4e7cfe 100644
--- a/modules/akismet/helpers/akismet.php
+++ b/modules/akismet/helpers/akismet.php
@@ -30,10 +30,10 @@ class akismet_Core {
public static function get_configure_form() {
$form = new Forge("admin/akismet", "", "post");
- $group = $form->group("configure_akismet")->label(_("Configure Akismet"));
- $group->input("api_key")->label(_("API Key"))->value(module::get_var("akismet", "api_key"));
- $group->api_key->error_messages("invalid", _("The API key you provided is invalid."));
- $group->submit(_("Save"));
+ $group = $form->group("configure_akismet")->label(t("Configure Akismet"));
+ $group->input("api_key")->label(t("API Key"))->value(module::get_var("akismet", "api_key"));
+ $group->api_key->error_messages("invalid", t("The API key you provided is invalid."));
+ $group->submit(t("Save"));
return $form;
}
diff --git a/modules/akismet/helpers/akismet_menu.php b/modules/akismet/helpers/akismet_menu.php
index 4a0c9b11..00bea8ad 100644
--- a/modules/akismet/helpers/akismet_menu.php
+++ b/modules/akismet/helpers/akismet_menu.php
@@ -22,14 +22,14 @@ class akismet_menu_Core {
$menu->get("settings_menu")
->append(Menu::factory("link")
->id("akismet")
- ->label(_("Akismet"))
+ ->label(t("Akismet"))
->url(url::site("admin/akismet")));
if (module::get_var("akismet", "api_key")) {
$menu->get("statistics_menu")
->append(Menu::factory("link")
->id("akismet")
- ->label(_("Akismet"))
+ ->label(t("Akismet"))
->url(url::site("admin/akismet/stats")));
}
}
diff --git a/modules/akismet/views/admin_akismet.html.php b/modules/akismet/views/admin_akismet.html.php
index 34a5461b..9963f223 100644
--- a/modules/akismet/views/admin_akismet.html.php
+++ b/modules/akismet/views/admin_akismet.html.php
@@ -1,13 +1,13 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="gAdminAkismet">
- <h1> <?= _("Akismet Spam Filtering") ?> </h1>
+ <h1> <?= t("Akismet Spam Filtering") ?> </h1>
<p>
- <?= _("Akismet is a free, automated spam filtering service. In order to use it, you need to sign up for a <a href=\"http://wordpress.com/api-keys\">Wordpress.com API Key</a>, which is also free. Your comments will be automatically relayed to <a href=\"http://akismet.com\">Akismet.com</a> where they'll be scanned for spam. Spam messages will be flagged accordingly and hidden from your vistors until you approve or delete them.") ?>
+ <?= t("Akismet is a free, automated spam filtering service. In order to use it, you need to sign up for a <a href=\"http://wordpress.com/api-keys\">Wordpress.com API Key</a>, which is also free. Your comments will be automatically relayed to <a href=\"http://akismet.com\">Akismet.com</a> where they'll be scanned for spam. Spam messages will be flagged accordingly and hidden from your vistors until you approve or delete them.") ?>
</p>
<? if ($valid_key): ?>
<div class="gSuccess">
- <?= _("Your API Key is valid. Your comments will be filtered!") ?>
+ <?= t("Your API Key is valid. Your comments will be filtered!") ?>
</div>
<? endif ?>
diff --git a/modules/atom/libraries/Gallery_Atom_Link.php b/modules/atom/libraries/Gallery_Atom_Link.php
index 07e3e891..def0d497 100644
--- a/modules/atom/libraries/Gallery_Atom_Link.php
+++ b/modules/atom/libraries/Gallery_Atom_Link.php
@@ -21,7 +21,7 @@
class Gallery_Atom_Link_Core extends Atom_Link {
public function related_atom($relative_uri, $title="") {
if (empty($title)) {
- $title = _("Get related meta data");
+ $title = t("Get related meta data");
}
$this->rel("related")
@@ -33,7 +33,7 @@ class Gallery_Atom_Link_Core extends Atom_Link {
public function related_image($relative_uri, $title="", $image_type="jpeg") {
if (empty($title)) {
- $title = _("Get related image");
+ $title = t("Get related image");
}
$this->rel("related")
diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php
index 7c88c1d9..9d7e1222 100644
--- a/modules/comment/controllers/admin_comments.php
+++ b/modules/comment/controllers/admin_comments.php
@@ -33,42 +33,47 @@ class Admin_Comments_Controller extends Admin_Controller {
$view->content->menu = Menu::factory("root")
->append(Menu::factory("link")
->id("all")
- ->label(sprintf(_("All Comments (%d)"),
- $view->content->all->count()))
+ ->label(t(array("one" => "All Comments ({{count}})",
+ "other" => "All Comments ({{count}})"),
+ array("count" => $view->content->all->count())))
->url(url::site("admin/comments/queue/all")))
->append(Menu::factory("link")
->id("unpublished")
- ->label(sprintf(_("Awaiting Moderation (%d)"),
- $view->content->unpublished->count()))
+ ->label(t(array("one" => "Awaiting Moderation ({{count}})",
+ "other" => "Awaiting Moderation ({{count}})"),
+ array("count" => $view->content->unpublished->count())))
->url(url::site("admin/comments/queue/unpublished")))
->append(Menu::factory("link")
->id("published")
- ->label(sprintf(_("Approved (%d)"),
- $view->content->published->count()))
+ ->label(t(array("one" => "Approved ({{count}})",
+ "other" => "Approved ({{count}})"),
+ array("count" => $view->content->published->count())))
->url(url::site("admin/comments/queue/published")))
->append(Menu::factory("link")
->id("spam")
- ->label(sprintf(_("Spam (%d)"), $view->content->spam->count()))
+ ->label(t(array("one" => "Spam ({{count}})",
+ "other" => "Spam ({{count}})"),
+ array("count" => $view->content->spam->count())))
->url(url::site("admin/comments/queue/spam")));
switch ($state) {
case "all":
$view->content->comments = $view->content->all;
- $view->content->title = _("All Comments");
+ $view->content->title = t("All Comments");
break;
case "published":
$view->content->comments = $view->content->published;
- $view->content->title = _("Approved Comments");
+ $view->content->title = t("Approved Comments");
break;
case "unpublished":
$view->content->comments = $view->content->unpublished;
- $view->content->title = _("Comments Awaiting Moderation");
+ $view->content->title = t("Comments Awaiting Moderation");
break;
case "spam":
- $view->content->title = _("Spam Comments");
+ $view->content->title = t("Spam Comments");
$view->content->comments = $view->content->spam;
$view->content->spam_caught = module::get_var("comment", "spam_caught");
break;
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index 4bc77e57..3b6c0240 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -100,25 +100,25 @@ class comment_Core {
static function get_add_form($item) {
$form = new Forge("comments", "", "post");
- $group = $form->group("add_comment")->label(_("Add comment"));
- $group->input("author") ->label(_("Author")) ->id("gAuthor");
- $group->input("email") ->label(_("Email")) ->id("gEmail");
- $group->input("url") ->label(_("Website (hidden)"))->id("gUrl");
- $group->textarea("text") ->label(_("Text")) ->id("gText");
+ $group = $form->group("add_comment")->label(t("Add comment"));
+ $group->input("author") ->label(t("Author")) ->id("gAuthor");
+ $group->input("email") ->label(t("Email")) ->id("gEmail");
+ $group->input("url") ->label(t("Website (hidden)"))->id("gUrl");
+ $group->textarea("text") ->label(t("Text")) ->id("gText");
$group->hidden("item_id")->value($item->id);
- $group->submit(_("Add"));
+ $group->submit(t("Add"));
$form->add_rules_from(ORM::factory("comment"));
return $form;
}
static function get_edit_form($comment) {
$form = new Forge("comments/{$comment->id}?_method=put", "", "post");
- $group = $form->group("edit_comment")->label(_("Edit comment"));
- $group->input("author") ->label(_("Author")) ->id("gAuthor")->value($comment->author);
- $group->input("email") ->label(_("Email")) ->id("gEmail") ->value($comment->email);
- $group->input("url") ->label(_("Website (hidden)"))->id("gUrl") ->value($comment->url);
- $group->textarea("text")->label(_("Text")) ->id("gText") ->value($comment->text);
- $group->submit(_("Edit"));
+ $group = $form->group("edit_comment")->label(t("Edit comment"));
+ $group->input("author") ->label(t("Author")) ->id("gAuthor")->value($comment->author);
+ $group->input("email") ->label(t("Email")) ->id("gEmail") ->value($comment->email);
+ $group->input("url") ->label(t("Website (hidden)"))->id("gUrl") ->value($comment->url);
+ $group->textarea("text")->label(t("Text")) ->id("gText") ->value($comment->text);
+ $group->submit(t("Edit"));
$form->add_rules_from($comment);
return $form;
}
diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php
index 9a104baf..837eebb9 100644
--- a/modules/comment/helpers/comment_block.php
+++ b/modules/comment/helpers/comment_block.php
@@ -27,7 +27,7 @@ class comment_block_Core {
public static function photo_bottom($theme) {
$block = new Block;
$block->id = "gComments";
- $block->title = _("Comments");
+ $block->title = t("Comments");
$view = new View("comments.html");
$view->comments = ORM::factory("comment")
@@ -44,7 +44,7 @@ class comment_block_Core {
public static function admin_dashboard_blocks($theme) {
$block = new Block();
$block->id = "gRecentComments";
- $block->title = _("Recent Comments");
+ $block->title = t("Recent Comments");
$block->content = new View("admin_block_recent_comments.html");
$block->content->comments =
ORM::factory("comment")->orderby("created", "DESC")->limit(5)->find_all();
diff --git a/modules/comment/helpers/comment_menu.php b/modules/comment/helpers/comment_menu.php
index 9c7a5698..9df3024a 100644
--- a/modules/comment/helpers/comment_menu.php
+++ b/modules/comment/helpers/comment_menu.php
@@ -22,7 +22,7 @@ class comment_menu_Core {
$menu->get("content_menu")
->append(Menu::factory("link")
->id("comments")
- ->label(_("Comments"))
+ ->label(t("Comments"))
->url(url::site("admin/comments")));
}
@@ -30,7 +30,7 @@ class comment_menu_Core {
$menu
->append(Menu::factory("link")
->id("comments")
- ->label(_("View comments on this item"))
+ ->label(t("View comments on this item"))
->url("#comments")
->css_id("gCommentsLink"));
}
diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php
index 6829d74b..2d753bd7 100644
--- a/modules/comment/views/admin_block_recent_comments.html.php
+++ b/modules/comment/views/admin_block_recent_comments.html.php
@@ -3,8 +3,9 @@
<? foreach ($comments as $comment): ?>
<li>
<?= date("Y-M-d H:i:s", $comment->created) ?>
- <? printf(_("%s said %s"), "<a href=\"#\">$comment->author</a>",
- "<i>\"" . text::limit_words($comment->text, 50) . "\"</i>"); ?>
+ <?= t("{{author_name}} said {{comment_text}}",
+ array("author_name" => "<a href=\"#\">$comment->author</a>",
+ "comment_text" => "<i>\"" . text::limit_words($comment->text, 50) . "\"</i>")); ?>
</li>
<? endforeach ?>
</ul>
diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php
index b1f0aa97..b9f5148b 100644
--- a/modules/comment/views/admin_comments.html.php
+++ b/modules/comment/views/admin_comments.html.php
@@ -16,7 +16,7 @@
</script>
<div id="gAdminComments">
- <h1> <?= _("Manage Comments") ?> </h1>
+ <h1> <?= t("Manage Comments") ?> </h1>
<div id="gAdminCommentsMenu">
<?= $menu ?>
@@ -33,18 +33,22 @@
<? if ($queue == "spam"): ?>
<div>
<p>
- <? printf(_("Gallery has caught %d spam for you since you installed spam filtering."), $spam_caught) ?>
+ <?= t(array("one" => "Gallery has caught {{count}} spam for you since you installed spam filtering.",
+ "other" => "Gallery has caught {{count}} spam for you since you installed spam filtering."),
+ array("count" => $spam_caught)) ?>
</p>
<p>
<? if ($spam->count()): ?>
- <? printf(_("There are currently %d comments in your spam queue. You can delete them all with a single click, but there is no undo operation so you may want to check the messages first to make sure that they really are spam."), $spam->count()) ?>
+ <?= t(array("one" => "There is currently one comment in your spam queue. You can delete it with a single click, but there is no undo operation so you may want to check the message first to make sure that it really is spam.",
+ "other" => "There are currently {{count}} comments in your spam queue. You can delete them all with a single click, but there is no undo operation so you may want to check the messages first to make sure that they really are spam."),
+ array("count" => $spam->count())) ?>
</p>
<p>
<a href="<?= url::site("admin/comments/delete_all_spam?csrf=" . access::csrf_token()) ?>">
- <?= _("Delete all spam") ?>
+ <?= t("Delete all spam") ?>
</a>
<? else: ?>
- <?= _("Your spam queue is empty!") ?>
+ <?= t("Your spam queue is empty!") ?>
<? endif ?>
</p>
</div>
@@ -58,13 +62,13 @@
<table>
<tr>
<th>
- <?= _("Comment") ?>
+ <?= t("Comment") ?>
</th>
<th style="width: 100px">
- <?= _("Date") ?>
+ <?= t("Date") ?>
</th>
<th>
- <?= _("Actions") ?>
+ <?= t("Actions") ?>
</th>
</tr>
<? foreach ($comments as $comment): ?>
@@ -89,7 +93,8 @@
<?= photo::img_dimensions($item->thumb_width, $item->thumb_height, 75) ?>
/>
</a>
- <?= sprintf(_("Comment left on <a href=\"%s\">%s</a>"), $item->url(), $item->title) ?>
+ <?= t("Comment left on {{item_title}}",
+ array("item_title" => sprintf("<a href=\"%s\">%s</a>", $item->url(), $item->title))) ?>
</div>
</td>
<td>
@@ -100,7 +105,7 @@
<? if ($comment->state != "unpublished"): ?>
<li>
<a href="javascript:set_state('unpublished',<?=$comment->id?>)">
- <?= _("Unapprove") ?>
+ <?= t("Unapprove") ?>
</a>
</li>
<? endif ?>
@@ -108,7 +113,7 @@
<? if ($comment->state != "published"): ?>
<li>
<a href="javascript:set_state('published',<?=$comment->id?>)">
- <?= _("Approve") ?>
+ <?= t("Approve") ?>
</a>
</li>
<? endif ?>
@@ -116,14 +121,14 @@
<? if ($comment->state != "spam"): ?>
<li>
<a href="javascript:set_state('spam',<?=$comment->id?>)">
- <?= _("Spam") ?>
+ <?= t("Spam") ?>
</a>
</li>
<? endif ?>
<li>
<a href="javascript:del(<?=$comment->id?>)">
- <?= _("Delete") ?>
+ <?= t("Delete") ?>
</a>
</li>
</ul>
diff --git a/modules/comment/views/comment.html.php b/modules/comment/views/comment.html.php
index a87634e9..de0640bd 100644
--- a/modules/comment/views/comment.html.php
+++ b/modules/comment/views/comment.html.php
@@ -6,8 +6,8 @@
<? //endif ?>
<p class="gAuthor">
<a href="#"><img src="<?= $avatar ?>" class="gAvatar" alt="<?= $comment->author ?>" /></a>
- <?= _("on ") . date("Y-M-d H:i:s", $comment->created) ?>
- <a href="#"><?= $comment->author ?></a> <?= _("said") ?>
+ <?= t("on ") . date("Y-M-d H:i:s", $comment->created) ?>
+ <a href="#"><?= $comment->author ?></a> <?= t("said") ?>
</p>
<div>
<?= $comment->text ?>
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index e34446ac..b28a536e 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -9,8 +9,8 @@
<? //endif ?>
<p class="gAuthor">
<a href="#"><img src="<?= $avatar ?>" class="gAvatar" alt="<?= $comment->author ?>" /></a>
- <?= _("on ") . date("Y-M-d H:i:s", $comment->created) ?>
- <a href="#"><?= $comment->author ?></a> <?= _("said") ?>
+ <?= t("on ") . date("Y-M-d H:i:s", $comment->created) ?>
+ <a href="#"><?= $comment->author ?></a> <?= t("said") ?>
</p>
<div>
<?= $comment->text ?>
diff --git a/modules/gmaps/helpers/gmaps_block.php b/modules/gmaps/helpers/gmaps_block.php
index dc58a4cd..04d0ae63 100644
--- a/modules/gmaps/helpers/gmaps_block.php
+++ b/modules/gmaps/helpers/gmaps_block.php
@@ -23,7 +23,7 @@ class gmaps_block_Core {
if ($theme->item()) {
$block = new Block();
$block->id = "gMaps";
- $block->title = _("Location");
+ $block->title = t("Location");
$block->content = new View("gmaps_block.html");
return $block;
}
diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php
index 422e62da..358dd3b8 100644
--- a/modules/info/helpers/info_block.php
+++ b/modules/info/helpers/info_block.php
@@ -22,7 +22,7 @@ class info_block_Core {
if ($theme->item()) {
$block = new Block();
$block->id = "gMetadata";
- $block->title = _("Item Info");
+ $block->title = t("Item Info");
$block->content = new View("info_block.html");
return $block;
}
@@ -32,12 +32,12 @@ class info_block_Core {
$results = "";
if ($item->view_count) {
$results .= "<li>";
- $results .= sprintf(_("Views: %d"), $item->view_count);
+ $results .= t("Views: {{view_count}}", array("view_count" => $item->view_count));
$results .= "</li>";
}
if ($item->owner) {
$results .= "<li>";
- $results .= sprintf(_("By: %s"), "<a href=\"#\">{$item->owner->name}</a>");
+ $results .= t("By: {{owner_name}}", array("owner_name" => "<a href=\"#\">{$item->owner->name}</a>"));
$results .= "</li>";
}
return $results;
diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php
index f2c30395..491d9d10 100644
--- a/modules/info/views/info_block.html.php
+++ b/modules/info/views/info_block.html.php
@@ -2,22 +2,22 @@
<table class="gMetadata">
<tbody>
<tr>
- <th><?= _("Title:") ?></th>
+ <th><?= t("Title:") ?></th>
<td><?= $item->title; ?></td>
</tr>
<tr>
- <th><?= _("Description:") ?></th>
+ <th><?= t("Description:") ?></th>
<td><?= $item->description; ?></td>
</tr>
<? if ($item->id != 1): ?>
<tr>
- <th><?= _("Name:") ?></th>
+ <th><?= t("Name:") ?></th>
<td><?= $item->name; ?></td>
</tr>
<? endif ?>
<? if ($item->owner): ?>
<tr>
- <th><?= _("Owner:") ?></th>
+ <th><?= t("Owner:") ?></th>
<td><a href="#"><?= $item->owner->name ?></a></td>
</tr>
<? endif ?>
diff --git a/modules/media_rss/controllers/media_rss.php b/modules/media_rss/controllers/media_rss.php
index d10a9bc9..fbc3a29b 100644
--- a/modules/media_rss/controllers/media_rss.php
+++ b/modules/media_rss/controllers/media_rss.php
@@ -85,7 +85,7 @@ class Media_RSS_Controller extends Controller {
$view = new View("feed.mrss");
$view->title = $tag->name;
$view->link = url::abs_site("tags/{$tag->id}");
- $view->description = sprintf(_("Photos related to %s"), $tag->name);
+ $view->description = t("Photos related to {{tag_name}}", array("tag_name" => $tag->name));
$view->feed_link = url::abs_site("media_rss/tags/{$tag->id}");
$view->children = $children;
diff --git a/modules/search/views/search_link.html.php b/modules/search/views/search_link.html.php
index 5451638e..d5a5c47b 100644
--- a/modules/search/views/search_link.html.php
+++ b/modules/search/views/search_link.html.php
@@ -2,11 +2,11 @@
<form id="gSearchForm">
<ul>
<li>
- <label for="gSearch"><?= _("Search the gallery") ?></label>
+ <label for="gSearch"><?= t("Search the gallery") ?></label>
<input type="text" name="search" id="gSearch"/>
</li>
<li>
- <input type="submit" value="<?= _("Go") ?>" />
+ <input type="submit" value="<?= t("Go") ?>" />
</li>
</ul>
</form>
diff --git a/modules/slideshow/helpers/slideshow_menu.php b/modules/slideshow/helpers/slideshow_menu.php
index 269239da..8cc0d7fe 100644
--- a/modules/slideshow/helpers/slideshow_menu.php
+++ b/modules/slideshow/helpers/slideshow_menu.php
@@ -22,7 +22,7 @@ class slideshow_menu_Core {
$menu
->append(Menu::factory("link")
->id("slideshow")
- ->label(_("View slideshow"))
+ ->label(t("View slideshow"))
->url("javascript:PicLensLite.start()")
->css_id("gSlideshowLink"));
}
@@ -31,7 +31,7 @@ class slideshow_menu_Core {
$menu
->append(Menu::factory("link")
->id("slideshow")
- ->label(_("View slideshow"))
+ ->label(t("View slideshow"))
->url("javascript:PicLensLite.start()")
->css_id("gSlideshowLink"));
}
diff --git a/modules/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php
index 7370fb42..b30f5b95 100644
--- a/modules/tag/controllers/admin_tags.php
+++ b/modules/tag/controllers/admin_tags.php
@@ -52,8 +52,8 @@ class Admin_Tags_Controller extends Admin_Controller {
$name = $tag->name;
Database::instance()->query("DELETE from `items_tags` where `tag_id` = $tag->id");
$tag->delete();
- message::success(sprintf(_("Deleted tag %s"), $name));
- log::success("tags", sprintf(_("Deleted tag %s"), $name));
+ message::success(t("Deleted tag {{tag_name}}", array("tag_name" => $name)));
+ log::success("tags", t("Deleted tag {{tag_name}}", array("tag_name" => $name)));
print json_encode(
array("result" => "success",
@@ -96,8 +96,10 @@ class Admin_Tags_Controller extends Admin_Controller {
$tag->name = $new_name;
$tag->save();
- message::success(sprintf(_("Renamed tag %s to %s"), $old_name, $tag->name));
- log::success("tags", sprintf(_("Renamed tag %s to %s"), $old_name, $tag->name));
+ $message = t("Renamed tag {{old_name}} to {{new_name}}",
+ array("old_name" => $old_name, "new_name" => $tag->name));
+ message::success($message);
+ log::success("tags", $message);
print json_encode(
array("result" => "success",
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index 43697165..f552c669 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -77,28 +77,28 @@ class tag_Core {
public static function get_add_form($item) {
$form = new Forge("tags", "", "post", array("id" => "gAddTagForm"));
- $group = $form->group("add_tag")->label(_("Add Tag"));
- $group->input("name")->label(_("Add tag"));
+ $group = $form->group("add_tag")->label(t("Add Tag"));
+ $group->input("name")->label(t("Add tag"));
$group->hidden("item_id")->value($item->id);
- $group->submit(_("Add Tag"));
+ $group->submit(t("Add Tag"));
$form->add_rules_from(ORM::factory("tag"));
return $form;
}
public static function get_rename_form($tag) {
$form = new Forge("admin/tags/rename/$tag->id", "", "post", array("id" => "gRenameTagForm"));
- $group = $form->group("rename_tag")->label(_("Rename Tag"));
- $group->input("name")->label(_("Tag name"))->value($tag->name);
- $group->inputs["name"]->error_messages("in_use", _("There is already a tag with that name"));
- $group->submit(_("Save"));
+ $group = $form->group("rename_tag")->label(t("Rename Tag"));
+ $group->input("name")->label(t("Tag name"))->value($tag->name);
+ $group->inputs["name"]->error_messages("in_use", t("There is already a tag with that name"));
+ $group->submit(t("Save"));
$form->add_rules_from(ORM::factory("tag"));
return $form;
}
public static function get_delete_form($tag) {
$form = new Forge("admin/tags/delete/$tag->id", "", "post", array("id" => "gDeleteTagForm"));
- $group = $form->group("delete_tag")->label(sprintf(_("Really delete tag %s?"), $tag->name));
- $group->submit(_("Delete Tag"));
+ $group = $form->group("delete_tag")->label(t("Really delete tag {{tag_name}}?", array("tag_name" => $tag->name)));
+ $group->submit(t("Delete Tag"));
$form->add_rules_from(ORM::factory("tag"));
return $form;
}
diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php
index 37f7f21e..adcc7d40 100644
--- a/modules/tag/helpers/tag_block.php
+++ b/modules/tag/helpers/tag_block.php
@@ -26,7 +26,7 @@ class tag_block_Core {
public static function sidebar_blocks($theme) {
$block = new Block();
$block->id = "gTag";
- $block->title = _("Popular Tags");
+ $block->title = t("Popular Tags");
$block->content = new View("tag_block.html");
$block->content->cloud = tag::cloud(30);
diff --git a/modules/tag/helpers/tag_menu.php b/modules/tag/helpers/tag_menu.php
index b13453f8..5fa53b34 100644
--- a/modules/tag/helpers/tag_menu.php
+++ b/modules/tag/helpers/tag_menu.php
@@ -22,7 +22,7 @@ class tag_menu_Core {
$menu->get("content_menu")
->append(Menu::factory("link")
->id("tags")
- ->label(_("Tags"))
+ ->label(t("Tags"))
->url(url::site("admin/tags")));
}
}
diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php
index 4315917b..12f724b2 100644
--- a/modules/tag/views/admin_tags.html.php
+++ b/modules/tag/views/admin_tags.html.php
@@ -1,21 +1,21 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<h1> <?= _("Tags") ?> </h1>
+<h1> <?= t("Tags") ?> </h1>
<div id="gTagSearch">
<form method="get" action="<?= url::site("admin/tags") ?>">
<fieldset>
- <legend> <?= _("Search Tags") ?> </legend>
+ <legend> <?= t("Search Tags") ?> </legend>
<input name="filter" value="<?= $filter ?>"/>
- <input type="submit" value="<?= _("Search Tags") ?>"/>
+ <input type="submit" value="<?= t("Search Tags") ?>"/>
</fieldset>
</form>
</div>
<table>
<tr>
- <th> <?= _("Tag") ?> </th>
- <th> <?= _("Photos") ?> </th>
- <th> <?= _("Actions") ?> </th>
+ <th> <?= t("Tag") ?> </th>
+ <th> <?= t("Photos") ?> </th>
+ <th> <?= t("Actions") ?> </th>
</tr>
<? foreach ($tags as $tag): ?>
<tr>
@@ -25,14 +25,14 @@
<ul>
<li>
<a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>" class="gDialogLink"
- title="<?= sprintf(_("Delete tag %s"), $tag->name) ?>">
- <?= _("delete") ?>
+ title="<?= t("Delete tag {{tag_name}}", array("tag_name" => $tag->name)) ?>">
+ <?= t("delete") ?>
</a>
</li>
<li>
<a href="<?= url::site("admin/tags/form_rename/$tag->id") ?>" class="gDialogLink"
- title="<?= sprintf(_("Rename tag %s"), $tag->name) ?>">
- <?= _("rename") ?>
+ title="<?= t("Rename tag {{tag_name}}", array("tag_name" => $tag->name)) ?>">
+ <?= t("rename") ?>
</a>
</li>
</ul>
diff --git a/modules/user/controllers/admin_groups.php b/modules/user/controllers/admin_groups.php
index 01500f96..d05558a9 100644
--- a/modules/user/controllers/admin_groups.php
+++ b/modules/user/controllers/admin_groups.php
@@ -40,10 +40,10 @@ class Admin_Groups_Controller extends Controller {
if ($valid) {
$group = group::create($new_name);
$group->save();
- message::success(sprintf(_("Created group %s"), $group->name));
+ message::success(t("Created group {{group_name}}", array("group_name" => $group->name)));
print json_encode(array("result" => "success"));
} else {
- message::error(_("Failed to create group"));
+ message::error(t("Failed to create group"));
print json_encode(array("result" => "error",
"form" => $form->__toString()));
}
@@ -64,13 +64,14 @@ class Admin_Groups_Controller extends Controller {
$name = $group->name;
$group->delete();
} else {
- message::error(_("Failed to delete group"));
+ message::error(t("Failed to delete group"));
print json_encode(array("result" => "error",
"form" => $form->__toString()));
}
- log::success("group", sprintf(_("Deleted group %s"), $name));
- message::success(sprintf(_("Deleted group %s"), $name));
+ $message = t("Deleted group {{group_name}}", array("group_name" => $name));
+ log::success("group", $message);
+ message::success($message);
print json_encode(array("result" => "success"));
}
@@ -103,10 +104,10 @@ class Admin_Groups_Controller extends Controller {
if ($valid) {
$group->name = $form->edit_group->inputs["name"]->value;
$group->save();
- message::success(sprintf(_("Changed group %s"), $group->name));
+ message::success(t("Changed group {{group_name}}", array("group_name" => $group->name)));
print json_encode(array("result" => "success"));
} else {
- message::error(sprintf(_("Failed to change group %s"), $group->name));
+ message::error(t("Failed to change group {{group_name}}", array("group_name" => $group->name)));
print json_encode(array("result" => "error",
"form" => $form->__toString()));
}
diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php
index 13115178..e936cb8a 100644
--- a/modules/user/controllers/admin_users.php
+++ b/modules/user/controllers/admin_users.php
@@ -41,10 +41,10 @@ class Admin_Users_Controller extends Controller {
$name, $form->add_user->full_name->value, $form->add_user->password->value);
$user->email = $form->add_user->email->value;
$user->save();
- message::success(sprintf(_("Created user %s"), $user->name));
+ message::success(t("Created user {{user_name}}", array("user_name" => $user->name)));
print json_encode(array("result" => "success"));
} else {
- message::error(_("Failed to create user"));
+ message::error(t("Failed to create user"));
print json_encode(array("result" => "error",
"form" => $form->__toString()));
}
@@ -65,13 +65,14 @@ class Admin_Users_Controller extends Controller {
$name = $user->name;
$user->delete();
} else {
- message::error(_("Failed to delete user"));
+ message::error(t("Failed to delete user"));
print json_encode(array("result" => "error",
"form" => $form->__toString()));
}
- log::success("user", sprintf(_("Deleted user %s"), $name));
- message::success(sprintf(_("Deleted user %s"), $name));
+ $message = t("Deleted user {{user_name}}", array("user_name" => $name));
+ log::success("user", $message);
+ message::success($message);
print json_encode(array("result" => "success"));
}
@@ -107,10 +108,10 @@ class Admin_Users_Controller extends Controller {
$user->password = $form->edit_user->password->value;
$user->email = $form->edit_user->email->value;
$user->save();
- message::success(sprintf(_("Changed user %s"), $user->name));
+ message::success(t("Changed user {{user_name}}", array("user_name" => $user->name)));
print json_encode(array("result" => "success"));
} else {
- message::error(sprintf(_("Failed to change user %s"), $user->name));
+ message::error(t("Failed to change user {{user_name}}", array("user_name" => $user->name)));
print json_encode(array("result" => "error",
"form" => $form->__toString()));
}
diff --git a/modules/user/controllers/login.php b/modules/user/controllers/login.php
index d5791eab..b3ab5b10 100644
--- a/modules/user/controllers/login.php
+++ b/modules/user/controllers/login.php
@@ -34,7 +34,7 @@ class Login_Controller extends Controller {
$user = ORM::factory("user")->where("name", $form->login->inputs["name"]->value)->find();
if (!$user->loaded || !user::is_correct_password($user, $form->login->password->value)) {
log::warning(
- "user", sprintf(_("Failed login for %s"), $form->login->inputs["name"]->value));
+ "user", t("Failed login for {{name}}", array("username" => $form->login->inputs["name"]->value)));
$form->login->inputs["name"]->add_error("invalid_login", 1);
$valid = false;
}
@@ -42,7 +42,7 @@ class Login_Controller extends Controller {
if ($valid) {
user::login($user);
- log::info("user", sprintf(_("User %s logged in"), $user->name));
+ log::info("user", t("User {{name}} logged in", array("name" => $user->name)));
print json_encode(
array("result" => "success"));
} else {
@@ -54,11 +54,11 @@ class Login_Controller extends Controller {
private function _login_form() {
$form = new Forge(url::current(true), "", "post", array("id" => "gLoginForm"));
- $group = $form->group("login")->label(_("Login"));
- $group->input("name")->label(_("Name"))->id("gName")->class(null);
- $group->password("password")->label(_("Password"))->id("gPassword")->class(null);
- $group->inputs["name"]->error_messages("invalid_login", _("Invalid name or password"));
- $group->submit(_("Login"));
+ $group = $form->group("login")->label(t("Login"));
+ $group->input("name")->label(t("Name"))->id("gName")->class(null);
+ $group->password("password")->label(t("Password"))->id("gPassword")->class(null);
+ $group->inputs["name"]->error_messages("invalid_login", t("Invalid name or password"));
+ $group->submit(t("Login"));
return $form;
}
} \ No newline at end of file
diff --git a/modules/user/controllers/logout.php b/modules/user/controllers/logout.php
index e0da9a9f..06b869be 100644
--- a/modules/user/controllers/logout.php
+++ b/modules/user/controllers/logout.php
@@ -21,7 +21,7 @@ class Logout_Controller extends Controller {
public function index() {
$user = user::active();
user::logout();
- log::info("user", sprintf(_("User %s logged out"), $user->name),
+ log::info("user", t("User {{name}} logged out", array("name" => $user->name)),
html::anchor("user/$user->id", $user->name));
if ($this->input->get("continue")) {
url::redirect($this->input->get("continue"));
diff --git a/modules/user/helpers/group.php b/modules/user/helpers/group.php
index bd00d91e..41f19a7d 100644
--- a/modules/user/helpers/group.php
+++ b/modules/user/helpers/group.php
@@ -63,22 +63,22 @@ class group_Core {
public static function get_edit_form_admin($group) {
$form = new Forge("admin/groups/edit/$group->id");
- $form_group = $form->group("edit_group")->label(_("Edit Group"));
- $form_group->input("name")->label(_("Name"))->id("gName")->value($group->name);
+ $form_group = $form->group("edit_group")->label(t("Edit Group"));
+ $form_group->input("name")->label(t("Name"))->id("gName")->value($group->name);
$form_group->inputs["name"]->error_messages(
- "in_use", _("There is already a group with that name"));
- $form_group->submit(_("Save"));
+ "in_use", t("There is already a group with that name"));
+ $form_group->submit(t("Save"));
$form->add_rules_from($group);
return $form;
}
public static function get_add_form_admin() {
$form = new Forge("admin/groups/add");
- $form_group = $form->group("add_group")->label(_("Add Group"));
- $form_group->input("name")->label(_("Name"))->id("gName");
+ $form_group = $form->group("add_group")->label(t("Add Group"));
+ $form_group->input("name")->label(t("Name"))->id("gName");
$form_group->inputs["name"]->error_messages(
- "in_use", _("There is already a group with that name"));
- $form_group->submit(_("Add Group"));
+ "in_use", t("There is already a group with that name"));
+ $form_group->submit(t("Add Group"));
$group = ORM::factory("group");
$form->add_rules_from($group);
return $form;
@@ -87,8 +87,8 @@ class group_Core {
public static function get_delete_form_admin($group) {
$form = new Forge("admin/groups/delete/$group->id", "", "post");
$form_group = $form->group("delete_group")->label(
- sprintf(_("Are you sure you want to delete group %s?"), $group->name));
- $form_group->submit(_("Delete"));
+ t("Are you sure you want to delete group {{group_name}}?", array("group_name" => $group->name)));
+ $form_group->submit(t("Delete"));
return $form;
}
}
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php
index 3d8816e7..cc70d874 100644
--- a/modules/user/helpers/user.php
+++ b/modules/user/helpers/user.php
@@ -26,40 +26,40 @@
class user_Core {
public static function get_edit_form($user, $action = NULL) {
$form = new Forge("users/$user->id?_method=put", "", "post", array("id" => "gUserForm"));
- $group = $form->group("edit_user")->label(_("Edit User"));
- $group->input("name")->label(_("Name"))->id("gName")->value($user->name);
- $group->input("full_name")->label(_("Full Name"))->id("gFullName")->value($user->full_name);
- $group->password("password")->label(_("Password"))->id("gPassword");
- $group->input("email")->label(_("Email"))->id("gEmail")->value($user->email);
- $group->submit(_("Save"));
+ $group = $form->group("edit_user")->label(t("Edit User"));
+ $group->input("name")->label(t("Name"))->id("gName")->value($user->name);
+ $group->input("full_name")->label(t("Full Name"))->id("gFullName")->value($user->full_name);
+ $group->password("password")->label(t("Password"))->id("gPassword");
+ $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email);
+ $group->submit(t("Save"));
$form->add_rules_from($user);
return $form;
}
public static function get_edit_form_admin($user) {
$form = new Forge("admin/users/edit/$user->id");
- $group = $form->group("edit_user")->label(_("Edit User"));
- $group->input("name")->label(_("Name"))->id("gName")->value($user->name);
+ $group = $form->group("edit_user")->label(t("Edit User"));
+ $group->input("name")->label(t("Name"))->id("gName")->value($user->name);
$group->inputs["name"]->error_messages(
- "in_use", _("There is already a user with that name"));
- $group->input("full_name")->label(_("Full Name"))->id("gFullName")->value($user->full_name);
- $group->password("password")->label(_("Password"))->id("gPassword");
- $group->input("email")->label(_("Email"))->id("gEmail")->value($user->email);
- $group->submit(_("Modify User"));
+ "in_use", t("There is already a user with that name"));
+ $group->input("full_name")->label(t("Full Name"))->id("gFullName")->value($user->full_name);
+ $group->password("password")->label(t("Password"))->id("gPassword");
+ $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email);
+ $group->submit(t("Modify User"));
$form->add_rules_from($user);
return $form;
}
public static function get_add_form_admin() {
$form = new Forge("admin/users/add");
- $group = $form->group("add_user")->label(_("Add User"));
- $group->input("name")->label(_("Name"))->id("gName");
+ $group = $form->group("add_user")->label(t("Add User"));
+ $group->input("name")->label(t("Name"))->id("gName");
$group->inputs["name"]->error_messages(
- "in_use", _("There is already a user with that name"));
- $group->input("full_name")->label(_("Full Name"))->id("gFullName");
- $group->password("password")->label(_("Password"))->id("gPassword");
- $group->input("email")->label(_("Email"))->id("gEmail");
- $group->submit(_("Add User"));
+ "in_use", t("There is already a user with that name"));
+ $group->input("full_name")->label(t("Full Name"))->id("gFullName");
+ $group->password("password")->label(t("Password"))->id("gPassword");
+ $group->input("email")->label(t("Email"))->id("gEmail");
+ $group->submit(t("Add User"));
$user = ORM::factory("user");
$form->add_rules_from($user);
return $form;
@@ -68,8 +68,8 @@ class user_Core {
public static function get_delete_form_admin($user) {
$form = new Forge("admin/users/delete/$user->id", "", "post");
$group = $form->group("delete_user")->label(
- sprintf(_("Are you sure you want to delete user %s?"), $user->name));
- $group->submit(sprintf(_("Delete user %s"), $user->name));
+ t("Are you sure you want to delete user {{name}}?", array("name" => $user->name)));
+ $group->submit(t("Delete user {{name}}", array("name" => $user->name)));
return $form;
}
diff --git a/modules/user/helpers/user_menu.php b/modules/user/helpers/user_menu.php
index 713e47bb..bdbe411b 100644
--- a/modules/user/helpers/user_menu.php
+++ b/modules/user/helpers/user_menu.php
@@ -22,15 +22,15 @@ class user_menu_Core {
$menu->get("users_groups_menu")
->append(Menu::factory("link")
->id("list_users")
- ->label(_("Users"))
+ ->label(t("Users"))
->url(url::site("admin/users")))
->append(Menu::factory("link")
->id("list_groups")
- ->label(_("Groups"))
+ ->label(t("Groups"))
->url(url::site("admin/groups")))
->append(Menu::factory("link")
->id("users_groups")
- ->label(_("Users <-> Groups"))
+ ->label(t("Users <-> Groups"))
->url("#"));
}
}
diff --git a/modules/user/views/admin_groups.html.php b/modules/user/views/admin_groups.html.php
index 5b5066dc..9547e121 100644
--- a/modules/user/views/admin_groups.html.php
+++ b/modules/user/views/admin_groups.html.php
@@ -1,24 +1,24 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div class="gBlock">
- <h2><?= _("Group Administration") ?></h2>
+ <h2><?= t("Group Administration") ?></h2>
<div class="gBlockContent">
- <p><?= _("These are the groups in your system") ?></p>
+ <p><?= t("These are the groups in your system") ?></p>
</div>
<ul>
<? foreach ($groups as $i => $group): ?>
<li>
<?= $group->name ?>
<a href="groups/edit_form/<?= $group->id ?>" class="gDialogLink"
- title="<?= _("Edit group") ?>"><?= _("edit") ?></a>
+ title="<?= t("Edit group") ?>"><?= t("edit") ?></a>
<? if (!$group->special): ?>
<a href="groups/delete_form/<?= $group->id ?>" class="gDialogLink"
- title="<?= sprintf(_("Do you really want to delete %s"), $group->name) ?>">
- <?= _("delete") ?></a>
+ title="<?= t("Do you really want to delete {{group_name}}", array("group_name" => $group->name)) ?>">
+ <?= t("delete") ?></a>
<? endif ?>
</li>
<? endforeach ?>
<li><a href="groups/add_form" class="gDialogLink"
- title="<?= _("Add group") ?>"><?= _("Add group") ?></a></li>
+ title="<?= t("Add group") ?>"><?= t("Add group") ?></a></li>
</ul>
</div>
diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php
index c31588d9..3d1c311f 100644
--- a/modules/user/views/admin_users.html.php
+++ b/modules/user/views/admin_users.html.php
@@ -1,22 +1,22 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div class="gBlock">
- <h2><?= _("User Administration") ?></h2>
+ <h2><?= t("User Administration") ?></h2>
<div class="gBlockContent">
- <p><?= _("These are the users in your system") ?></p>
+ <p><?= t("These are the users in your system") ?></p>
<ul>
<? foreach ($users as $i => $user): ?>
<li>
<?= $user->name ?>
<?= ($user->last_login == 0) ? "" : "(" . date("M j, Y", $user->last_login) . ")" ?>
- <a href="users/edit_form/<?= $user->id ?>" class="gDialogLink"><?= _("edit") ?></a>
+ <a href="users/edit_form/<?= $user->id ?>" class="gDialogLink"><?= t("edit") ?></a>
<? if (!(user::active()->id == $user->id || user::guest()->id == $user->id)): ?>
<a href="users/delete_form/<?= $user->id ?>" class="gDialogLink">
- <?= _("delete") ?></a>
+ <?= t("delete") ?></a>
<? endif ?>
</li>
<? endforeach ?>
- <li><a href="users/add_form" class="gDialogLink" title="<?= _("Add user") ?>">
- <?= _("Add user") ?></a></li>
+ <li><a href="users/add_form" class="gDialogLink" title="<?= t("Add user") ?>">
+ <?= t("Add user") ?></a></li>
</ul>
</div>
</div>
diff --git a/modules/user/views/login.html.php b/modules/user/views/login.html.php
index b73bea07..fd9bd773 100644
--- a/modules/user/views/login.html.php
+++ b/modules/user/views/login.html.php
@@ -2,13 +2,13 @@
<ul id="gLoginMenu">
<? if ($user->guest): ?>
<li class="first"><a href="<?= url::site("login") ?>"
- title="<?= _("Login to Gallery") ?>"
- id="gLoginLink"><?= _("Login") ?></a></li>
+ title="<?= t("Login to Gallery") ?>"
+ id="gLoginLink"><?= t("Login") ?></a></li>
<? else: ?>
<li class="first"><a href="<?= url::site("form/edit/users/{$user->id}") ?>"
- title="<?= _("Edit Your Profile") ?>"
- id="gUserProfileLink" class="gDialogLink"><?= _("Modify Profile") ?></a></li>
+ title="<?= t("Edit Your Profile") ?>"
+ id="gUserProfileLink" class="gDialogLink"><?= t("Modify Profile") ?></a></li>
<li><a href="<?= url::site("logout?continue=" . url::current(true)) ?>"
- id="gLogoutLink"><?= _("Logout") ?></a></li>
+ id="gLogoutLink"><?= t("Logout") ?></a></li>
<? endif; ?>
</ul>
diff --git a/modules/watermark/controllers/admin_watermarks.php b/modules/watermark/controllers/admin_watermarks.php
index 6d552dae..54ee71b5 100644
--- a/modules/watermark/controllers/admin_watermarks.php
+++ b/modules/watermark/controllers/admin_watermarks.php
@@ -44,8 +44,8 @@ class Admin_Watermarks_Controller extends Admin_Controller {
module::set_var("watermark", "transparency", $form->edit_watermark->transparency->value);
$this->_update_graphics_rules();
- log::success("watermark", _("Watermark changed"));
- message::success(_("Watermark changed"));
+ log::success("watermark", t("Watermark changed"));
+ message::success(t("Watermark changed"));
print json_encode(
array("result" => "success",
"location" => url::site("admin/watermarks")));
@@ -73,8 +73,8 @@ class Admin_Watermarks_Controller extends Admin_Controller {
module::clear_var("watermark", "position");
$this->_update_graphics_rules();
- log::success("watermark", _("Watermark deleted"));
- message::success(_("Watermark deleted"));
+ log::success("watermark", t("Watermark deleted"));
+ message::success(t("Watermark deleted"));
}
print json_encode(
array("result" => "success",
@@ -100,7 +100,7 @@ class Admin_Watermarks_Controller extends Admin_Controller {
if (!($image_info = getimagesize($file)) ||
!in_array($image_info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG))) {
- message::error(_("Unable to identify this image file"));
+ message::error(t("Unable to identify this image file"));
@unlink($file);
return;
}
@@ -115,8 +115,8 @@ class Admin_Watermarks_Controller extends Admin_Controller {
$this->_update_graphics_rules();
@unlink($file);
- message::success(_("Watermark saved"));
- log::success("watermark", _("Watermark saved"));
+ message::success(t("Watermark saved"));
+ log::success("watermark", t("Watermark saved"));
print json_encode(
array("result" => "success",
"location" => url::site("admin/watermarks")));
diff --git a/modules/watermark/helpers/watermark.php b/modules/watermark/helpers/watermark.php
index 9474d4c7..649c041c 100644
--- a/modules/watermark/helpers/watermark.php
+++ b/modules/watermark/helpers/watermark.php
@@ -24,15 +24,15 @@ class watermark_Core {
}
$form = new Forge("admin/watermarks/add", "", "post");
- $group = $form->group("add_watermark")->label(_("Upload Watermark"));
- $group->upload("file")->label(_("Watermark"))->rules("allow[jpg,png,gif]|size[1MB]|required");
- $group->dropdown("position")->label(_("Watermark Position"))
+ $group = $form->group("add_watermark")->label(t("Upload Watermark"));
+ $group->upload("file")->label(t("Watermark"))->rules("allow[jpg,png,gif]|size[1MB]|required");
+ $group->dropdown("position")->label(t("Watermark Position"))
->options(self::positions())
->selected("southeast");
- $group->dropdown("transparency")->label(_("Transparency Percent"))
+ $group->dropdown("transparency")->label(t("Transparency Percent"))
->options($range)
->selected(100);
- $group->submit(_("Upload"));
+ $group->submit(t("Upload"));
return $form;
}
@@ -42,34 +42,34 @@ class watermark_Core {
}
$form = new Forge("admin/watermarks/edit", "", "post");
- $group = $form->group("edit_watermark")->label(_("Edit Watermark"));
- $group->dropdown("position")->label(_("Watermark Position"))
+ $group = $form->group("edit_watermark")->label(t("Edit Watermark"));
+ $group->dropdown("position")->label(t("Watermark Position"))
->options(self::positions())
->selected(module::get_var("watermark", "position"));
- $group->dropdown("transparency")->label(_("Transparency Percent"))
+ $group->dropdown("transparency")->label(t("Transparency Percent"))
->options($range)
->selected(module::get_var("watermark", "transparency"));
- $group->submit(_("Save"));
+ $group->submit(t("Save"));
return $form;
}
public static function get_delete_form() {
$form = new Forge("admin/watermarks/delete", "", "post");
- $group = $form->group("delete_watermark")->label(_("Really delete Watermark?"));
- $group->submit(_("Delete"));
+ $group = $form->group("delete_watermark")->label(t("Really delete Watermark?"));
+ $group->submit(t("Delete"));
return $form;
}
public static function positions() {
- return array("northwest" => _("Northwest"),
- "north" => _("North"),
- "northeast" => _("Northeast"),
- "west" => _("West"),
- "center" => _("Center"),
- "east" => _("East"),
- "southwest" => _("Southwest"),
- "south" => _("South"),
- "southeast" => _("Southeast"));
+ return array("northwest" => t("Northwest"),
+ "north" => t("North"),
+ "northeast" => t("Northeast"),
+ "west" => t("West"),
+ "center" => t("Center"),
+ "east" => t("East"),
+ "southwest" => t("Southwest"),
+ "south" => t("South"),
+ "southeast" => t("Southeast"));
}
public static function position($key) {
diff --git a/modules/watermark/helpers/watermark_menu.php b/modules/watermark/helpers/watermark_menu.php
index 06960513..f8a6d3b1 100644
--- a/modules/watermark/helpers/watermark_menu.php
+++ b/modules/watermark/helpers/watermark_menu.php
@@ -23,7 +23,7 @@ class watermark_menu_Core {
->append(
Menu::factory("link")
->id("watermarks")
- ->label(_("Watermarks"))
+ ->label(t("Watermarks"))
->url(url::site("admin/watermarks")));
}
}
diff --git a/modules/watermark/views/admin_watermarks.html.php b/modules/watermark/views/admin_watermarks.html.php
index a41d4d3e..106d05ce 100644
--- a/modules/watermark/views/admin_watermarks.html.php
+++ b/modules/watermark/views/admin_watermarks.html.php
@@ -1,36 +1,36 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="#gWatermarks">
- <h1> <?= _("Watermarks") ?> </h1>
+ <h1> <?= t("Watermarks") ?> </h1>
<p>
- <?= _("You can have one watermark for your Gallery. This watermark will be applied to all thumbnails and resized images, but it will not be applied to your full size images. To make sure that your guests can only see watermarked images, you should restrict access to your full size images.") ?>
+ <?= t("You can have one watermark for your Gallery. This watermark will be applied to all thumbnails and resized images, but it will not be applied to your full size images. To make sure that your guests can only see watermarked images, you should restrict access to your full size images.") ?>
</p>
<? if (empty($name)): ?>
<a href="<?= url::site("admin/watermarks/form_add") ?>"
- title="<?= _("Upload a watermark") ?>"
- class="gDialogLink"><?= _("Upload a watermark") ?></a>
+ title="<?= t("Upload a watermark") ?>"
+ class="gDialogLink"><?= t("Upload a watermark") ?></a>
<? else: ?>
- <h2> <?= _("Active Watermark") ?> </h2>
+ <h2> <?= t("Active Watermark") ?> </h2>
<p>
- <?= _("Note that changing this watermark will require you to rebuild all of your thumbnails and resized images.") ?>
+ <?= t("Note that changing this watermark will require you to rebuild all of your thumbnails and resized images.") ?>
</p>
<div>
<div class="image">
<img width="<?= $width ?>" height="<?= $height ?>" src="<?= $url ?>"/>
<p>
- <?= sprintf(_("Position: %s"), watermark::position($position)) ?>
+ <?= t("Position: {{position}}", array("position" => watermark::position($position))) ?>
</p>
<p>
- <?= sprintf(_("Transparency: %s%%"), module::get_var("watermark", "transparency")) ?>
+ <?= t("Transparency: {{transparency}}%", array("transparency" => module::get_var("watermark", "transparency"))) ?>
</p>
</div>
<div class="controls">
<a href="<?= url::site("admin/watermarks/form_edit") ?>"
- title="<?= _("Edit Watermark") ?>"
- class="gDialogLink"><?= _("edit") ?></a>
+ title="<?= t("Edit Watermark") ?>"
+ class="gDialogLink"><?= t("edit") ?></a>
<a href="<?= url::site("admin/watermarks/form_delete") ?>"
- title="<?= _("Delete Watermark") ?>"
- class="gDialogLink"><?= _("delete") ?></a>
+ title="<?= t("Delete Watermark") ?>"
+ class="gDialogLink"><?= t("delete") ?></a>
</div>
</div>
<? endif ?>
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 ?>" />