Fix and improve translation strings (#2471)

This commit is contained in:
sfan5
2019-09-12 19:03:10 +02:00
committed by GitHub
parent ea992bdace
commit e4adb01fbf
15 changed files with 387 additions and 166 deletions

View File

@ -8,21 +8,21 @@ local S = minetest.get_translator("dye")
-- Make dye names and descriptions available globally
dye.dyes = {
{"white", S("White")},
{"grey", S("Grey")},
{"dark_grey", S("Dark Grey")},
{"black", S("Black")},
{"violet", S("Violet")},
{"blue", S("Blue")},
{"cyan", S("Cyan")},
{"dark_green", S("Dark Green")},
{"green", S("Green")},
{"yellow", S("Yellow")},
{"brown", S("Brown")},
{"orange", S("Orange")},
{"red", S("Red")},
{"magenta", S("Magenta")},
{"pink", S("Pink")},
{"white", "White"},
{"grey", "Grey"},
{"dark_grey", "Dark Grey"},
{"black", "Black"},
{"violet", "Violet"},
{"blue", "Blue"},
{"cyan", "Cyan"},
{"dark_green", "Dark Green"},
{"green", "Green"},
{"yellow", "Yellow"},
{"brown", "Brown"},
{"orange", "Orange"},
{"red", "Red"},
{"magenta", "Magenta"},
{"pink", "Pink"},
}
-- Define items
@ -35,7 +35,7 @@ for _, row in ipairs(dye.dyes) do
minetest.register_craftitem("dye:" .. name, {
inventory_image = "dye_" .. name .. ".png",
description = S("@1 Dye", description),
description = S(description .. " Dye"),
groups = groups
})
@ -103,3 +103,25 @@ for _, mix in pairs(dye_recipes) do
recipe = {"dye:" .. mix[1], "dye:" .. mix[2]},
})
end
-- Dummy calls to S() to allow translation scripts to detect the strings.
-- To update this run:
-- for _,e in ipairs(dye.dyes) do print(("S(%q)"):format(e[2].." Dye")) end
--[[
S("White Dye")
S("Grey Dye")
S("Dark Grey Dye")
S("Black Dye")
S("Violet Dye")
S("Blue Dye")
S("Cyan Dye")
S("Dark Green Dye")
S("Green Dye")
S("Yellow Dye")
S("Brown Dye")
S("Orange Dye")
S("Red Dye")
S("Magenta Dye")
S("Pink Dye")
--]]