Compare commits

...

10 Commits

Author SHA1 Message Date
Wuzzy
0187aa4040 Put update_locale_files.py under CC0 2024-12-17 19:12:02 +01:00
Wuzzy
0d1a6136f3 Fix xgettext call argument 2024-12-16 20:53:22 +01:00
Wuzzy
a93ad50712 Reduce min_minetest_version to 5.8 again 2024-11-28 15:10:05 +01:00
Wuzzy
86bc5be618 Add fallback in tt_base 2024-11-28 15:09:39 +01:00
Wuzzy
107e35acba Update rp_localize PO files 2024-11-28 14:00:06 +01:00
Wuzzy
1da945ebeb Fix description of number string 2024-11-28 13:57:00 +01:00
Wuzzy
692373f590 Raise min_minetest_version to 5.10 2024-11-28 13:06:55 +01:00
Wuzzy
e91ea1f95d Add PACKAGE_VERSION in locale updater script 2024-11-27 23:12:12 +01:00
Wuzzy
99e045004c Rename POT files to "<textdomain>.pot" 2024-11-27 23:11:44 +01:00
Wuzzy
88b2045e24 Change food/sat definitions of 2 meats 2024-11-26 18:06:55 +01:00
59 changed files with 41 additions and 25 deletions

View File

@ -112,7 +112,7 @@ See `mods/rp_music` for details.
The game is free software, released under the AGPLv3 (or later).
Media files are released under CC BY-SA 4.0 or CC0, with one exception.
Note that individual mods are also licensed additionally under
Note that individual files may *also* licensed additionally under
more permissive licenses (LGPLv2.1 in most cases, see below).
### Full text

View File

@ -37,7 +37,7 @@ loc.num = function(numbr)
--~ a negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the minus sign and decimal point with whatever is appropriate for your language.
str = S("@1.@2", pre, post)
else
--~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
--~ a non-negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
str = S("@1.@2", pre, post)
end
elseif negative then

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain rp_localize x.x.x\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: 2024-11-26 15:16+0100\n"
"POT-Creation-Date: 2024-11-28 13:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -28,7 +28,7 @@ msgstr "-@1"
msgid "@1.@2"
msgstr "-@1.@2"
#. ~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#. ~ a non-negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#: mods/rp_localize/init.lua:41
msgid "@1.@2"
msgstr "@1.@2"

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain rp_localize x.x.x\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: 2024-11-26 15:16+0100\n"
"POT-Creation-Date: 2024-11-28 13:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -28,7 +28,7 @@ msgstr "@1"
msgid "@1.@2"
msgstr "@1,@2"
#. ~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#. ~ a non-negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#: mods/rp_localize/init.lua:41
msgid "@1.@2"
msgstr "@1,@2"

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain rp_localize x.x.x\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: 2024-11-26 15:16+0100\n"
"POT-Creation-Date: 2024-11-28 13:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -28,7 +28,7 @@ msgstr ""
msgid "@1.@2"
msgstr ""
#. ~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#. ~ a non-negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#: mods/rp_localize/init.lua:41
msgid "@1.@2"
msgstr ""

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain rp_localize x.x.x\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: 2024-11-26 15:16+0100\n"
"POT-Creation-Date: 2024-11-28 13:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -28,7 +28,7 @@ msgstr ""
msgid "@1.@2"
msgstr ""
#. ~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#. ~ a non-negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#: mods/rp_localize/init.lua:41
msgid "@1.@2"
msgstr ""

View File

