UX: Don't concatenate title on "Edit Category" dialog

UX: Don’t concatenate title on “Edit Category” dialog

diff --git a/app/assets/javascripts/discourse/controllers/edit-category.js.es6 b/app/assets/javascripts/discourse/controllers/edit-category.js.es6
index 06e0dd9..cb0db1d 100644
--- a/app/assets/javascripts/discourse/controllers/edit-category.js.es6
+++ b/app/assets/javascripts/discourse/controllers/edit-category.js.es6
@@ -30,12 +30,11 @@ export default Ember.Controller.extend(ModalFunctionality, {
 
   title: function() {
     if (this.get("model.id")) {
-      return I18n.t("category.edit_long") + " : " + this.get("model.name");
+      return I18n.t("category.edit_dialog_title", {
+        categoryName: this.get("model.name")
+      });
     }
-    return (
-      I18n.t("category.create") +
-      (this.get("model.name") ? " : " + this.get("model.name") : "")
-    );
+    return I18n.t("category.create");
   }.property("model.id", "model.name"),
 
   titleChanged: function() {
diff --git a/app/assets/javascripts/discourse/templates/components/d-navigation.hbs b/app/assets/javascripts/discourse/templates/components/d-navigation.hbs
index 2d1b956..5cf53f5 100644
--- a/app/assets/javascripts/discourse/templates/components/d-navigation.hbs
+++ b/app/assets/javascripts/discourse/templates/components/d-navigation.hbs
@@ -24,5 +24,5 @@
     class="btn-default edit-category"
     action=editCategory
     icon="wrench"
-    label="category.edit_long"}}
+    label="category.edit"}}
 {{/if}}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 0074c82..4ae368e 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -2352,8 +2352,8 @@ en:
       none: "(no category)"
       all: "All categories"
       choose: "category…"
-      edit: "edit"
-      edit_long: "Edit"
+      edit: "Edit"
+      edit_dialog_title: "Edit: %{categoryName}"
       view: "View Topics in Category"
       general: "General"
       settings: "Settings"

GitHub sha: 68e4aba3

1 Like