Localize get_translator call

This commit is contained in:
Maksym H. 2024-09-01 17:13:13 +03:00 committed by Athozus
parent 59667bd35c
commit 1bffd98132
21 changed files with 26 additions and 21 deletions

View File

@ -1,7 +1,7 @@
-- see: mail.md -- see: mail.md
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local f = string.format local f = string.format

View File

@ -5,6 +5,9 @@ mail = {
-- mod storage -- mod storage
storage = minetest.get_mod_storage(), storage = minetest.get_mod_storage(),
-- translation
S = minetest.get_translator(minetest.get_current_modname()),
-- ui theme prepend -- ui theme prepend
theme = "", theme = "",

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
minetest.after(2, function(name) minetest.after(2, function(name)

View File

@ -1,4 +1,6 @@
local S = minetest.get_translator("mail") -- translation
local S = mail.S
local has_canonical_name = minetest.get_modpath("canonical_name") local has_canonical_name = minetest.get_modpath("canonical_name")
mail.register_on_player_receive(function(name, msg) mail.register_on_player_receive(function(name, msg)

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local FORMNAME = "mail:about" local FORMNAME = "mail:about"

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local FORMNAME = "mail:compose" local FORMNAME = "mail:compose"

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local FORMNAME = "mail:contacts" local FORMNAME = "mail:contacts"

View File

@ -1,6 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
function mail.show_drafts(name) function mail.show_drafts(name)
local trash_tab = "" local trash_tab = ""

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local FORMNAME = "mail:editcontact" local FORMNAME = "mail:editcontact"

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local FORMNAME = "mail:editmaillist" local FORMNAME = "mail:editmaillist"

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
function mail.show_inbox(name, sortfieldindex, sortdirection, filter) function mail.show_inbox(name, sortfieldindex, sortdirection, filter)
sortfieldindex = tonumber(sortfieldindex or mail.selected_idxs.sortfield[name]) sortfieldindex = tonumber(sortfieldindex or mail.selected_idxs.sortfield[name])

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local FORMNAME = "mail:maillists" local FORMNAME = "mail:maillists"

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local FORMNAME = "mail:message" local FORMNAME = "mail:message"

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
function mail.show_outbox(name, sortfieldindex, sortdirection, filter) function mail.show_outbox(name, sortfieldindex, sortdirection, filter)
sortfieldindex = tonumber(sortfieldindex or mail.selected_idxs.sortfield[name]) sortfieldindex = tonumber(sortfieldindex or mail.selected_idxs.sortfield[name])

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local FORMNAME = "mail:selectcontact" local FORMNAME = "mail:selectcontact"

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local FORMNAME = "mail:settings" local FORMNAME = "mail:settings"

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
local trash_formspec = "size[8.5,11;]" .. mail.theme .. [[ local trash_formspec = "size[8.5,11;]" .. mail.theme .. [[
tabheader[0.3,1;boxtab;]] .. tabheader[0.3,1;boxtab;]] ..

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
function mail.compile_contact_list(name, selected, playernames) function mail.compile_contact_list(name, selected, playernames)
-- TODO: refactor this - not just compiles *a* list, but *the* list for the contacts screen (too inflexible) -- TODO: refactor this - not just compiles *a* list, but *the* list for the contacts screen (too inflexible)

View File

@ -1,4 +1,5 @@
local S = minetest.get_translator("mail") -- translation
local S = mail.S
local function recursive_expand_recipient_names(sender, list, is_toplevel, recipients, undeliverable) local function recursive_expand_recipient_names(sender, list, is_toplevel, recipients, undeliverable)
for _, name in ipairs(list) do for _, name in ipairs(list) do

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
mail.settings = { mail.settings = {
chat_notifications = { chat_notifications = {

View File

@ -1,5 +1,5 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = mail.S
function mail.time_ago(t) function mail.time_ago(t)
local elapsed = os.time() - t local elapsed = os.time() - t