From e4a9b19bf9997f46203fbc18c696c63703a72625 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Thu, 15 Jan 2009 10:02:41 +0000 Subject: Changing t() placeholder syntax from {{replace_me}} to %replace_me. --- core/controllers/admin_dashboard.php | 6 +++--- core/controllers/admin_graphics.php | 2 +- core/controllers/admin_maintenance.php | 14 +++++++------- core/controllers/admin_modules.php | 4 ++-- core/controllers/admin_themes.php | 6 +++--- core/controllers/albums.php | 6 +++--- core/controllers/photos.php | 2 +- core/helpers/album.php | 2 +- core/helpers/core_installer.php | 2 +- core/helpers/graphics.php | 8 ++++---- core/helpers/module.php | 4 ++-- core/helpers/photo.php | 2 +- core/libraries/I18n.php | 8 ++++++-- core/tests/I18n_Test.php | 16 ++++++++-------- core/views/admin_block_platform.html.php | 8 ++++---- core/views/admin_block_stats.html.php | 6 +++--- core/views/admin_block_welcome.html.php | 6 +++--- core/views/admin_graphics_gd.html.php | 6 +++--- core/views/admin_graphics_graphicsmagick.html.php | 4 ++-- core/views/admin_graphics_imagemagick.html.php | 4 ++-- core/views/admin_maintenance.html.php | 2 +- core/views/admin_themes.html.php | 4 ++-- core/views/admin_themes_preview.html.php | 2 +- modules/akismet/helpers/akismet.php | 2 +- modules/comment/controllers/admin_comments.php | 16 ++++++++-------- .../comment/views/admin_block_recent_comments.html.php | 2 +- modules/comment/views/admin_comments.html.php | 6 +++--- modules/comment/views/comments.html.php | 2 +- modules/info/helpers/info_block.php | 4 ++-- modules/media_rss/controllers/media_rss.php | 2 +- modules/tag/controllers/admin_tags.php | 6 +++--- modules/tag/helpers/tag.php | 2 +- modules/tag/views/admin_tags.html.php | 4 ++-- modules/user/controllers/admin_groups.php | 8 ++++---- modules/user/controllers/admin_users.php | 8 ++++---- modules/user/controllers/login.php | 4 ++-- modules/user/controllers/logout.php | 2 +- modules/user/helpers/group.php | 2 +- modules/user/helpers/user.php | 4 ++-- modules/user/views/admin_groups.html.php | 2 +- modules/watermark/views/admin_watermarks.html.php | 4 ++-- themes/admin_default/views/pager.html.php | 2 +- themes/default/views/pager.html.php | 2 +- themes/default/views/photo.html.php | 2 +- 44 files changed, 107 insertions(+), 103 deletions(-) diff --git a/core/controllers/admin_dashboard.php b/core/controllers/admin_dashboard.php index 43b61868..15701417 100644 --- a/core/controllers/admin_dashboard.php +++ b/core/controllers/admin_dashboard.php @@ -42,12 +42,12 @@ class Admin_Dashboard_Controller extends Admin_Controller { if ($form->add_block->center->value) { dashboard::add_block("main", $module_name, $block_id); message::success( - t("Added {{title}} block to the main dashboard area", + t("Added %title block to the main dashboard area", array("title" => $available["$module_name:$id"]))); } else { dashboard::add_block("sidebar", $module_name, $block_id); message::success( - t("Added {{title}} to the dashboard sidebar", + t("Added %title to the dashboard sidebar", array("title" => $available["$module_name:$id"]))); } } @@ -68,7 +68,7 @@ class Admin_Dashboard_Controller extends Admin_Controller { if (!empty($deleted)) { $available = dashboard::get_available(); $title = $available[join(":", $deleted)]; - message::success(t("Removed {{title}} block", array("title" => $title))); + message::success(t("Removed %title block", array("title" => $title))); } url::redirect("admin"); diff --git a/core/controllers/admin_graphics.php b/core/controllers/admin_graphics.php index 69a83575..fe71a222 100644 --- a/core/controllers/admin_graphics.php +++ b/core/controllers/admin_graphics.php @@ -50,7 +50,7 @@ class Admin_Graphics_Controller extends Admin_Controller { site_status::clear("missing_graphics_toolkit"); message::success(t("Updated Graphics Toolkit")); - log::success("graphics", t("Changed graphics toolkit to: {{toolkit}}", + log::success("graphics", t("Changed graphics toolkit to: %toolkit", array("toolkit" => $toolkit))); } diff --git a/core/controllers/admin_maintenance.php b/core/controllers/admin_maintenance.php index 1c9b4164..6b344243 100644 --- a/core/controllers/admin_maintenance.php +++ b/core/controllers/admin_maintenance.php @@ -31,7 +31,7 @@ class Admin_Maintenance_Controller extends Admin_Controller { "description" => ( $dirty_count ? t2("You have one image which is out of date", - "You have {{count}} out-of-date images", + "You have %count out-of-date images", $dirty_count) : t("All your images are up to date")), "severity" => $dirty_count ? log::WARNING : log::SUCCESS), @@ -51,9 +51,9 @@ class Admin_Maintenance_Controller extends Admin_Controller { if ($stalled_count) { log::warning("tasks", t2("One task is stalled", - "{{count}} tasks are stalled", + "%count tasks are stalled", $stalled_count), - t("{{link_start}}view{{link_end}}", + t("%link_startview%link_end", array("link_start" => "", "link_start" => ""))); } @@ -89,7 +89,7 @@ class Admin_Maintenance_Controller extends Admin_Controller { $view->csrf = access::csrf_token(); $view->task = $task; - log::info("tasks", t("Task {{task_name}} started (task id {{task_id}})", + 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; @@ -110,7 +110,7 @@ class Admin_Maintenance_Controller extends Admin_Controller { $view->csrf = access::csrf_token(); $view->task = $task; - log::info("tasks", t("Task {{task_name}} resumed (task id {{task_id}})", + 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; @@ -171,14 +171,14 @@ class Admin_Maintenance_Controller extends Admin_Controller { if ($task->done) { switch ($task->state) { case "success": - log::success("tasks", t("Task {{task_name}} completed (task id {{task_id}})", + 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", t("Task {{task_name}} failed (task id {{task_id}})", + 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")); diff --git a/core/controllers/admin_modules.php b/core/controllers/admin_modules.php index e345f8c6..2cd56c85 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(t("Uninstalled {{module_name}} module", array("module_name" => $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(t("Installed {{module_name}} module", array("module_name" => $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 b2e0b0e2..194b9d17 100644 --- a/core/controllers/admin_themes.php +++ b/core/controllers/admin_themes.php @@ -63,11 +63,11 @@ class Admin_Themes_Controller extends Admin_Controller { if ($type == "admin" && $info->admin) { module::set_var("core", "active_admin_theme", $theme_name); - message::success(t("Successfully changed your admin theme to {{theme_name}}", + message::success(t("Successfully changed your admin theme to %theme_name", array("theme_name" => $info->name))); } else if ($type == "site" && $info->site) { module::set_var("core", "active_site_theme", $theme_name); - message::success(t("Successfully changed your Gallery theme to {{theme_name}}", + message::success(t("Successfully changed your Gallery theme to %theme_name", array("theme_name" => $info->name))); } @@ -109,7 +109,7 @@ class Admin_Themes_Controller extends Admin_Controller { if ($theme != module::get_var("core", "active_theme")) { module::set_var("core", "active_theme", $theme); message::success(t("Updated Theme")); - log::success("graphics", t("Changed theme to {{theme_name}}", array("theme_name" => $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 0150314c..39946e60 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(t("Created album {{album_title}}", array("album_title" => $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(t("Added photo {{photo_title}}", array("photo_title" => $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("item_updated", $orig, $album); log::success("content", "Updated album", "id\">view"); - message::success(t("Saved album {{album_title}}", array("album_title" => $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 ae1c6a3b..829f391f 100644 --- a/core/controllers/photos.php +++ b/core/controllers/photos.php @@ -81,7 +81,7 @@ class Photos_Controller extends Items_Controller { module::event("item_updated", $orig, $photo); log::success("content", "Updated photo", "id\">view"); - message::success(t("Saved photo {{photo_title}}", array("photo_title" => $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 e1875b3a..223a057d 100644 --- a/core/helpers/album.php +++ b/core/helpers/album.php @@ -65,7 +65,7 @@ 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(t("Add Album to {{album_title}}", array("album_title" => $parent->title))); + $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")); diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php index 3ee67358..b8f50561 100644 --- a/core/helpers/core_installer.php +++ b/core/helpers/core_installer.php @@ -219,7 +219,7 @@ class core_installer { } if (!module::get_var("core", "graphics_toolkit")) { site_status::warning( - t("Graphics toolkit missing! Please {{link_start}}choose a toolkit{{link_start}}.", + t("Graphics toolkit missing! Please %link_startchoose a toolkit%link_start.", array("link_start" => "", "link_end" => "")), "missing_graphics_toolkit"); } diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index 7b13c55d..2edfb5f8 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -217,8 +217,8 @@ class graphics_Core { $count = self::find_dirty_images_query()->count(); if ($count) { site_status::warning( - t2("One of your photos is out of date. {{link_start}}Click here to fix it{{link_end}}", - "{{count}} of your photos are out of date. {{link_start}}Click here to fix them{{link_end}}", + t2("One of your photos is out of date. %link_startClick here to fix it%link_end", + "%count of your photos are out of date. %link_startClick here to fix them%link_end", $count, array("link_start" => "status = t2("Updated: 1 image. Total: {{total_count}}.", - "Updated: {{count}} images. Total: {{total_count}}.", + $task->status = t2("Updated: 1 image. Total: %total_count.", + "Updated: %count images. Total: %total_count.", $completed, array("total_count" => ($remaining + $completed))); diff --git a/core/helpers/module.php b/core/helpers/module.php index bded9dc6..b45f6c78 100644 --- a/core/helpers/module.php +++ b/core/helpers/module.php @@ -129,7 +129,7 @@ class module_Core { } self::load_modules(); - log::success("module", t("Installed module {{module_name}}", array("module_name" => $module_name))); + log::success("module", t("Installed module %module_name", array("module_name" => $module_name))); } /** @@ -140,7 +140,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", t("Uninstalled module {{module_name}}", array("module_name" => $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 74ef02e0..a2958aec 100644 --- a/core/helpers/photo.php +++ b/core/helpers/photo.php @@ -97,7 +97,7 @@ 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(t("Add Photo to {{album_title}}", array("album_title" =>$parent->title))); + $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")); diff --git a/core/libraries/I18n.php b/core/libraries/I18n.php index 0aa6652b..04176b75 100644 --- a/core/libraries/I18n.php +++ b/core/libraries/I18n.php @@ -68,7 +68,7 @@ class I18n_Core { /** * Translates a localizable message. * @param $message String|array The message to be translated. E.g. "Hello world" - * or array("one" => "One album", "other" => "{{count}} albums") + * or array("one" => "One album", "other" => "%count albums") * @param $options array (optional) Options array for key value pairs which are used * for pluralization and interpolation. Special keys are "count" and "locale", * the latter to override the currently configured locale. @@ -118,9 +118,13 @@ class I18n_Core { private function interpolate($locale, $string, $values) { // TODO: Handle locale specific number formatting. + + // Replace x_y before replacing x. + krsort($values, SORT_STRING); + $keys = array(); foreach (array_keys($values) as $key) { - $keys[] = "{{" . $key . "}}"; + $keys[] = "%$key"; } return str_replace($keys, array_values($values), $string); } diff --git a/core/tests/I18n_Test.php b/core/tests/I18n_Test.php index f99dd9c1..e621c0e3 100644 --- a/core/tests/I18n_Test.php +++ b/core/tests/I18n_Test.php @@ -34,10 +34,10 @@ class I18n_Test extends Unit_Test_Case { $messages_de_DE = array( array('Hello world', 'Hallo Welt'), array(array('one' => 'One item has been added', - 'other' => '{{count}} elements have been added'), + 'other' => '%count elements have been added'), array('one' => 'Ein Element wurde hinzugefuegt.', - 'other' => '{{count}} Elemente wurden hinzugefuegt.')), - array('Hello {{name}}, how are you today?', 'Hallo {{name}}, wie geht es Dir heute?')); + 'other' => '%count Elemente wurden hinzugefuegt.')), + array('Hello %name, how are you today?', 'Hallo %name, wie geht es Dir heute?')); foreach ($messages_de_DE as $data) { list ($message, $translation) = $data; @@ -65,25 +65,25 @@ class I18n_Test extends Unit_Test_Case { public function translate_plural_other_test() { $result = $this->i18n->translate(array('one' => 'One item has been added', - 'other' => '{{count}} items have been added.'), + 'other' => '%count items have been added.'), array('count' => 5)); $this->assert_equal('5 Elemente wurden hinzugefuegt.', $result); } public function translate_plural_one_test() { $result = $this->i18n->translate(array('one' => 'One item has been added', - 'other' => '{{count}} items have been added.'), + 'other' => '%count items have been added.'), array('count' => 1)); $this->assert_equal('Ein Element wurde hinzugefuegt.', $result); } public function translate_interpolate_test() { - $result = $this->i18n->translate('Hello {{name}}, how are you today?', array('name' => 'John')); + $result = $this->i18n->translate('Hello %name, how are you today?', array('name' => 'John')); $this->assert_equal('Hallo John, wie geht es Dir heute?', $result); } public function translate_interpolate_missing_value_test() { - $result = $this->i18n->translate('Hello {{name}}, how are you today?', array('foo' => 'bar')); - $this->assert_equal('Hallo {{name}}, wie geht es Dir heute?', $result); + $result = $this->i18n->translate('Hello %name, how are you today?', array('foo' => 'bar')); + $this->assert_equal('Hallo %name, wie geht es Dir heute?', $result); } } \ No newline at end of file diff --git a/core/views/admin_block_platform.html.php b/core/views/admin_block_platform.html.php index 2f13d5d9..09fc0515 100644 --- a/core/views/admin_block_platform.html.php +++ b/core/views/admin_block_platform.html.php @@ -1,15 +1,15 @@ diff --git a/core/views/admin_block_stats.html.php b/core/views/admin_block_stats.html.php index 42f34aa4..2d975073 100644 --- a/core/views/admin_block_stats.html.php +++ b/core/views/admin_block_stats.html.php @@ -1,12 +1,12 @@ diff --git a/core/views/admin_block_welcome.html.php b/core/views/admin_block_welcome.html.php index 35501ffc..89914fb3 100644 --- a/core/views/admin_block_welcome.html.php +++ b/core/views/admin_block_welcome.html.php @@ -4,15 +4,15 @@

diff --git a/core/views/admin_graphics_gd.html.php b/core/views/admin_graphics_gd.html.php index b238401f..8c645f4f 100644 --- a/core/views/admin_graphics_gd.html.php +++ b/core/views/admin_graphics_gd.html.php @@ -3,16 +3,16 @@ " alt="" />

- GD website for more information.", + GD website for more information.", array("url" => "http://www.boutell.com/gd")) ?>

gd["GD Version"] && function_exists('imagerotate')): ?>

- $tk->gd["GD Version"])) ?> + $tk->gd["GD Version"])) ?>

gd["GD Version"]): ?>

- $tk->gd["GD Version"])) ?>

diff --git a/core/views/admin_graphics_graphicsmagick.html.php b/core/views/admin_graphics_graphicsmagick.html.php index 8dc1d714..bb4f906d 100644 --- a/core/views/admin_graphics_graphicsmagick.html.php +++ b/core/views/admin_graphics_graphicsmagick.html.php @@ -3,12 +3,12 @@

" alt="" />

- GraphicsMagick website for more information.", + GraphicsMagick website for more information.", array("url" => "http://www.graphicsmagick.org")) ?>

graphicsmagick): ?>

- $tk->graphicsmagick)) ?> + $tk->graphicsmagick)) ?>

diff --git a/core/views/admin_graphics_imagemagick.html.php b/core/views/admin_graphics_imagemagick.html.php index 02a18ac8..7898a8d1 100644 --- a/core/views/admin_graphics_imagemagick.html.php +++ b/core/views/admin_graphics_imagemagick.html.php @@ -3,12 +3,12 @@

" alt="" />

- ImageMagick website for more information.", + ImageMagick website for more information.", array("url" => "http://www.imagemagick.org")) ?>

imagemagick): ?>

- $tk->imagemagick)) ?> + $tk->imagemagick)) ?>

diff --git a/core/views/admin_maintenance.html.php b/core/views/admin_maintenance.html.php index 1da87788..fd5f7a58 100644 --- a/core/views/admin_maintenance.html.php +++ b/core/views/admin_maintenance.html.php @@ -75,7 +75,7 @@ state == "stalled"): ?> - $task->percent_complete)) ?> + $task->percent_complete)) ?> diff --git a/core/views/admin_themes.html.php b/core/views/admin_themes.html.php index b0b4215d..43328b3a 100644 --- a/core/views/admin_themes.html.php +++ b/core/views/admin_themes.html.php @@ -31,7 +31,7 @@ site) continue ?>

- " class="gDialogLink" title=" $info->name)) ?>"> + " class="gDialogLink" title=" $info->name)) ?>"> " alt="name ?>" />

name ?>

@@ -69,7 +69,7 @@ admin) continue ?>
- " class="gDialogLink" title=" $info->name)) ?>"> + " class="gDialogLink" title=" $info->name)) ?>"> " alt="name ?>" />

name ?>

diff --git a/core/views/admin_themes_preview.html.php b/core/views/admin_themes_preview.html.php index acd1ba3c..d4fa617d 100644 --- a/core/views/admin_themes_preview.html.php +++ b/core/views/admin_themes_preview.html.php @@ -1,7 +1,7 @@

- {{theme_name}}", array("theme_name" => $info->name)) ?> + %theme_name", array("theme_name" => $info->name)) ?>

diff --git a/modules/akismet/helpers/akismet.php b/modules/akismet/helpers/akismet.php index d717268b..d46556de 100644 --- a/modules/akismet/helpers/akismet.php +++ b/modules/akismet/helpers/akismet.php @@ -93,7 +93,7 @@ class akismet_Core { $api_key = module::get_var("akismet", "api_key"); if (empty($api_key)) { site_status::warning( - t("Akismet is not quite ready! Please provide an API Key", + t("Akismet is not quite ready! Please provide an API Key", array("url" => url::site("admin/akismet"))), "akismet_config"); } else { diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php index d1666d41..68ede43d 100644 --- a/modules/comment/controllers/admin_comments.php +++ b/modules/comment/controllers/admin_comments.php @@ -29,26 +29,26 @@ class Admin_Comments_Controller extends Admin_Controller { $view->content->menu = Menu::factory("root") ->append(Menu::factory("link") ->id("unpublished") - ->label(t2("Awaiting Moderation ({{count}})", - "Awaiting Moderation ({{count}})", + ->label(t2("Awaiting Moderation (%count)", + "Awaiting Moderation (%count)", $view->content->unpublished->count())) ->url(url::site("admin/comments/queue/unpublished"))) ->append(Menu::factory("link") ->id("published") - ->label(t2("Approved ({{count}})", - "Approved ({{count}})", + ->label(t2("Approved (%count)", + "Approved (%count)", $view->content->published->count())) ->url(url::site("admin/comments/queue/published"))) ->append(Menu::factory("link") ->id("spam") - ->label(t2("Spam ({{count}})", - "Spam ({{count}})", + ->label(t2("Spam (%count)", + "Spam (%count)", $view->content->spam->count())) ->url(url::site("admin/comments/queue/spam"))) ->append(Menu::factory("link") ->id("deleted") - ->label(t2("Recently Deleted ({{count}})", - "Recently Deleted ({{count}})", + ->label(t2("Recently Deleted (%count)", + "Recently Deleted (%count)", $view->content->deleted->count())) ->url(url::site("admin/comments/queue/deleted"))); return $view; diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index 78e22766..39d39929 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -8,7 +8,7 @@ width="40" height="40" /> created) ?> - {{author_name}} said {{comment_text}}", + %author_name said %comment_text", array("author_name" => $comment->author_name(), "comment_text" => text::limit_words($comment->text, 50))); ?> diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index 83672bc1..c5bbc2b6 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -51,15 +51,15 @@
0): ?>

-

count()): ?> count()) ?>

diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index 111b12bd..ec7530c4 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -11,7 +11,7 @@ width="40" height="40" /> - {{name}} said", + %name said", array("date" => date("Y-M-d H:i:s", $comment->created), "name" => $comment->author_name())); ?>

diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php index 3bc51c73..c832b4f6 100644 --- a/modules/info/helpers/info_block.php +++ b/modules/info/helpers/info_block.php @@ -32,12 +32,12 @@ class info_block_Core { $results = ""; if ($item->view_count) { $results .= "
  • "; - $results .= t("Views: {{view_count}}", array("view_count" => $item->view_count)); + $results .= t("Views: %view_count", array("view_count" => $item->view_count)); $results .= "
  • "; } if ($item->owner) { $results .= "
  • "; - $results .= t("By: {{owner_name}}", array("owner_name" => "{$item->owner->name}")); + $results .= t("By: %owner_name", array("owner_name" => "{$item->owner->name}")); $results .= "
  • "; } return $results; diff --git a/modules/media_rss/controllers/media_rss.php b/modules/media_rss/controllers/media_rss.php index fbc3a29b..1bc34557 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 = t("Photos related to {{tag_name}}", array("tag_name" => $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/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php index b30f5b95..1d800fce 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(t("Deleted tag {{tag_name}}", array("tag_name" => $name))); - log::success("tags", t("Deleted tag {{tag_name}}", array("tag_name" => $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,7 +96,7 @@ class Admin_Tags_Controller extends Admin_Controller { $tag->name = $new_name; $tag->save(); - $message = t("Renamed tag {{old_name}} to {{new_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); diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index 98c904d0..7dec6809 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -97,7 +97,7 @@ class tag_Core { static function get_delete_form($tag) { $form = new Forge("admin/tags/delete/$tag->id", "", "post", array("id" => "gDeleteTagForm")); - $group = $form->group("delete_tag")->label(t("Really delete tag {{tag_name}}?", array("tag_name" => $tag->name))); + $group = $form->group("delete_tag")->label(t("Really delete tag %tag_name?", array("tag_name" => $tag->name))); $group->submit("")->value(t("Delete Tag")); $form->add_rules_from(ORM::factory("tag")); return $form; diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php index 12f724b2..5e9613b1 100644 --- a/modules/tag/views/admin_tags.html.php +++ b/modules/tag/views/admin_tags.html.php @@ -25,13 +25,13 @@
    • id") ?>" class="gDialogLink" - title=" $tag->name)) ?>"> + title=" $tag->name)) ?>">
    • id") ?>" class="gDialogLink" - title=" $tag->name)) ?>"> + title=" $tag->name)) ?>">
    • diff --git a/modules/user/controllers/admin_groups.php b/modules/user/controllers/admin_groups.php index d05558a9..bba104f0 100644 --- a/modules/user/controllers/admin_groups.php +++ b/modules/user/controllers/admin_groups.php @@ -40,7 +40,7 @@ class Admin_Groups_Controller extends Controller { if ($valid) { $group = group::create($new_name); $group->save(); - message::success(t("Created group {{group_name}}", array("group_name" => $group->name))); + message::success(t("Created group %group_name", array("group_name" => $group->name))); print json_encode(array("result" => "success")); } else { message::error(t("Failed to create group")); @@ -69,7 +69,7 @@ class Admin_Groups_Controller extends Controller { "form" => $form->__toString())); } - $message = t("Deleted group {{group_name}}", array("group_name" => $name)); + $message = t("Deleted group %group_name", array("group_name" => $name)); log::success("group", $message); message::success($message); print json_encode(array("result" => "success")); @@ -104,10 +104,10 @@ class Admin_Groups_Controller extends Controller { if ($valid) { $group->name = $form->edit_group->inputs["name"]->value; $group->save(); - message::success(t("Changed group {{group_name}}", array("group_name" => $group->name))); + message::success(t("Changed group %group_name", array("group_name" => $group->name))); print json_encode(array("result" => "success")); } else { - message::error(t("Failed to change group {{group_name}}", array("group_name" => $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 e936cb8a..dff56870 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -41,7 +41,7 @@ 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(t("Created user {{user_name}}", array("user_name" => $user->name))); + message::success(t("Created user %user_name", array("user_name" => $user->name))); print json_encode(array("result" => "success")); } else { message::error(t("Failed to create user")); @@ -70,7 +70,7 @@ class Admin_Users_Controller extends Controller { "form" => $form->__toString())); } - $message = t("Deleted user {{user_name}}", array("user_name" => $name)); + $message = t("Deleted user %user_name", array("user_name" => $name)); log::success("user", $message); message::success($message); print json_encode(array("result" => "success")); @@ -108,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(t("Changed user {{user_name}}", array("user_name" => $user->name))); + message::success(t("Changed user %user_name", array("user_name" => $user->name))); print json_encode(array("result" => "success")); } else { - message::error(t("Failed to change user {{user_name}}", array("user_name" => $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 66ea55e6..c9a32546 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", t("Failed login for {{name}}", array("username" => $form->login->inputs["name"]->value))); + "user", t("Failed login for %name", array("name" => $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", t("User {{name}} logged in", array("name" => $user->name))); + log::info("user", t("User %name logged in", array("name" => $user->name))); print json_encode( array("result" => "success")); } else { diff --git a/modules/user/controllers/logout.php b/modules/user/controllers/logout.php index 06b869be..84b1fdc5 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", t("User {{name}} logged out", array("name" => $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 682ef5ef..b49b6888 100644 --- a/modules/user/helpers/group.php +++ b/modules/user/helpers/group.php @@ -87,7 +87,7 @@ class group_Core { static function get_delete_form_admin($group) { $form = new Forge("admin/groups/delete/$group->id", "", "post"); $form_group = $form->group("delete_group")->label( - t("Are you sure you want to delete group {{group_name}}?", array("group_name" => $group->name))); + t("Are you sure you want to delete group %group_name?", array("group_name" => $group->name))); $form_group->submit("")->value(t("Delete")); return $form; } diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index c1e1abba..0a023159 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -71,8 +71,8 @@ class user_Core { static function get_delete_form_admin($user) { $form = new Forge("admin/users/delete/$user->id", "", "post"); $group = $form->group("delete_user")->label( - t("Are you sure you want to delete user {{name}}?", array("name" => $user->name))); - $group->submit("")->value(t("Delete user {{name}}", array("name" => $user->name))); + t("Are you sure you want to delete user %name?", array("name" => $user->name))); + $group->submit("")->value(t("Delete user %name", array("name" => $user->name))); return $form; } diff --git a/modules/user/views/admin_groups.html.php b/modules/user/views/admin_groups.html.php index 9547e121..a2ad652f 100644 --- a/modules/user/views/admin_groups.html.php +++ b/modules/user/views/admin_groups.html.php @@ -12,7 +12,7 @@ title=""> special): ?> $group->name)) ?>"> + title=" $group->name)) ?>"> diff --git a/modules/watermark/views/admin_watermarks.html.php b/modules/watermark/views/admin_watermarks.html.php index 106d05ce..8210f95e 100644 --- a/modules/watermark/views/admin_watermarks.html.php +++ b/modules/watermark/views/admin_watermarks.html.php @@ -18,10 +18,10 @@

      - watermark::position($position))) ?> + watermark::position($position))) ?>

      - module::get_var("watermark", "transparency"))) ?> + module::get_var("watermark", "transparency"))) ?>

      diff --git a/themes/admin_default/views/pager.html.php b/themes/admin_default/views/pager.html.php index e14cf857..505e8cf0 100644 --- a/themes/admin_default/views/pager.html.php +++ b/themes/admin_default/views/pager.html.php @@ -2,7 +2,7 @@
        $current_first_item, "to_number" => $current_last_item, "total" => $total_items)) ?> diff --git a/themes/default/views/pager.html.php b/themes/default/views/pager.html.php index 892fe21b..dd702086 100644 --- a/themes/default/views/pager.html.php +++ b/themes/default/views/pager.html.php @@ -2,7 +2,7 @@
          $current_first_item, "to_number" => $current_last_item, "total" => $total_items)) ?> diff --git a/themes/default/views/photo.html.php b/themes/default/views/photo.html.php index aa7053dc..8c0f7f5e 100644 --- a/themes/default/views/photo.html.php +++ b/themes/default/views/photo.html.php @@ -3,7 +3,7 @@ photo_top() ?>
            -
          • $position, "total" => $sibling_count)) ?>
          • +
          • $position, "total" => $sibling_count)) ?>
          • -- cgit v1.2.3