aboutsummaryrefslogtreecommitdiff
path: root/builtin/client
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-04-11 22:35:25 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-04-11 23:35:25 +0200
commit4e2479e46a8d19fa0e943f84898b602cf38f6480 (patch)
tree0439bd8132b929107e383b8ba6713565292736ec /builtin/client
parenta3e73726868c2a1659a7816051e8a8be2e42c72a (diff)
downloadminetest-4e2479e46a8d19fa0e943f84898b602cf38f6480.tar.gz
minetest-4e2479e46a8d19fa0e943f84898b602cf38f6480.tar.bz2
minetest-4e2479e46a8d19fa0e943f84898b602cf38f6480.zip
[CSM] Allow escaping chatcommands and add missing calls to gettext. (#5565)
Diffstat (limited to 'builtin/client')
-rw-r--r--builtin/client/chatcommands.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/builtin/client/chatcommands.lua b/builtin/client/chatcommands.lua
index bb698cdec..f425216f5 100644
--- a/builtin/client/chatcommands.lua
+++ b/builtin/client/chatcommands.lua
@@ -2,6 +2,10 @@
core.register_on_sending_chat_messages(function(message)
+ if message:sub(1,2) == ".." then
+ return false
+ end
+
local first_char = message:sub(1,1)
if first_char == "/" or first_char == "." then
core.display_chat_message(core.gettext("issued command: ") .. message)
@@ -12,9 +16,7 @@ core.register_on_sending_chat_messages(function(message)
end
local cmd, param = string.match(message, "^%.([^ ]+) *(.*)")
- if not param then
- param = ""
- end
+ param = param or ""
if not cmd then
core.display_chat_message(core.gettext("-!- Empty command"))
@@ -36,15 +38,15 @@ core.register_on_sending_chat_messages(function(message)
end)
core.register_chatcommand("list_players", {
- description = "List online players",
+ description = core.gettext("List online players"),
func = function(param)
local players = table.concat(core.get_player_names(), ", ")
- core.display_chat_message("Online players: " .. players)
+ core.display_chat_message(core.gettext("Online players: ") .. players)
end
})
core.register_chatcommand("disconnect", {
- description = "Exit to main menu",
+ description = core.gettext("Exit to main menu"),
func = function(param)
core.disconnect()
end,