summaryrefslogtreecommitdiff
path: root/core/helpers
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-01-15 09:30:15 +0000
committerAndy Staudacher <andy.st@gmail.com>2009-01-15 09:30:15 +0000
commite53916dd0622e3db61d6a05ad0fe69e8d7c7f11a (patch)
treedd7b6c0bbb6884341691189e98451f90870b6c35 /core/helpers
parent0bbde9e059c51fe61c92d23f9f6a4518b2fb1a8c (diff)
Simplifying the way t() is called. Refactoring localization function t($message, $options=array()) into 2 separate functions:
- the new t($message, $options=array()) is for simple strings, optionally with placeholder interpolation. - t2($singular, $plural, $count, $options=array()) is for plurals.
Diffstat (limited to 'core/helpers')
-rw-r--r--core/helpers/graphics.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php
index 738c7d45..7b13c55d 100644
--- a/core/helpers/graphics.php
+++ b/core/helpers/graphics.php
@@ -217,14 +217,14 @@ class graphics_Core {
$count = self::find_dirty_images_query()->count();
if ($count) {
site_status::warning(
- 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");
+ 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}}",
+ $count,
+ array("link_start" => "<a href=\"" .
+ url::site("admin/maintenance/start/graphics::rebuild_dirty_images?csrf=__CSRF__") .
+ "\" class=\"gDialogLink\">",
+ "link_end" => "</a>")),
+ "graphics_dirty");
}
}
@@ -254,10 +254,10 @@ class graphics_Core {
}
}
- $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)));
+ $task->status = t2("Updated: 1 image. Total: {{total_count}}.",
+ "Updated: {{count}} images. Total: {{total_count}}.",
+ $completed,
+ array("total_count" => ($remaining + $completed)));
if ($completed + $remaining > 0) {
$task->percent_complete = (int)(100 * $completed / ($completed + $remaining));