diff options
| author | 2020-12-28 07:08:38 -0500 | |
|---|---|---|
| committer | 2020-12-28 13:08:38 +0100 | |
| commit | e93675e03639c2c8d4fc7d70cfccaa10f5f1707e (patch) | |
| tree | 21fb1d3e5a31807b8290af5a9e819fefc334c197 /app/Controllers | |
| parent | 6ecfc01c1f3f37491b184711cb29cd9a839f4a9c (diff) | |
Fix tag management translation (#3292)
Before, feedback messages were not translated.
Now, they are.
Diffstat (limited to 'app/Controllers')
| -rw-r--r-- | app/Controllers/tagController.php | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/app/Controllers/tagController.php b/app/Controllers/tagController.php index 75f276d19..217d95db1 100644 --- a/app/Controllers/tagController.php +++ b/app/Controllers/tagController.php @@ -92,10 +92,10 @@ class FreshRSS_tag_Controller extends Minz_ActionController { $tagDAO = FreshRSS_Factory::createTagDao(); if (null === $tagDAO->searchByName($name)) { $tagDAO->addTag(['name' => $name]); - Minz_Request::good('feedback.tag.created', ['c' => 'tag', 'a' => 'index'], true); + Minz_Request::good(_t('feedback.tag.created', $name), ['c' => 'tag', 'a' => 'index'], true); } - Minz_Request::bad('feedback.tag.name_exists', ['c' => 'tag', 'a' => 'index'], true); + Minz_Request::bad(_t('feedback.tag.name_exists', $name), ['c' => 'tag', 'a' => 'index'], true); } public function renameAction() { @@ -103,17 +103,21 @@ class FreshRSS_tag_Controller extends Minz_ActionController { Minz_Error::error(405); } - $name = Minz_Request::param('name'); + $targetName = Minz_Request::param('name'); + $sourceId = Minz_Request::param('id_tag'); + $tagDAO = FreshRSS_Factory::createTagDao(); - $newTag = $tagDAO->searchByName($name); - if (null === $newTag) { - $tagDAO->updateTag(Minz_Request::param('id_tag'), ['name' => $name]); + + $sourceName = $tagDAO->searchById($sourceId)->name(); + $targetTag = $tagDAO->searchByName($targetName); + if (null === $targetTag) { + $tagDAO->updateTag($sourceId, ['name' => $targetName]); } else { - $tagDAO->updateEntryTag(Minz_Request::param('id_tag'), $newTag->id()); - $tagDAO->deleteTag(Minz_Request::param('id_tag')); + $tagDAO->updateEntryTag($sourceId, $targetTag->id()); + $tagDAO->deleteTag($sourceId); } - Minz_Request::good('feedback.tag.renamed', ['c' => 'tag', 'a' => 'index'], true); + Minz_Request::good(_t('feedback.tag.renamed', $sourceName, $targetName), ['c' => 'tag', 'a' => 'index'], true); } public function indexAction() { |
