[gnome-builder] shortcuts: set the translation context on shortcuts



commit 11dc13a913e07245efb4269794357a243964f722
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Tue Aug 15 20:27:34 2017 +0200

    shortcuts: set the translation context on shortcuts
    
    For shortcuts visible in the shortcuts window,
    we need to set the "shortcut window" translation context
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786334

 libide/application/ide-application-shortcuts.c   |   30 ++++++------
 libide/editor/ide-editor-perspective-shortcuts.c |   24 +++++-----
 libide/editor/ide-editor-view-shortcuts.c        |   54 +++++++++++-----------
 libide/layout/ide-layout-stack-shortcuts.c       |   30 ++++++------
 libide/workbench/ide-workbench-shortcuts.c       |    6 +-
 plugins/command-bar/gb-command-bar.c             |    6 +-
 plugins/project-tree/gb-project-tree-shortcuts.c |   12 ++--
 7 files changed, 81 insertions(+), 81 deletions(-)
---
diff --git a/libide/application/ide-application-shortcuts.c b/libide/application/ide-application-shortcuts.c
index afbd604..bd4e7df 100644
--- a/libide/application/ide-application-shortcuts.c
+++ b/libide/application/ide-application-shortcuts.c
@@ -40,41 +40,41 @@ _ide_application_init_shortcuts (IdeApplication *self)
 
   dzl_shortcut_manager_add_action (manager,
                                    I_("app.help"),
-                                   N_("Workbench shortcuts"),
-                                   N_("Help"),
-                                   N_("Show the help window"),
+                                   NC_("shortcut window", "Workbench shortcuts"),
+                                   NC_("shortcut window", "Help"),
+                                   NC_("shortcut window", "Show the help window"),
                                    NULL);
   dzl_shortcut_theme_set_accel_for_action (theme, "app.help", "F1", DZL_SHORTCUT_PHASE_DISPATCH);
 
   dzl_shortcut_manager_add_action (manager,
                                    I_("app.shortcuts"),
-                                   N_("Workbench shortcuts"),
-                                   N_("Help"),
-                                   N_("Show the shortcuts window"),
+                                   NC_("shortcut window", "Workbench shortcuts"),
+                                   NC_("shortcut window", "Help"),
+                                   NC_("shortcut window", "Show the shortcuts window"),
                                    NULL);
   dzl_shortcut_theme_set_accel_for_action (theme, "app.shortcuts", "<Primary>F1", 
DZL_SHORTCUT_PHASE_DISPATCH);
 
   dzl_shortcut_manager_add_action (manager,
                                    I_("win.fullscreen"),
-                                   N_("Workbench shortcuts"),
-                                   N_("General"),
-                                   N_("Toggle window to fullscreen"),
+                                   NC_("shortcut window", "Workbench shortcuts"),
+                                   NC_("shortcut window", "General"),
+                                   NC_("shortcut window", "Toggle window to fullscreen"),
                                    NULL);
   dzl_shortcut_theme_set_accel_for_action (theme, "win.fullscreen", "F11", DZL_SHORTCUT_PHASE_DISPATCH);
 
   dzl_shortcut_manager_add_action (manager,
                                    I_("win.global-search"),
-                                   N_("Workbench shortcuts"),
-                                   N_("Search"),
-                                   N_("Focus to the global search entry"),
+                                   NC_("shortcut window", "Workbench shortcuts"),
+                                   NC_("shortcut window", "Search"),
+                                   NC_("shortcut window", "Focus to the global search entry"),
                                    NULL);
   dzl_shortcut_theme_set_accel_for_action (theme, "win.global-search", "<Primary>period", 
DZL_SHORTCUT_PHASE_DISPATCH);
 
   dzl_shortcut_manager_add_action (manager,
                                    I_("build-manager.build"),
-                                   N_("Workbench shortcuts"),
-                                   N_("Build and Run"),
-                                   N_("Trigger a build"),
+                                   NC_("shortcut window", "Workbench shortcuts"),
+                                   NC_("shortcut window", "Build and Run"),
+                                   NC_("shortcut window", "Trigger a build"),
                                    NULL);
   dzl_shortcut_theme_set_accel_for_action (theme, "build-manager.build", "<Control>F7", 
DZL_SHORTCUT_PHASE_DISPATCH);
 }
