Skip to content

Commit

Permalink
Refactoring: Core: add minetest.get_mod_translator(). Closes #1753
Browse files Browse the repository at this point in the history
  • Loading branch information
alek13 committed Oct 31, 2024
1 parent 1e5dbde commit 1b49bb4
Show file tree
Hide file tree
Showing 231 changed files with 326 additions and 300 deletions.
2 changes: 1 addition & 1 deletion mods/lord/Blocks/campfire/campfire.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- You can craft and use better campfire.
]]--

local S = minetest.get_translator("campfire")
local S = minetest.get_mod_translator()

-- VARIABLES
local campfire_cooking = 1; -- nil - not cooked, 1 - cooked
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/castle/arrowslit.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("castle")
local S = minetest.get_mod_translator()


minetest.register_alias("castle:arrowslit", "castle:arrowslit_stonewall")
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/castle/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("castle")
local S = minetest.get_mod_translator()

castle = {} -- namespace

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/castle/jailbars.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("castle")
local S = minetest.get_mod_translator()

-- xjailbarss mod by xyz

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/castle/murder_hole.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("castle")
local S = minetest.get_mod_translator()

local hole = {}

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/castle/pillars.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("castle")
local S = minetest.get_mod_translator()

minetest.register_alias("castle:pillars_bottom", "castle:pillars_stonewall_bottom")
minetest.register_alias("castle:pillars_top", "castle:pillars_stonewall_top")
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/castle/rope.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("castle")
local S = minetest.get_mod_translator()

