diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-01-08 17:13:06 +0000 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-01-08 17:13:06 +0000 |
commit | a631fe29f3950f8db1f7fb4ce1f47261a9b0feff (patch) | |
tree | b5af3ad39362dea97ce01be63d5ec09b7846bb9c /modules/watermark | |
parent | fd081159f1783918d81e355e25e262ccc5249913 (diff) |
i18n refactoring: Rename all _() (reserved by gettext) calls to t().
- And refactor printf to our string interpolation / pluralization syntax
- Also, a slight change to the translations_incomings table, using binary(16) instead of char(32) as message key.
Diffstat (limited to 'modules/watermark')
-rw-r--r-- | modules/watermark/controllers/admin_watermarks.php | 14 | ||||
-rw-r--r-- | modules/watermark/helpers/watermark.php | 40 | ||||
-rw-r--r-- | modules/watermark/helpers/watermark_menu.php | 2 | ||||
-rw-r--r-- | modules/watermark/views/admin_watermarks.html.php | 24 |
4 files changed, 40 insertions, 40 deletions
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 ?> |