diff --git a/libide/editor/ide-editor-perspective-shortcuts.c 
b/libide/editor/ide-editor-perspective-shortcuts.c
index e3549eb..c126007 100644
--- a/libide/editor/ide-editor-perspective-shortcuts.c
+++ b/libide/editor/ide-editor-perspective-shortcuts.c
@@ -30,27 +30,27 @@
 static const DzlShortcutEntry editor_perspective_entries[] = {
   { "org.gnome.builder.editor.new-file",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Files"),
-    N_("Create a new document") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Files"),
+    NC_("shortcut window", "Create a new document") },
 
   { "org.gnome.builder.editor.open-file",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Files"),
-    N_("Open a document") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Files"),
+    NC_("shortcut window", "Open a document") },
 
   { "org.gnome.builder.editor.navigation-panel",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Panels"),
-    N_("Toggle navigation panel") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Panels"),
+    NC_("shortcut window", "Toggle navigation panel") },
 
   { "org.gnome.builder.editor.utilities-panel",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Panels"),
-    N_("Toggle utilities panel") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Panels"),
+    NC_("shortcut window", "Toggle utilities panel") },
 };
 
 void
diff --git a/libide/editor/ide-editor-view-shortcuts.c b/libide/editor/ide-editor-view-shortcuts.c
index 88c2a37..378240b 100644
--- a/libide/editor/ide-editor-view-shortcuts.c
+++ b/libide/editor/ide-editor-view-shortcuts.c
@@ -28,57 +28,57 @@
 static DzlShortcutEntry editor_view_shortcuts[] = {
   { "org.gnome.builder.editor-view.save",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Files"),
-    N_("Save the document") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Files"),
+    NC_("shortcut window", "Save the document") },
 
   { "org.gnome.builder.editor-view.save-as",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Files"),
-    N_("Save the document with a new name") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Files"),
+    NC_("shortcut window", "Save the document with a new name") },
 
   { "org.gnome.builder.editor-view.find",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Find and replace"),
-    N_("Find") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Find and replace"),
+    NC_("shortcut window", "Find") },
 
   { "org.gnome.builder.editor-view.find-replace",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Find and replace"),
-    N_("Find and replace") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Find and replace"),
+    NC_("shortcut window", "Find and replace") },
 
   { "org.gnome.builder.editor-view.next-match",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Find and replace"),
-    N_("Move to the next match") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Find and replace"),
+    NC_("shortcut window", "Move to the next match") },
 
   { "org.gnome.builder.editor-view.prev-match",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Find and replace"),
-    N_("Move to the previous match") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Find and replace"),
+    NC_("shortcut window", "Move to the previous match") },
 
   { "org.gnome.builder.editor-view.next-error",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Find and replace"),
-    N_("Move to the next error") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Find and replace"),
+    NC_("shortcut window", "Move to the next error") },
 
   { "org.gnome.builder.editor-view.prev-error",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Find and replace"),
-    N_("Move to the previous error") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Find and replace"),
+    NC_("shortcut window", "Move to the previous error") },
 
   { "org.gnome.builder.editor-view.clear-highlight",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Find and replace"),
-    N_("Find the next match") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Find and replace"),
+    NC_("shortcut window", "Find the next match") },
 };
 
 void