@ -28,7 +28,7 @@ msgstr "@1"
msgid "@1.@2"
msgstr "@1,@2"
#. ~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#. ~ a non-negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#: mods/rp_localize/init.lua:41
msgid "@1.@2"
msgstr "@1,@2"

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain rp_localize x.x.x\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: 2024-11-26 15:16+0100\n"
"POT-Creation-Date: 2024-11-28 13:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -28,7 +28,7 @@ msgstr ""
msgid "@1.@2"
msgstr ""
#. ~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#. ~ a non-negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#: mods/rp_localize/init.lua:41
msgid "@1.@2"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Repixture\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: 2024-11-26 15:16+0100\n"
"POT-Creation-Date: 2024-11-28 13:57+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -32,7 +32,7 @@ msgstr ""
msgid "@1.@2"
msgstr ""
#. ~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#. ~ a non-negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#: mods/rp_localize/init.lua:41
msgid "@1.@2"
msgstr ""

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Luanti textdomain rp_localize x.x.x\n"
"Report-Msgid-Bugs-To: Wuzzy@disroot.org\n"
"POT-Creation-Date: 2024-11-26 15:16+0100\n"
"POT-Creation-Date: 2024-11-28 13:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -28,7 +28,7 @@ msgstr "-@1"
msgid "@1.@2"
msgstr "-@1,@2"
#. ~ a positive number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#. ~ a non-negative number with some decimal places. @1 is the part before the decimal point, @2 is the part after it. Replace the decimal point with whatever is appropriate for your language.
#: mods/rp_localize/init.lua:41
msgid "@1.@2"
msgstr "@1,@2"

View File

@ -63,9 +63,8 @@ minetest.register_craftitem(
"rp_mobs_mobs:pork_raw",
{
description = S("Raw Porkchop"),
_tt_food = true,
_tt_food_hp = 4,
_tt_food_satiation = 30,
_rp_hunger_food = 4,
_rp_hunger_sat = 30,
inventory_image = "mobs_pork_raw.png",
groups = { food = 2 },
on_use = minetest.item_eat({hp = 4, sat = 30}),
@ -77,9 +76,8 @@ minetest.register_craftitem(
"rp_mobs_mobs:pork",
{
description = S("Cooked Porkchop"),
_tt_food = true,
_tt_food_hp = 8,
_tt_food_satiation = 50,
_rp_hunger_food = 8,
_rp_hunger_sat = 50,
inventory_image = "mobs_pork_cooked.png",
groups = { food = 2 },
on_use = minetest.item_eat({hp = 8, sat = 50}),

View File

@ -80,7 +80,13 @@ tt.register_snippet(function(itemstring)
if def._tt_food then
desc = S("Food item")
if def._tt_food_hp then
local msg = PS("+@1 food point", "+@1 food points", def._tt_food_hp, def._tt_food_hp)
local msg
if PS then
msg = PS("+@1 food point", "+@1 food points", def._tt_food_hp, def._tt_food_hp)
else
-- fallback when plural forms are unavailable
msg = S("+@1 food points", def._tt_food_hp)
end
desc = desc .. "\n" .. msg
end
end

View File

@ -1,6 +1,12 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##########################################################################
##### PUBLIC DOMAIN ######################################################
# This script is released into the public domain via the CC0 dedication.
# See <https://creativecommons.org/publicdomain/zero/1.0/> for details.
##########################################################################
##########################################################################
##### ABOUT THIS SCRIPT ##################################################
# This script updates the translation template files (*.pot) or
@ -21,6 +27,8 @@
MSGID_BUGS_ADDRESS = "Wuzzy@disroot.org"
# name of the package
PACKAGE_NAME = "Repixture"
# version of the package (optional)
PACKAGE_VERSION = None
import os
import re
@ -63,7 +71,11 @@ def invoke_xgettext(template_file, mod_folder, modname):
lua_search_string = " ".join(lua_files)
command = "xgettext -L lua -kS -kNS -kFS -kNFS -kPS:1,2 -kcore.translate:1c,2 -kcore.translate_n:1c,2,3 -d '"+modname+"' --add-comments='~' -o '"+template_file+"' --from-code=UTF-8 --msgid-bugs-address='"+MSGID_BUGS_ADDRESS+"' --package-name='"+PACKAGE_NAME+"' "+lua_search_string
package_string = "--package-name='"+PACKAGE_NAME+"'"
if PACKAGE_VERSION:
package_string += " --package-version='"+PACKAGE_VERSION+"'"
command = "xgettext -L lua -kS -kNS -kFS -kNFS -kPS:1,2 -kcore.translate:1c,2 -kcore.translate_n:1c,2,3 -d '"+modname+"' --add-comments='~' -o '"+template_file+"' --from-code=UTF-8 --msgid-bugs-address='"+MSGID_BUGS_ADDRESS+"' "+package_string+" "+lua_search_string
return_value = os.system(command)
if return_value != 0: