Add localization support

master
Jordan Irwin 2021-08-03 15:29:43 -07:00
parent 44d3e24683
commit 83fb1227de
6 changed files with 18 additions and 4 deletions

View File

@ -1,4 +1,3 @@
TODO: TODO:
- add localization support
- add Spanish translation - add Spanish translation

View File

@ -29,6 +29,8 @@
-- @module api.lua -- @module api.lua
local S = core.get_translator(asm.modname)
local registered_eggs = {} local registered_eggs = {}
--- Retrieves egg that spawns specified entity. --- Retrieves egg that spawns specified entity.
@ -75,7 +77,7 @@ local function formatTitle(s)
table.insert(t, v) table.insert(t, v)
end end
return table.concat(t, " ") .. " Spawn Egg" return S("@1 Spawn Egg", table.concat(t, " "))
end end
--- Registers new egg in game. --- Registers new egg in game.

View File

@ -3,17 +3,21 @@ v1.2
---- ----
- added method to retrieve registered egg by entity name - added method to retrieve registered egg by entity name
- added optional field "title" for EggDef - added optional field "title" for EggDef
- added localization support
v1.1 v1.1
---- ----
- egg names are titleized & underscores are replaced with space - egg names are titleized & underscores are replaced with space
v1.0 v1.0
---- ----
- made independent of any other mods or games - made independent of any other mods or games
- renamed to "asm_spawneggs" (Another Spawneggs Mod) - renamed to "asm_spawneggs" (Another Spawneggs Mod)
- added API reference - added API reference
v0.1 v0.1
---- ----
- created mod for Antum game - created mod for Antum game

View File

@ -25,7 +25,9 @@
--]] --]]
local S = core.get_translator(asm.modname)
core.register_craftitem(":spawneggs:egg", { core.register_craftitem(":spawneggs:egg", {
description = "Spawn Egg", description = S("Spawn Egg"),
inventory_image = "spawneggs_egg.png", inventory_image = "spawneggs_egg.png",
}) })

7
locale/template.txt Normal file
View File

@ -0,0 +1,7 @@
# textdomain:asm_spawneggs
# Translators:
Spawn Egg=
@1 Spawn Egg=

View File

@ -4,4 +4,4 @@ author = AntumDeluge
description = Spawneggs for adding entities to game. description = Spawneggs for adding entities to game.
license = MIT license = MIT
version = 1.1 version = 1.1
min_minetest_version = 0.4 min_minetest_version = 5.0