Skip to content

Commit

Permalink
declare the translator in every module instead of a global
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay authored and Athozus committed Mar 31, 2023
1 parent 4d4fd90 commit af03f94
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
allow_defined_top = true

globals = {
"mail",
}
Expand Down
3 changes: 0 additions & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ if minetest.get_modpath("default") then
mail.theme = default.gui_bg .. default.gui_bg_img
end

-- translation
S = minetest.get_translator("mail")

-- sub files
local MP = minetest.get_modpath(minetest.get_current_modname())
dofile(MP .. "/util/normalize.lua")
Expand Down
3 changes: 3 additions & 0 deletions ui/compose.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local FORMNAME = "mail:compose"
local msg_id = {}

Expand Down
3 changes: 3 additions & 0 deletions ui/contacts.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local FORMNAME = "mail:contacts"

local contacts_formspec = "size[8,9;]" .. mail.theme .. [[
Expand Down
3 changes: 3 additions & 0 deletions ui/drafts.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local drafts_formspec = "size[8.5,10;]" .. mail.theme .. [[
tabheader[0.3,1;boxtab;]] .. S("Inbox") .. "," .. S("Sent messages").. "," .. S("Drafts") .. [[;3;false;false]
Expand Down
3 changes: 3 additions & 0 deletions ui/edit_contact.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local FORMNAME = "mail:editcontact"

function mail.show_edit_contact(name, contact_name, note, illegal_name_hint)
Expand Down
3 changes: 3 additions & 0 deletions ui/edit_maillists.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local FORMNAME = "mail:editmaillist"

function mail.show_edit_maillist(playername, maillist_name, desc, players, illegal_name_hint)
Expand Down
3 changes: 3 additions & 0 deletions ui/inbox.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local inbox_formspec = "size[8.5,10;]" .. mail.theme .. [[
tabheader[0.3,1;boxtab;]] .. S("Inbox") .. "," .. S("Sent messages").. "," .. S("Drafts") .. [[;1;false;false]
Expand Down
3 changes: 3 additions & 0 deletions ui/maillists.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local FORMNAME = "mail:maillists"

local maillists_formspec = "size[8,9;]" .. mail.theme .. [[
Expand Down
3 changes: 3 additions & 0 deletions ui/message.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local FORMNAME = "mail:message"

function mail.show_message(name, id)
Expand Down
3 changes: 3 additions & 0 deletions ui/outbox.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local sent_formspec = "size[8.5,10;]" .. mail.theme .. [[
tabheader[0.3,1;boxtab;]] .. S("Inbox") .. "," .. S("Sent messages").. "," .. S("Drafts") .. [[;2;false;false]
Expand Down
3 changes: 3 additions & 0 deletions ui/select_contact.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- translation
local S = minetest.get_translator("mail")

local FORMNAME = "mail:selectcontact"

local select_contact_formspec = "size[8,9;]" .. mail.theme .. [[
Expand Down

0 comments on commit af03f94

Please sign in to comment.