mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2024-12-23 00:20:17 +01:00
Use a single `intllib.Getter' for all the texts.
Just a minimal code reduction, but big reduction in code duplication. This could help if in the future, support for different "internationalization" mods will be added, or in case Minetest supports I18N/L10N internally in the engine.
This commit is contained in:
parent
ebe8adf855
commit
10cef3dda1
@ -6,14 +6,7 @@
|
||||
-- License: GPL
|
||||
--
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
-- misc stuff :D
|
||||
|
||||
|
@ -1,12 +1,5 @@
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
homedecor.door_models = {
|
||||
{
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- Node definitions for Homedecor doors
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
-- doors
|
||||
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- Various home electronics
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
minetest.register_node('homedecor:speaker', {
|
||||
description = S("Large Stereo Speaker"),
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- This file adds fences of various types
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
minetest.register_node("homedecor:fence_brass", {
|
||||
description = S("Brass Fence/railing"),
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- This code supplies an oven/stove. Basically it's just a copy of the default furnace with different textures.
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
local function hacky_swap_node(pos,name)
|
||||
local node = minetest.get_node(pos)
|
||||
|
1
init.lua
1
init.lua
@ -27,6 +27,7 @@ if homedecor.intllib_modpath then
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
homedecor.gettext = S
|
||||
|
||||
local dbg = function(s)
|
||||
if homedecor.debug == 1 then
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- This file supplies Kitchen cabinets and kitchen sink
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
minetest.register_node('homedecor:kitchen_cabinet', {
|
||||
description = S("Kitchen Cabinet"),
|
||||
|
@ -1,14 +1,7 @@
|
||||
|
||||
-- This file supplies glowlights
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
local colors = {"yellow","white"}
|
||||
|
||||
|
@ -7,14 +7,7 @@
|
||||
-- License: LGPL
|
||||
--
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
--[[
|
||||
| create_locked ( name, infotext )
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- Various misc. nodes
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
minetest.register_node('homedecor:ceiling_paint', {
|
||||
description = S("Textured Ceiling Paint"),
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- This file supplies nightstands
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
minetest.register_node('homedecor:nightstand_oak_one_drawer', {
|
||||
drawtype = "nodebox",
|
||||
|
@ -1,10 +1,5 @@
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
|
||||
local S = homedecor.gettext
|
||||
|
||||
function homedecor:node_is_owned(pos, placer)
|
||||
local ownername = false
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- This file supplies refrigerators
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
minetest.register_node('homedecor:refrigerator', {
|
||||
drawtype = "nodebox",
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- Various kidns of shingles
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
minetest.register_node("homedecor:skylight", {
|
||||
description = S("Glass Skylight"),
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- Various kinds of window shutters
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
local shutters = {
|
||||
{"oak", "Unpainted oak"},
|
||||
|
@ -1,12 +1,5 @@
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
-- CONSTANTS
|
||||
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- Various kinds of shingles
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
-- Corner shingle nodes, courtesy Bas080
|
||||
|
||||
|
@ -1,13 +1,6 @@
|
||||
-- Various kinds of tables
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if homedecor.intllib_modpath then
|
||||
dofile(homedecor.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = homedecor.gettext
|
||||
|
||||
materials = {
|
||||
{"glass","Glass"},
|
||||
|
Loading…
Reference in New Issue
Block a user