Skip to content

Commit cd1fb19

Browse files
committed
Use MT-5 translation system for technic mod
1 parent 1902d2a commit cd1fb19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2086
-1583
lines changed

technic/depends.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ mesecons?
88
mesecons_mvps?
99
digilines?
1010
digiline_remote?
11-
intllib?
1211
unified_inventory?
1312
vector_extras?
1413
dye?

technic/init.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ local modpath = minetest.get_modpath("technic")
1212
technic.modpath = modpath
1313

1414

15-
-- Boilerplate to support intllib
16-
if rawget(_G, "intllib") then
17-
technic.getter = intllib.Getter()
18-
else
19-
technic.getter = function(s,a,...)if a==nil then return s end a={a,...}return s:gsub("(@?)@(%(?)(%d+)(%)?)",function(e,o,n,c)if e==""then return a[tonumber(n)]..(o==""and c or"")else return"@"..o..n..c end end) end
20-
end
21-
local S = technic.getter
15+
-- Translation support
16+
local S = minetest.get_translator("technic")
2217

2318
-- Read configuration file
2419
dofile(modpath.."/config.lua")
@@ -48,6 +43,6 @@ dofile(modpath.."/tools/init.lua")
4843
dofile(modpath.."/legacy.lua")
4944

5045
if minetest.settings:get_bool("log_mods") then
51-
print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start))
46+
print(S("[Technic] Loaded in @1 seconds", string.format("%f", os.clock() - load_start)))
5247
end
5348

technic/items.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

2-
local S = technic.getter
3-
2+
local S = minetest.get_translator("technic")
43
minetest.register_craftitem("technic:silicon_wafer", {
54
description = S("Silicon Wafer"),
65
inventory_image = "technic_silicon_wafer.png",
@@ -141,7 +140,7 @@ for p = 0, 35 do
141140
local block = "technic:uranium"..psuffix.."_block"
142141
local ov = p == 7 and minetest.override_item or nil;
143142
(ov or minetest.register_craftitem)(ingot, {
144-
description = string.format(S("%.1f%%-Fissile Uranium Ingot"), p/10),
143+
description = S("@1%-Fissile Uranium Ingot", string.format("%.1f", p/10)),
145144
inventory_image = "technic_uranium_ingot.png",
146145
groups = {uranium_ingot=1, not_in_creative_inventory=nici},
147146
});
@@ -178,7 +177,7 @@ for p = 0, 35 do
178177
-- a 3.5%-fissile uranium block.
179178
local radioactivity = math.floor(math.sqrt((1+5.55*p/35) * 18 / (1+5.55*7/35)) + 0.5);
180179
(ov or minetest.register_node)(block, {
181-
description = string.format(S("%.1f%%-Fissile Uranium Block"), p/10),
180+
description = S("@1%-Fissile Uranium Block", string.format("%.1f", p/10)),
182181
tiles = {"technic_uranium_block.png"},
183182
is_ground_content = true,
184183
groups = {uranium_block=1, not_in_creative_inventory=nici,

technic/locale/de.txt

Lines changed: 0 additions & 168 deletions
This file was deleted.

technic/locale/es.txt

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)