diff options
author | Wuzzy <almikes@aol.com> | 2016-08-30 11:31:16 +0200 |
---|---|---|
committer | rubenwardy <rubenwardy@gmail.com> | 2016-09-01 16:21:41 +0100 |
commit | 67946bf0c4767284fa3d557d5fed6104f7bec904 (patch) | |
tree | c89ee205ad7a327459e776a715c3e9e490619cdc /api.lua | |
parent | 50349917e55175229abb4ae558d2b027004137c4 (diff) |
Improve strings and make them translatable
Diffstat (limited to 'api.lua')
-rw-r--r-- | api.lua | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -327,21 +327,23 @@ function awards.getFormspec(name, to, sid) local item = listofawards[sid+0] local def = awards.def[item.name] if def and def.secret and not item.got then - formspec = formspec .. "label[1,2.75;(Secret Award)]".. + formspec = formspec .. "label[1,2.75;"..minetest.formspec_escape(S("(Secret Award)")).."]".. "image[1,0;3,3;awards_unknown.png]" if def and def.description then - formspec = formspec .. "label[0,3.25;Unlock this award to find out what it is.]" + formspec = formspec .. "label[0,3.25;"..minetest.formspec_escape(S("Unlock this award to find out what it is.")).."]" end else local title = item.name if def and def.title then title = def.title end - local status = "" + local status = "%s" if item.got then - status = " (got)" + status = S("%s (got)") end - formspec = formspec .. "label[1,2.75;" .. title .. status .. "]" + formspec = formspec .. "label[1,2.75;" .. + string.format(status, minetest.formspec_escape(title)) .. + "]" if def and def.icon then formspec = formspec .. "image[1,0;3,3;" .. def.icon .. "]" end @@ -381,7 +383,7 @@ function awards.getFormspec(name, to, sid) first = false if def.secret and not award.got then - formspec = formspec .. "#707070(Secret Award)" + formspec = formspec .. "#707070"..minetest.formspec_escape(S("(Secret Award)")) else local title = award.name if def and def.title then @@ -403,23 +405,22 @@ function awards.show_to(name, to, sid, text) name = to end if name == to and awards.player(to).disabled then - minetest.chat_send_player("You've disabled awards. Type /awards" .. - " enable to reenable") + minetest.chat_send_player(S("You've disabled awards. Type /awards enable to reenable.")) return end if text then if not awards.players[name] or not awards.players[name].unlocked then - minetest.chat_send_player(to, "You have not unlocked any awards") + minetest.chat_send_player(to, S("You have not unlocked any awards")) return end - minetest.chat_send_player(to, name.."'s awards:") + minetest.chat_send_player(to, string.format(S("%s’s awards:"), name)) for _, str in pairs(awards.players[name].unlocked) do local def = awards.def[str] if def then if def.title then if def.description then - minetest.chat_send_player(to, def.title..": "..def.description) + minetest.chat_send_player(to, string.format(S("%s: %s"), def.title, def.description)) else minetest.chat_send_player(to, def.title) end |