diff --git a/libide/layout/ide-layout-stack-shortcuts.c b/libide/layout/ide-layout-stack-shortcuts.c
index 9af09e3..5326b8d 100644
--- a/libide/layout/ide-layout-stack-shortcuts.c
+++ b/libide/layout/ide-layout-stack-shortcuts.c
@@ -29,37 +29,37 @@ static const DzlShortcutEntry stack_shortcuts[] = {
   { "org.gnome.builder.layoutstack.move-right",
     DZL_SHORTCUT_PHASE_CAPTURE,
     NULL,
-    N_("Editor shortcuts"),
-    N_("Files"),
-    N_("Move document to the right") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Files"),
+    NC_("shortcut window", "Move document to the right") },
 
   { "org.gnome.builder.layoutstack.move-left",
     DZL_SHORTCUT_PHASE_CAPTURE,
     NULL,
-    N_("Editor shortcuts"),
-    N_("Files"),
-    N_("Move document to the left") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Files"),
+    NC_("shortcut window", "Move document to the left") },
 
   { "org.gnome.builder.layoutstack.previous-document",
     DZL_SHORTCUT_PHASE_CAPTURE,
     NULL,
-    N_("Editor shortcuts"),
-    N_("Files"),
-    N_("Switch to the previous document") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Files"),
+    NC_("shortcut window", "Switch to the previous document") },
 
   { "org.gnome.builder.layoutstack.next-document",
     DZL_SHORTCUT_PHASE_CAPTURE,
     NULL,
-    N_("Editor shortcuts"),
-    N_("Files"),
-    N_("Switch to the next document") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Files"),
+    NC_("shortcut window", "Switch to the next document") },
 
   { "org.gnome.builder.layoutstack.close-view",
     DZL_SHORTCUT_PHASE_BUBBLE,
     NULL,
-    N_("Editor shortcuts"),
-    N_("Files"),
-    N_("Close the document") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Files"),
+    NC_("shortcut window", "Close the document") },
 };
 
 void
diff --git a/libide/workbench/ide-workbench-shortcuts.c b/libide/workbench/ide-workbench-shortcuts.c
index 8c9f20a..78f2d79 100644
--- a/libide/workbench/ide-workbench-shortcuts.c
+++ b/libide/workbench/ide-workbench-shortcuts.c
@@ -46,9 +46,9 @@ _ide_workbench_add_perspective_shortcut (IdeWorkbench   *self,
       const DzlShortcutEntry workbench_shortcut_entry[] = {
         { command_id,
           0, NULL,
-          N_("Workbench shortcuts"),
-          N_("Perspectives"),
-          N_(shortcut_help) },
+          NC_("shortcut window", "Workbench shortcuts"),
+          NC_("shortcut window", "Perspectives"),
+          NC_("shortcut window", shortcut_help) },
       };
 
       controller = dzl_shortcut_controller_find (GTK_WIDGET (self));
diff --git a/plugins/command-bar/gb-command-bar.c b/plugins/command-bar/gb-command-bar.c
index abe39b7..371e14b 100644
--- a/plugins/command-bar/gb-command-bar.c
+++ b/plugins/command-bar/gb-command-bar.c
@@ -712,9 +712,9 @@ gb_command_bar_class_finalize (GbCommandBarClass *klass)
 static const DzlShortcutEntry shortcuts[] = {
   { "org.gnome.builder.show-command-bar",
     0, NULL,
-    N_("Workbench shortcuts"),
-    N_("General"),
-    N_("Command Bar") },
+    NC_("shortcut window", "Workbench shortcuts"),
+    NC_("shortcut window", "General"),
+    NC_("shortcut window", "Command Bar") },
 };
 
 static void
diff --git a/plugins/project-tree/gb-project-tree-shortcuts.c 
b/plugins/project-tree/gb-project-tree-shortcuts.c
index a626357..f365c2a 100644
--- a/plugins/project-tree/gb-project-tree-shortcuts.c
+++ b/plugins/project-tree/gb-project-tree-shortcuts.c
@@ -30,15 +30,15 @@
 static const DzlShortcutEntry gb_project_tree_entries[] = {
   { "org.gnome.builder.project-tree.rename-file",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Project tree"),
-    N_("Rename a file") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Project tree"),
+    NC_("shortcut window", "Rename a file") },
 
   { "org.gnome.builder.project-tree.move-to-trah",
     0, NULL,
-    N_("Editor shortcuts"),
-    N_("Project tree"),
-    N_("Move a file to the trash") },
+    NC_("shortcut window", "Editor shortcuts"),
+    NC_("shortcut window", "Project tree"),
+    NC_("shortcut window", "Move a file to the trash") },
 };
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]