summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/l10n_client.php
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2010-02-27 20:06:37 -0800
committerAndy Staudacher <andy.st@gmail.com>2010-02-27 20:06:37 -0800
commitdacb58ceed224fea34fa9cff740e6f30c70f0a7f (patch)
treec724367bcab8b147ba5d74fc548bcc10f05e592e /modules/gallery/controllers/l10n_client.php
parentcaf9ae88badfa5c2b8eb3eac03e298f1beea79a3 (diff)
Additional fixes for plural handling when deleting translations / marking them as untranslated.
Diffstat (limited to 'modules/gallery/controllers/l10n_client.php')
-rw-r--r--modules/gallery/controllers/l10n_client.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/gallery/controllers/l10n_client.php b/modules/gallery/controllers/l10n_client.php
index e3b47681..084f88af 100644
--- a/modules/gallery/controllers/l10n_client.php
+++ b/modules/gallery/controllers/l10n_client.php
@@ -38,6 +38,7 @@ class L10n_Client_Controller extends Controller {
}
$is_plural = Gallery_I18n::is_plural_message(unserialize($root_message->message));
+ $is_empty = true;
if ($is_plural) {
$plural_forms = l10n_client::plural_forms($locale);
$translation = array();
@@ -47,9 +48,11 @@ class L10n_Client_Controller extends Controller {
throw new Exception("@todo bad request data");
}
$translation[$plural_form] = $value;
+ $is_empty = $is_empty && empty($value);
}
} else {
$translation = $input->post("l10n-edit-translation");
+ $is_empty = empty($translation);
if (null === $translation || !is_string($translation)) {
throw new Exception("@todo bad request data");
}
@@ -60,7 +63,7 @@ class L10n_Client_Controller extends Controller {
->where("locale", "=", $locale)
->find();
- if (empty($translation)) {
+ if ($is_empty) {
if ($entry->loaded()) {
$entry->delete();
}