summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorYusuke Nemoto <kaakaa@users.noreply.github.com>2016-12-28 22:46:11 +0900
committerenahum <nahumhbl@gmail.com>2016-12-28 10:46:11 -0300
commit2294936595355703afba14a91adb73c321abf8ac (patch)
tree18803d7b99e1e49114135134628cc65250cc3a7f /api
parent5fd11bd674075c57cb5c6f9e4b90042c1a37b3b5 (diff)
downloadchat-2294936595355703afba14a91adb73c321abf8ac.tar.gz
chat-2294936595355703afba14a91adb73c321abf8ac.tar.bz2
chat-2294936595355703afba14a91adb73c321abf8ac.zip
PLT-4648 break `/shortcuts` block (#4829)
Diffstat (limited to 'api')
-rw-r--r--api/command_shortcuts.go56
1 files changed, 46 insertions, 10 deletions
diff --git a/api/command_shortcuts.go b/api/command_shortcuts.go
index f75b419b1..1664221c1 100644
--- a/api/command_shortcuts.go
+++ b/api/command_shortcuts.go
@@ -36,23 +36,59 @@ func (me *ShortcutsProvider) GetCommand(c *Context) *model.Command {
}
func (me *ShortcutsProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse {
- shortcutIds := [4]string{
- "api.command_shortcuts.nav",
- "api.command_shortcuts.files",
- "api.command_shortcuts.msgs",
- "api.command_shortcuts.browser",
+ shortcutIds := [28]string{
+ "api.command_shortcuts.header",
+ // Nav shortcuts
+ "api.command_shortcuts.nav.header",
+ "api.command_shortcuts.nav.prev",
+ "api.command_shortcuts.nav.next",
+ "api.command_shortcuts.nav.unread_prev",
+ "api.command_shortcuts.nav.unread_next",
+ "api.command_shortcuts.nav.switcher",
+ "api.command_shortcuts.nav.settings",
+ "api.command_shortcuts.nav.recent_mentions",
+ // Files shortcuts
+ "api.command_shortcuts.files.header",
+ "api.command_shortcuts.files.upload",
+ // Msg shortcuts
+ "api.command_shortcuts.msgs.header",
+ "api.command_shortcuts.msgs.mark_as_read",
+ "api.command_shortcuts.msgs.reprint_prev",
+ "api.command_shortcuts.msgs.reprint_next",
+ "api.command_shortcuts.msgs.edit",
+ "api.command_shortcuts.msgs.comp_username",
+ "api.command_shortcuts.msgs.comp_channel",
+ "api.command_shortcuts.msgs.comp_emoji",
+ // Browser shortcuts
+ "api.command_shortcuts.browser.header",
+ "api.command_shortcuts.browser.channel_prev",
+ "api.command_shortcuts.browser.channel_next",
+ "api.command_shortcuts.browser.font_increase",
+ "api.command_shortcuts.browser.font_decrease",
+ "api.command_shortcuts.browser.highlight_prev",
+ "api.command_shortcuts.browser.highlight_next",
+ "api.command_shortcuts.browser.newline",
}
- var buffer bytes.Buffer
+ var osDependentWords map[string]interface{}
if strings.Contains(message, "mac") {
- for _, element := range shortcutIds {
- buffer.WriteString(c.T(element + "_mac"))
+ osDependentWords = map[string]interface{}{
+ "CmdOrCtrl": c.T("api.command_shortcuts.cmd"),
+ "ChannelPrevCmd": c.T("api.command_shortcuts.browser.channel_prev.cmd_mac"),
+ "ChannelNextCmd": c.T("api.command_shortcuts.browser.channel_next.cmd_mac"),
}
} else {
- for _, element := range shortcutIds {
- buffer.WriteString(c.T(element))
+ osDependentWords = map[string]interface{}{
+ "CmdOrCtrl": c.T("api.command_shortcuts.ctrl"),
+ "ChannelPrevCmd": c.T("api.command_shortcuts.browser.channel_prev.cmd"),
+ "ChannelNextCmd": c.T("api.command_shortcuts.browser.channel_next.cmd"),
}
}
+ var buffer bytes.Buffer
+ for _, element := range shortcutIds {
+ buffer.WriteString(c.T(element, osDependentWords))
+ }
+
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: buffer.String()}
}