add translations and fix loading mod support

This commit is contained in:
Dirk Sohler 2019-03-02 18:36:12 +01:00
parent 9186bb8de5
commit 1e9baa2fc2
No known key found for this signature in database
GPG Key ID: B9751241BD7D4E1A
5 changed files with 31 additions and 12 deletions

@ -1,7 +1,9 @@
-- Init
uniham = {}
uniham.modpath = minetest.get_modpath(minetest.get_current_modname())
uniham.modname = minetest.get_current_modname()
uniham.modpath = minetest.get_modpath(uniham.modname)
uniham.syspath = uniham.modpath..DIR_DELIM..'system'
uniham.translator = minetest.get_translator(uniham.modname)
-- Load mod

15
locale/uniham.de.tr Normal file

@ -0,0 +1,15 @@
# textdomain: uniham
# default
Bronze Hammer=Bronzener Hammer
Diamond Hammer=Diamantener Hammer
Golden Hammer=Goldener Hammer
Mese Hammer=Mese-Hammer
Obsidian Hammer=Obsidian-Hammer
Steel Hammer=Stählerner Hammer
Stone Hammer=Steinerner Hammer
Wooden Hammer=Hölzerner Hammer
# moreores
Mithril Hammer=Mithril-Hammer
Silver Hammer=Silberner Hammer

@ -1,58 +1,59 @@
-- Localize
local register_hammer = uniham.register_hammer
local S = uniham.translator
register_hammer('hammer_bronze', {
name = 'Bronze Hammer',
name = S('Bronze Hammer'),
head = 'default_bronze_block.png',
craft = 'default:bronze_ingot',
uses = 150
})
register_hammer('hammer_diamond', {
name = 'Diamond Hammer',
name = S('Diamond Hammer'),
head = 'default_diamond_block.png',
craft = 'default:diamond',
uses = 300
})
register_hammer('hammer_gold', {
name = 'Golden Hammer',
name = S('Golden Hammer'),
head = 'default_gold_block.png',
craft = 'default:gold_ingot',
uses = 100
})
register_hammer('hammer_mese', {
name = 'Mese Hammer',
name = S('Mese Hammer'),
head = 'default_mese_block.png',
craft = 'default:mese_crystal',
uses = 350
})
register_hammer('hammer_obsidian', {
name = 'Obsidian Hammer',
name = S('Obsidian Hammer'),
head = 'default_obsidian_block.png',
craft = 'default:obsidian_shard',
uses = 400
})
register_hammer('hammer_steel', {
name = 'Steel Hammer',
name = S('Steel Hammer'),
head = 'default_steel_block.png',
craft = 'default:steel_ingot',
uses = 200
})
register_hammer('hammer_stone', {
name = 'Stone Hammer',
name = S('Stone Hammer'),
head = 'default_stone.png',
craft = 'default:cobble',
uses = 70
})
register_hammer('hammer_wood', {
name = 'Wooden Hammer',
name = S('Wooden Hammer'),
head = 'default_wood.png',
craft = 'default:wood',
uses = 30

@ -1,16 +1,17 @@
-- Localize
local register_hammer = uniham.register_hammer
local S = uniham.translator
register_hammer('hammer_mithril', {
name = 'Mithril Hammer',
name = S('Mithril Hammer'),
head = 'moreores_mithril_block.png',
craft = 'moreores:mithril_ingot',
uses = 450
})
register_hammer('hammer_silver', {
name = 'Silver Hammer',
name = S('Silver Hammer'),
head = 'moreores_silver_block.png',
craft = 'moreores:silver_ingot',
uses = 250

@ -28,7 +28,7 @@ local depends = config:get('depends')..', '..config:get('optional_depends')
for modname in depends:gmatch('[0-9a-z_-]+') do
local registry_file = registry..DIR_DELIM..modname..'.lua'
if file_exists(registry_file) then
if file_exists(registry_file) and minetest.get_modpath(modname) then
dofile(registry_file)
local message = 'Loaded built-in '..modname..' support'
minetest.log('action', log_prefix..message)