mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2025-06-28 12:56:01 +02:00
remove homedecor_i18n and merged into homedecor_common, fixed meseon global error
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
-- crafts for common items that are used by more than one home decor component
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
local S = homedecor.gettext
|
||||
|
||||
-- items
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
default
|
||||
homedecor_i18n
|
||||
creative
|
||||
building_blocks?
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
local S = homedecor.gettext
|
||||
|
||||
-- vectors to place one node next to or behind another
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
-- This code supplies an oven/stove. Basically it's just a copy of the default furnace with different textures.
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
local S = homedecor.gettext
|
||||
|
||||
local function swap_node(pos, name)
|
||||
local node = minetest.get_node(pos)
|
||||
|
@ -3,11 +3,14 @@
|
||||
|
||||
local modpath = minetest.get_modpath("homedecor_common")
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
homedecor = {}
|
||||
homedecor.modpath = modpath
|
||||
|
||||
-- Intllib support
|
||||
homedecor.gettext, homedecor.ngettext = dofile(modpath.."/intllib.lua")
|
||||
|
||||
local S = homedecor.gettext
|
||||
|
||||
-- Determine if the item being pointed at is the underside of a node (e.g a ceiling)
|
||||
function homedecor.find_ceiling(itemstack, placer, pointed_thing)
|
||||
-- most of this is copied from the rotate-and-place function in builtin
|
||||
|
45
homedecor_common/intllib.lua
Normal file
45
homedecor_common/intllib.lua
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
-- Fallback functions for when `intllib` is not installed.
|
||||
-- Code released under Unlicense <http://unlicense.org>.
|
||||
|
||||
-- Get the latest version of this file at:
|
||||
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
||||
|
||||
local function format(str, ...)
|
||||
local args = { ... }
|
||||
local function repl(escape, open, num, close)
|
||||
if escape == "" then
|
||||
local replacement = tostring(args[tonumber(num)])
|
||||
if open == "" then
|
||||
replacement = replacement..close
|
||||
end
|
||||
return replacement
|
||||
else
|
||||
return "@"..open..num..close
|
||||
end
|
||||
end
|
||||
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
||||
end
|
||||
|
||||
local gettext, ngettext
|
||||
if minetest.get_modpath("intllib") then
|
||||
if intllib.make_gettext_pair then
|
||||
-- New method using gettext.
|
||||
gettext, ngettext = intllib.make_gettext_pair()
|
||||
else
|
||||
-- Old method using text files.
|
||||
gettext = intllib.Getter()
|
||||
end
|
||||
end
|
||||
|
||||
-- Fill in missing functions.
|
||||
|
||||
gettext = gettext or function(msgid, ...)
|
||||
return format(msgid, ...)
|
||||
end
|
||||
|
||||
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
||||
return format(n==1 and msgid or msgid_plural, ...)
|
||||
end
|
||||
|
||||
return gettext, ngettext
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
local S = homedecor.gettext
|
||||
|
||||
local default_can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
1854
homedecor_common/locale/de.po
Normal file
1854
homedecor_common/locale/de.po
Normal file
File diff suppressed because it is too large
Load Diff
1633
homedecor_common/locale/es.po
Normal file
1633
homedecor_common/locale/es.po
Normal file
File diff suppressed because it is too large
Load Diff
1796
homedecor_common/locale/fr.po
Normal file
1796
homedecor_common/locale/fr.po
Normal file
File diff suppressed because it is too large
Load Diff
1937
homedecor_common/locale/it.po
Normal file
1937
homedecor_common/locale/it.po
Normal file
File diff suppressed because it is too large
Load Diff
1849
homedecor_common/locale/ms.po
Normal file
1849
homedecor_common/locale/ms.po
Normal file
File diff suppressed because it is too large
Load Diff
1900
homedecor_common/locale/pt.po
Normal file
1900
homedecor_common/locale/pt.po
Normal file
File diff suppressed because it is too large
Load Diff
1900
homedecor_common/locale/pt_BR.po
Normal file
1900
homedecor_common/locale/pt_BR.po
Normal file
File diff suppressed because it is too large
Load Diff
1595
homedecor_common/locale/ru.po
Normal file
1595
homedecor_common/locale/ru.po
Normal file
File diff suppressed because it is too large
Load Diff
1527
homedecor_common/locale/template.pot
Normal file
1527
homedecor_common/locale/template.pot
Normal file
File diff suppressed because it is too large
Load Diff
24
homedecor_common/tools/updatepo.sh
Executable file
24
homedecor_common/tools/updatepo.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#! /bin/bash
|
||||
|
||||
# To create a new translation:
|
||||
# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/..";
|
||||
|
||||
# Extract translatable strings.
|
||||
xgettext --from-code=UTF-8 \
|
||||
--language=Lua \
|
||||
--sort-by-file \
|
||||
--keyword=S \
|
||||
--keyword=NS:1,2 \
|
||||
--keyword=N_ \
|
||||
--add-comments='Translators:' \
|
||||
--add-location=file \
|
||||
-o locale/template.pot \
|
||||
$(find .. -name '*.lua')
|
||||
|
||||
# Update translations.
|
||||
find locale -name '*.po' | while read -r file; do
|
||||
echo $file
|
||||
msgmerge --update $file locale/template.pot;
|
||||
done
|
Reference in New Issue
Block a user