Conversation
SmallJoker
left a comment
There was a problem hiding this comment.
Not mergeable as of now, but it's going into a good direction. Thank you for the PR.
| @@ -1,5 +1,5 @@ | |||
|
|
|||
| local S = technic.getter | |||
| local S = minetest.get_translator("technic") | |||
There was a problem hiding this comment.
Would you please be so nice to use core instead of minetest for newly added function calls?
| if minetest.settings:get_bool("log_mods") then | ||
| print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start)) | ||
| end | ||
|
|
There was a problem hiding this comment.
Unrelated change. Please limit this PR to translating only.
| local clear_networks | ||
|
|
There was a problem hiding this comment.
Unrelated change. Please do translations only.
| lname = string.gsub(lname, ' ', '_') | ||
| minetest.register_craftitem("technic:"..lname.."_dust", { | ||
| description = S("%s Dust"):format(S(name)), | ||
| description = S(name) .. ' ' .. dust, |
There was a problem hiding this comment.
S(variable) is not picked up by translation scripts, which parse files statically. S uses the translator from "technic", thus the item names are probably not translated. Did you verify this in-game?
| "list[current_name;dst;5,1;2,2;]".. | ||
| "list[current_player;main;0,5;8,4;]".. | ||
| "label[0,0;"..machine_desc:format(tier).."]".. | ||
| "label[0,0;"..machine_desc.."]".. |
There was a problem hiding this comment.
Other mods might still rely on the previous behaviour, thus resulting in machine names like %s Fire-o-Matic Deluxe where %s is no longer replaced by LV/MV/HV. Please add a check for %s and still format the string if necessary.
| local function replaceMk(str, mk, mode) | ||
| local t = {} | ||
| t['1'] = mk | ||
| t['2'] = mode | ||
| local str1 = str | ||
| local str2 = string.gsub(str1, "%%(%d+)", t) | ||
| return str2 | ||
| end |
There was a problem hiding this comment.
Shorter, and a more intuitive function name.
| local function replaceMk(str, mk, mode) | |
| local t = {} | |
| t['1'] = mk | |
| t['2'] = mode | |
| local str1 = str | |
| local str2 = string.gsub(str1, "%%(%d+)", t) | |
| return str2 | |
| end | |
| local function get_description_string(str, mk, mode) | |
| local t = { ["1"] = mk, ["2"] = mode } | |
| return (string.gsub(str, "%%(%d+)", t)) | |
| end |
| local S = minetest.get_translator("technic_chests") | ||
|
|
||
| technic.chests:register(S("Copper"), "copper", { | ||
| width = 14, |
There was a problem hiding this comment.
Functional change. Please undo.
| } | ||
|
|
||
| function technic.chests:register(name, data) | ||
| function technic.chests:register(name, lname, data) |
There was a problem hiding this comment.
This is a breaking change. Please ensure backwards compatibility, or do the technic_chests translation in a separate PR. You could solve this trivially by passing lname in data (but handling nil values too).
| node_def.description:find("Steel", 1, true) then | ||
| minetest.override_item(node_name, { | ||
| description = node_def.description:gsub("Steel", S("Wrought Iron")), | ||
| description = "Steel".. tr_wrought, |
There was a problem hiding this comment.
SteelWrought Iron is surely not the expected outcome. I don't think this can be translated trivially.
The translation system has been reworked: now the mod detects the client's language and displays translations accordingly. Testing has been carried out on a multiplayer server.