diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-01-15 10:02:41 +0000 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-01-15 10:02:41 +0000 |
commit | e4a9b19bf9997f46203fbc18c696c63703a72625 (patch) | |
tree | c33f4cb354961eeba452f428dfa68c664bc3226f | |
parent | e53916dd0622e3db61d6a05ad0fe69e8d7c7f11a (diff) |
Changing t() placeholder syntax from {{replace_me}} to %replace_me.
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 <b>{{title}}</b> block to the main dashboard area", + t("Added <b>%title</b> 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 <b>{{title}}</b> to the dashboard sidebar", + t("Added <b>%title</b> 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 <b>{{title}}</b> block", array("title" => $title))); + message::success(t("Removed <b>%title</b> 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" => "<a href=\"" . url::site("admin/maintenance") . "\">", "link_start" => "</a>"))); } @@ -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 <b>{{theme_name}}</b>", + message::success(t("Successfully changed your admin theme to <b>%theme_name</b>", 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 <b>{{theme_name}}</b>", + message::success(t("Successfully changed your Gallery theme to <b>%theme_name</b>", 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", "<a href=\"albums/$album->id\">view</a>"); - 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", "<a href=\"photos/$photo->id\">view</a>"); - 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" => "<a href=\"" . url::site("admin/graphics") . "\">", "link_end" => "</a>")), "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" => "<a href=\"" . url::site("admin/maintenance/start/graphics::rebuild_dirty_images?csrf=__CSRF__") . @@ -254,8 +254,8 @@ class graphics_Core { } } - $task->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 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <ul> <li> - <?= t("Operating System: {{operating_system}}", array("operating_system" => PHP_OS)) ?> + <?= t("Operating System: %operating_system", array("operating_system" => PHP_OS)) ?> </li> <li> - <?= t("Apache: {{apache_version}}", array("apache_version" => function_exists("apache_get_version") ? apache_get_version() : t("Unknown"))) ?> + <?= t("Apache: %apache_version", array("apache_version" => function_exists("apache_get_version") ? apache_get_version() : t("Unknown"))) ?> </li> <li> - <?= t("PHP: {{php_version}}", array("php_version" => phpversion())) ?> + <?= t("PHP: %php_version", array("php_version" => phpversion())) ?> </li> <li> - <?= t("MySQL: {{mysql_version}}", array("mysql_version" => 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 42f34aa4..2d975073 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> - <?= t("Version: {{version}}", array("version" => module::get_var("core", "version"))) ?> + <?= t("Version: %version", array("version" => module::get_var("core", "version"))) ?> </li> <li> - <?= t("Albums: {{count}}", array("count" => $album_count)) ?> + <?= t("Albums: %count", array("count" => $album_count)) ?> </li> <li> - <?= t("Photos: {{count}}", array("count" => $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 35501ffc..89914fb3 100644 --- a/core/views/admin_block_welcome.html.php +++ b/core/views/admin_block_welcome.html.php @@ -4,15 +4,15 @@ </p> <ul> <li> - <?= t("{{link_start}}General Settings{{link_end}} - General configuation options for your Gallery.", + <?= t("%link_startGeneral Settings%link_end - General configuation options for your Gallery.", array("link_start" => "<a href=\"#\">", "link_end" => "</a>")) ?> </li> <li> - <?= t("{{link_start}}Modules{{link_end}} - Manage available and installed modules.", + <?= t("%link_startModules%link_end - Manage available and installed modules.", array("link_start" => "<a href=\"" . url::site("admin/modules") . "\">", "link_end" => "</a>")) ?> </li> <li> - <?= t("{{link_start}}Presentation{{link_end}} - Choose a theme, set image sizes.", + <?= t("%link_startPresentation%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_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 @@ <img class="logo" width="170" height="110" src="<?= url::file("core/images/gd.png"); ?>" alt="<? t("Visit the GD lib project site") ?>" /> <h3> <?= t("GD") ?> </h3> <p> - <?= t("The GD graphics library is an extension to PHP commonly installed most webservers. Please refer to the <a href=\"{{url}}\">GD website</a> for more information.", + <?= t("The GD graphics library is an extension to PHP commonly installed most webservers. Please refer to the <a href=\"%url\">GD website</a> for more information.", array("url" => "http://www.boutell.com/gd")) ?> </p> <? if ($tk->gd["GD Version"] && function_exists('imagerotate')): ?> <p class="gSuccess"> - <?= t("You have GD version {{version}}.", array("version" => $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"> - <?= t("You have GD version {{version}}, but it lacks image rotation.", + <?= t("You have GD version %version, but it lacks image rotation.", array("version" => $tk->gd["GD Version"])) ?> </p> <? else: ?> 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 @@ <h3> <?= t("GraphicsMagick") ?> </h3> <img class="logo" width="107" height="76" src="<?= url::file("core/images/graphicsmagick.png"); ?>" alt="<? t("Visit the GraphicsMagick project site") ?>" /> <p> - <?= t("GraphicsMagick is a standalone graphics program available on most Linux systems. Please refer to the <a href=\"{{url}}\">GraphicsMagick website</a> for more information.", + <?= t("GraphicsMagick is a standalone graphics program available on most Linux systems. Please refer to the <a href=\"%url\">GraphicsMagick website</a> for more information.", array("url" => "http://www.graphicsmagick.org")) ?> </p> <? if ($tk->graphicsmagick): ?> <p class="gSuccess"> - <?= t("GraphicsMagick is available in {{path}}", array("path" => $tk->graphicsmagick)) ?> + <?= t("GraphicsMagick is available in %path", array("path" => $tk->graphicsmagick)) ?> </p> <? else: ?> <p class="gInfo"> 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 @@ <h3> <?= t("ImageMagick") ?> </h3> <img class="logo" width="114" height="118" src="<?= url::file("core/images/imagemagick.jpg"); ?>" alt="<? t("Visit the ImageMagick project site") ?>" /> <p> - <?= t("ImageMagick is a standalone graphics program available on most Linux systems. Please refer to the <a href=\"{{url}}\">ImageMagick website</a> for more information.", + <?= t("ImageMagick is a standalone graphics program available on most Linux systems. Please refer to the <a href=\"%url\">ImageMagick website</a> for more information.", array("url" => "http://www.imagemagick.org")) ?> </p> <? if ($tk->imagemagick): ?> <p class="gSuccess"> - <?= t("ImageMagick is available in {{path}}", array("path" => $tk->imagemagick)) ?> + <?= t("ImageMagick is available in %path", array("path" => $tk->imagemagick)) ?> </p> <? else: ?> <p class="gInfo"> 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 @@ <? elseif ($task->state == "stalled"): ?> <?= t("Stalled") ?> <? else: ?> - <?= t("{{percent_complete}}% Complete", array("percent_complete" => $task->percent_complete)) ?> + <?= t("%percent_complete% Complete", array("percent_complete" => $task->percent_complete)) ?> <? endif ?> </td> <td> 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 @@ <? if (!$info->site) continue ?> <? if ($id == $site) continue ?> <div class="gBlock"> - <a href="<?= url::site("admin/themes/preview/site/$id") ?>" class="gDialogLink" title="<?= t("Theme Preview: {{theme_name}}", array("theme_name" => $info->name)) ?>"> + <a href="<?= url::site("admin/themes/preview/site/$id") ?>" class="gDialogLink" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name)) ?>"> <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>" alt="<?= $info->name ?>" /> <h3> <?= $info->name ?> </h3> @@ -69,7 +69,7 @@ <? if (!$info->admin) continue ?> <? if ($id == $admin) continue ?> <div class="gBlock"> - <a href="<?= url::site("admin/themes/preview/admin/$id") ?>" class="gDialogLink" title="<?= t("Theme Preview: {{theme_name}}", array("theme_name" => $info->name)) ?>"> + <a href="<?= url::site("admin/themes/preview/admin/$id") ?>" class="gDialogLink" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name)) ?>"> <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>" alt="<?= $info->name ?>" /> <h3> <?= $info->name ?> </h3> 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 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <p> <a href="<?= url::site("admin/themes/choose/$type/$theme_name?csrf=" . access::csrf_token()) ?>"> - <?= t("Activate <strong>{{theme_name}}</strong>", array("theme_name" => $info->name)) ?> + <?= t("Activate <strong>%theme_name</strong>", array("theme_name" => $info->name)) ?> </a> </p> <iframe src="<?= $url ?>" style="width: 900px; height: 450px"></iframe> 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 <a href=\"{{url}}\">API Key</a>", + t("Akismet is not quite ready! Please provide an <a href=\"%url\">API Key</a>", 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" /> <?= date("Y-M-d H:i:s", $comment->created) ?> - <?= t("<a href=#>{{author_name}}</a> said <em>{{comment_text}}</em>", + <?= t("<a href=#>%author_name</a> said <em>%comment_text</em>", array("author_name" => $comment->author_name(), "comment_text" => text::limit_words($comment->text, 50))); ?> </li> 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 @@ <div> <? if ($spam_caught > 0): ?> <p> - <?= t2("Gallery has caught {{count}} spam for you since you installed spam filtering.", - "Gallery has caught {{count}} spam for you since you installed spam filtering.", + <?= t2("Gallery has caught %count spam for you since you installed spam filtering.", + "Gallery has caught %count spam for you since you installed spam filtering.", $spam_caught) ?> </p> <? endif ?> <p> <? if ($spam->count()): ?> <?= t2("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.", - "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. All spam messages will be deleted after 7 days automatically.", + "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. All spam messages will be deleted after 7 days automatically.", $spam->count()) ?> </p> <p> 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" /> </a> - <?= t("on {{date}} <a href=#>{{name}}</a> said", + <?= t("on %date <a href=#>%name</a> said", array("date" => date("Y-M-d H:i:s", $comment->created), "name" => $comment->author_name())); ?> </p> 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 .= "<li>"; - $results .= t("Views: {{view_count}}", array("view_count" => $item->view_count)); + $results .= t("Views: %view_count", array("view_count" => $item->view_count)); $results .= "</li>"; } if ($item->owner) { $results .= "<li>"; - $results .= t("By: {{owner_name}}", array("owner_name" => "<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/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 @@ <ul> <li> <a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>" class="gDialogLink" - title="<?= t("Delete tag {{tag_name}}", array("tag_name" => $tag->name)) ?>"> + 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="<?= t("Rename tag {{tag_name}}", array("tag_name" => $tag->name)) ?>"> + title="<?= t("Rename tag %tag_name", array("tag_name" => $tag->name)) ?>"> <?= t("rename") ?> </a> </li> 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="<?= t("Edit group") ?>"><?= t("edit") ?></a> <? if (!$group->special): ?> <a href="groups/delete_form/<?= $group->id ?>" class="gDialogLink" - title="<?= t("Do you really want to delete {{group_name}}", array("group_name" => $group->name)) ?>"> + title="<?= t("Do you really want to delete %group_name", array("group_name" => $group->name)) ?>"> <?= t("delete") ?></a> <? endif ?> </li> 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 @@ <div class="image"> <img width="<?= $width ?>" height="<?= $height ?>" src="<?= $url ?>"/> <p> - <?= t("Position: {{position}}", array("position" => watermark::position($position))) ?> + <?= t("Position: %position", array("position" => watermark::position($position))) ?> </p> <p> - <?= t("Transparency: {{transparency}}%", array("transparency" => module::get_var("watermark", "transparency"))) ?> + <?= t("Transparency: %transparency%", array("transparency" => module::get_var("watermark", "transparency"))) ?> </p> </div> <div class="controls"> 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 @@ <? // See http://docs.kohanaphp.com/libraries/pagination ?> <ul id="gPager"> <? /* XXX: This message isn't easily localizable */ - $from_to_msg = t("Items {{from_number}} - {{to_number}} of {{total}}", + $from_to_msg = t("Items %from_number - %to_number of %total", array("from_number" => $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 @@ <? // See http://docs.kohanaphp.com/libraries/pagination ?> <ul id="gPager"> <? /* XXX: This message isn't easily localizable */ - $from_to_msg = t("Photos {{from_number}} - {{to_number}} of {{total}}", + $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)) ?> 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 @@ <?= $theme->photo_top() ?> <ul id="gPager"> - <li><?= t("{{position}} of {{total}}", array("position" => $position, "total" => $sibling_count)) ?></li> + <li><?= t("%position of %total", array("position" => $position, "total" => $sibling_count)) ?></li> <? if ($previous_item): ?> <li><span class="ui-icon ui-icon-seek-prev"></span><a href="<?= $previous_item->url() ?>"><?= t("previous") ?></a></li> <? endif ?> |