From 684d347f3ecc80493db5fd7959da17b2f8fe5c05 Mon Sep 17 00:00:00 2001 From: "Lucas F." Date: Tue, 17 Dec 2024 17:21:51 -0300 Subject: [PATCH] update: compilemessages and makemessages --- lua/django/mappings.lua | 13 +++++++++++++ lua/django/utils.lua | 11 +++++++++++ 2 files changed, 24 insertions(+) diff --git a/lua/django/mappings.lua b/lua/django/mappings.lua index b35eab4..b93c65b 100644 --- a/lua/django/mappings.lua +++ b/lua/django/mappings.lua @@ -64,6 +64,19 @@ local mappings = { end, desc = "run celery", }, + ["jl"] = { desc = "Language" }, + ["jlc"] = { + function() + django.compile_messages() + end, + desc = "Compile messages", + }, + ["jlm"] = { + function() + django.make_messages() + end, + desc = "Make messages", + }, }, } diff --git a/lua/django/utils.lua b/lua/django/utils.lua index c5acac7..5b73cf4 100644 --- a/lua/django/utils.lua +++ b/lua/django/utils.lua @@ -273,4 +273,15 @@ function M.run_celery() end end +function M.make_messages() + local term_num = 11 + toggleterm.exec("./manage.py makemessages -a", term_num, 100, ".", "float", "make_messages", false) +end + +function M.compile_messages() + local term_num = 12 + toggleterm.exec("./manage.py compilemessages", term_num, 100, ".", "float", "compile_messages", false) +end + + return M