minetest.register_node("castle:ropes",{
description = S("Rope"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/castle/shields_decor.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("castle")
local S = minetest.get_mod_translator()

minetest.register_node("castle:shield", {
description = S("Mounted Shield"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/castle/tapestry.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("castle")
local S = minetest.get_mod_translator()


local function register_tapestry_top(node_name, craft_from, description_material, texture)
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/castle/town_item.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("castle")
local S = minetest.get_mod_translator()


minetest.register_alias("darkage:box", "castle:crate")
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/christmas/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("christmas")
local S = minetest.get_mod_translator()

local mod_path = minetest.get_modpath(minetest.get_current_modname())
local require = function(name) return dofile(mod_path .. "/" .. name:gsub("%.", "/") .. ".lua") end
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/christmas/tree_nodes.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("christmas")
local S = minetest.get_mod_translator()


--- @param pos Position
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/clan_node/src/chest/node.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local Form = require("chest.node.Form")


local S = minetest.get_translator('clan_node')
local S = minetest.get_mod_translator()


---@type number @seconds
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/clan_node/src/chest/node/Form.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator('clan_node')
local S = minetest.get_mod_translator()

---
--- @class clan_node.chest.node.Form: base_classes.Form.Base
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/clans_tapestries/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("clans_tapestries")
local S = minetest.get_mod_translator()

castle.tapestry.register(
"clans_tapestries:example",
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/clay_types/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator(minetest.get_current_modname())
local S = minetest.get_mod_translator()

-- Chamotte

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/grinder/src/grinder/Grinder.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("grinder")
local SL = minetest.get_mod_translator()
local form = require('grinder.definition.node.form')

--- @type string
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/grinder/src/grinder/definition/craft.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("grinder")
local SL = minetest.get_mod_translator()

return {
recipes = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("grinder")
local SL = minetest.get_mod_translator()

local form = require('grinder.definition.node.form')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("grinder")
local SL = minetest.get_mod_translator()

local form = require('grinder.definition.node.form')

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lamps/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lamps")
local S = minetest.get_mod_translator()

local chains = {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local Form = require("artisan_benches.anvil.Form")


local S = minetest.get_translator('lord_artisan_benches')
local S = minetest.get_mod_translator()

minetest.CraftMethod.ANVIL = 'anvil'
minetest.register_craft_method(minetest.CraftMethod.ANVIL)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- luacheck:ignore 561
-- Отключена проверка на цикломатическую сложность, поскольку
-- mods/lord/Blocks/castle/town_item.lua:152:20: cyclomatic complexity of function get_recipe is too high (14 > 10)
local S = minetest.get_translator('lord_artisan_benches')
local S = minetest.get_mod_translator()


minetest.register_alias('castle:workbench', 'lord_artisan_benches:workbench')
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_beds/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_beds")
local S = minetest.get_mod_translator()

beds.day_interval.finish = 0.790 -- reduced a bit

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_blocks/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_blocks")
local S = minetest.get_mod_translator()

minetest.register_node("lord_blocks:blackout", {
description = S("Blackout"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_bricks/src/bricks.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator(minetest.get_current_modname())
local S = minetest.get_mod_translator()

require('bricks.rock')

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_bricks/src/bricks/chamotte.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator(minetest.get_current_modname())
local S = minetest.get_mod_translator()

-- Items

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_bricks/src/bricks/mordor.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator(minetest.get_current_modname())
local S = minetest.get_mod_translator()

-- Items

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_bricks/src/bricks/rock.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator(minetest.get_current_modname())
local S = minetest.get_mod_translator()


for node_name, registration in pairs(rocks.get_lord_nodes()) do
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_default/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

local S = minetest.get_translator("lord_default")
local S = minetest.get_mod_translator()


minetest.register_craftitem(":default:scorched_stuff", {
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_doors/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("lord_doors")
local SL = minetest.get_mod_translator()

doors.register("lord_doors:door_gondor", {
tiles = {{ name = "lord_doors_gondor.png", backface_culling = true }},
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_doors/mtg.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_doors")
local S = minetest.get_mod_translator()


local function register_replace_mtg_doors_legacy_lbm(name)
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_doors/race_doors.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_doors")
local S = minetest.get_mod_translator()


--- Обработчик on_rightclick для расовых дверей.
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_flowers/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_flowers")
local S = minetest.get_mod_translator()

minetest.register_node(":flowers:cactus_decor", {
description = S("Cactus decorative"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_ground/src/ground/api/dirt.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_ground")
local S = minetest.get_mod_translator()

local dirt = {
--- @type table<string,NodeDefinition>|NodeDefinition[]
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_ground/src/ground/api/sand.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_ground")
local S = minetest.get_mod_translator()

local sand = {
--- @type table<string,NodeDefinition>|NodeDefinition[]
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/armchairs.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("lord_homedecor")
local SL = minetest.get_mod_translator()

local armchair_cbox = {
type = "fixed",
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/building_blocks.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("lord_homedecor")
local SL = minetest.get_mod_translator()

minetest.register_node("lord_homedecor:Adobe", {
tiles = {"building_blocks_Adobe.png"},
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/coffeetable.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("lord_homedecor")
local SL = minetest.get_mod_translator()

minetest.register_node("lord_homedecor:coffeetable_back", {
description = SL("Coffee Table"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/crafts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
-- Mostly my own code; overall template borrowed from game default

local S = minetest.get_translator("lord_homedecor")
local S = minetest.get_mod_translator()

-- misc craftitems

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/endtable.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("lord_homedecor")
local SL = minetest.get_mod_translator()

minetest.register_node("lord_homedecor:endtable", {
description = SL("End Table"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/exterior.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("lord_homedecor")
local SL = minetest.get_mod_translator()

local bl1_sbox = {
type = "fixed",
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/furniture_medieval.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

local S = minetest.get_translator("lord_homedecor")
local S = minetest.get_mod_translator()

lord_homedecor.register("bars", {
description = S("Bars"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/handlers/expansion.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_homedecor")
local S = minetest.get_mod_translator()

-- vectors to place one node next to or behind another

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/handlers/furnaces.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- This code supplies an oven/stove. Basically it's just a copy of the default furnace with different textures.

local SL = minetest.get_translator("lord_homedecor")
local SL = minetest.get_mod_translator()

local function swap_node(pos, name)
local node = minetest.get_node(pos)
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/handlers/inventory.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_homedecor")
local S = minetest.get_mod_translator()

local default_can_dig = function(pos,player)
local meta = minetest.get_meta(pos)
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Minetest 0.4 mod: lord_homedecor
-- See README.txt for licensing and other information.

local SL = minetest.get_translator("lord_homedecor")
local SL = minetest.get_mod_translator()
local modpath = minetest.get_modpath("lord_homedecor")

-- Definitions made by this mod that other mods can use too
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/lighting.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- This file supplies glowlights


local S = minetest.get_translator("lord_homedecor")
local S = minetest.get_mod_translator()


local tc_cbox = {
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/longsofas.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("lord_homedecor")
local SL = minetest.get_mod_translator()

local longsofa_sbox = {
type = "fixed",
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/misc-nodes.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_homedecor")
local S = minetest.get_mod_translator()

local pot_colors = {"terracotta"}

Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/roofing.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_homedecor")
local S = minetest.get_mod_translator()

minetest.register_node("lord_homedecor:skylight", {
description = S("Glass Skylight"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/shutters.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Various kinds of window shutters

local S = minetest.get_translator("lord_homedecor")
local S = minetest.get_mod_translator()

local shutters = {
{"oak", "Unpainted oak", "#bf8a51:200" },
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/sofas.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("lord_homedecor")
local SL = minetest.get_mod_translator()


local sofa_sbox = {
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_homedecor/window_treatments.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_homedecor")
local S = minetest.get_mod_translator()

lord_homedecor.register("window_flowerbox", {
description = S("Window flowerbox"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_mail/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = minetest.get_translator("lord_mail")
local SL = minetest.get_mod_translator()
local colorize = minetest.colorize
local e = minetest.formspec.escape
local spec = minetest.formspec
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_ores/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minetest.mod(function(mod)
require('rock_ores')


local S = minetest.get_translator('lord_ores')
local S = minetest.get_mod_translator()

minetest.register_node("lord_ores:magma", {
description = S("Magma"),
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_ores/src/rock_ores.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_ores")
local S = minetest.get_mod_translator()


for name, registration in pairs(rocks.get_lord_nodes()) do
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_planks/src/planks/api.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_planks")
local S = minetest.get_mod_translator()


local planks = {
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_rocks/src/rocks/api.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_rocks")
local S = minetest.get_mod_translator()

local rocks = {
--- @type table<string,NodeDefinition>|NodeDefinition[]
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_trees/src/tree/fruits.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_trees")
local S = minetest.get_mod_translator()


minetest.register_node("lord_trees:plum", {
Expand Down
2 changes: 1 addition & 1 deletion mods/lord/Blocks/lord_trees/src/tree/leaves.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = minetest.get_translator("lord_trees")
local S = minetest.get_mod_translator()


local leaves = {
Expand Down
Loading

0 comments on commit 1b49bb4

Please sign in to comment.