Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate translations to the Minetest localization format #38

Merged
merged 2 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Translation using MT5 translation api
Fix #36
  • Loading branch information
louisroyer committed Feb 4, 2020
commit c9795fdb07dc0c11eaeebe7f71807c919259a10a
21 changes: 10 additions & 11 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ moreores = {}

local modpath = minetest.get_modpath("moreores")

local S, NS = dofile(modpath .. "/intllib.lua")
local S = minetest.get_translator("moreores")
moreores.S = S
moreores.NS = NS

dofile(modpath .. "/_config.txt")

Expand Down Expand Up @@ -86,7 +85,7 @@ local function add_ore(modname, description, mineral_name, oredef)

if oredef.makes.ore then
minetest.register_node(modname .. ":mineral_" .. mineral_name, {
description = S("%s Ore"):format(S(description)),
description = S("@1 Ore", S(description)),
tiles = {"default_stone.png^" .. modname .. "_mineral_" .. mineral_name .. ".png"},
groups = {cracky = 2},
sounds = default_stone_sounds,
Expand All @@ -101,7 +100,7 @@ local function add_ore(modname, description, mineral_name, oredef)
if oredef.makes.block then
local block_item = item_base .. "_block"
minetest.register_node(block_item, {
description = S("%s Block"):format(S(description)),
description = S("@1 Block", S(description)),
tiles = {img_base .. "_block.png"},
groups = {snappy = 1, bendy = 2, cracky = 1, melty = 2, level = 2},
sounds = default_metal_sounds,
Expand All @@ -126,7 +125,7 @@ local function add_ore(modname, description, mineral_name, oredef)

if oredef.makes.lump then
minetest.register_craftitem(lump_item, {
description = S("%s Lump"):format(S(description)),
description = S("@1 Lump", S(description)),
inventory_image = img_base .. "_lump.png",
})
minetest.register_alias(mineral_name .. "_lump", lump_item)
Expand All @@ -144,7 +143,7 @@ local function add_ore(modname, description, mineral_name, oredef)

if oredef.makes.ingot then
minetest.register_craftitem(ingot, {
description = S("%s Ingot"):format(S(description)),
description = S("@1 Ingot", S(description)),
inventory_image = img_base .. "_ingot.png",
})
minetest.register_alias(mineral_name .. "_ingot", ingot)
Expand Down Expand Up @@ -187,33 +186,33 @@ local function add_ore(modname, description, mineral_name, oredef)
if tool_name == "sword" then
tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval
tdef.tool_capabilities.damage_groups = oredef.damage_groups
tdef.description = S("%s Sword"):format(S(description))
tdef.description = S("@1 Sword", S(description))
end

if tool_name == "pick" then
tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval
tdef.tool_capabilities.damage_groups = oredef.damage_groups
tdef.description = S("%s Pickaxe"):format(S(description))
tdef.description = S("@1 Pickaxe", S(description))
end

if tool_name == "axe" then
tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval
tdef.tool_capabilities.damage_groups = oredef.damage_groups
tdef.description = S("%s Axe"):format(S(description))
tdef.description = S("@1 Axe", S(description))
end

if tool_name == "shovel" then
tdef.full_punch_interval = oredef.full_punch_interval
tdef.tool_capabilities.damage_groups = oredef.damage_groups
tdef.description = S("%s Shovel"):format(S(description))
tdef.description = S("@1 Shovel", S(description))
tdef.wield_image = toolimg_base .. tool_name .. ".png^[transformR90"
end

local fulltool_name = tool_base .. tool_name .. tool_post

if tool_name == "hoe" and minetest.get_modpath("farming") then
tdef.max_uses = tooldef.uses
tdef.description = S("%s Hoe"):format(S(description))
tdef.description = S("@1 Hoe", S(description))
farming.register_hoe(fulltool_name, tdef)
end

Expand Down
44 changes: 0 additions & 44 deletions intllib.lua

This file was deleted.

21 changes: 0 additions & 21 deletions locale/de.txt

This file was deleted.

21 changes: 0 additions & 21 deletions locale/es.txt

This file was deleted.

21 changes: 0 additions & 21 deletions locale/fr.txt

This file was deleted.

21 changes: 0 additions & 21 deletions locale/it.txt

This file was deleted.

22 changes: 22 additions & 0 deletions locale/moreores.de.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# textdomain: moreores

# Translation by Xanthin

[moreores] loaded.=[moreores] geladen.

@1 Ore=@1erz
@1 Lump=@1klumpen
@1 Ingot=@1barren
@1 Block=@1block
@1 Pickaxe=@1spitzhacke
@1 Shovel=@1schaufel
@1 Axe=@1axt
@1 Sword=@1schwert

Copper=Kupfer
Tin=Zinn
Bronze=Bronze
Silver=Silber
Gold=Gold
Mithril=Mithril
Copper Rail=Kupferschiene
20 changes: 20 additions & 0 deletions locale/moreores.en.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# textdomain: moreores

[moreores] loaded.=[moreores] loaded.

@1 Ore=@1 Ore
@1 Lump=@1 Lump
@1 Ingot=@1 Ingot
@1 Block=@1 Block
@1 Pickaxe=@1 Pickaxe
@1 Shovel=@1 Shovel
@1 Axe=@1 Axe
@1 Sword=@1 Sword

Copper=Copper
Tin=Tin
Bronze=Bronze
Silver=Silver
Gold=Gold
Mithril=Mithril
Copper Rail=Copper Rail
22 changes: 22 additions & 0 deletions locale/moreores.es.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# textdomain: moreores

# Translation by kaeza

[moreores] loaded.=[moreores] cargado.

@1 Ore=Mineral de @1
@1 Lump=Pepita de @1
@1 Ingot=Lingote de @1
@1 Block=Bloque de @1
@1 Pickaxe=Pico de @1
@1 Shovel=Pala de @1
@1 Axe=Hacha de @1
@1 Sword=Espada de @1

Copper=cobre
Tin=estaño
Bronze=bronce
Silver=plata
Gold=oro
Mithril=mitrilo
Copper Rail=Riel de Cobre
22 changes: 22 additions & 0 deletions locale/moreores.fr.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# textdomain: moreores

# Translation by Calinou

[moreores] loaded.=[moreores] a été chargé.

@1 Ore=Minerai en @1
@1 Lump=Roche en @1
@1 Ingot=Lingot en @1
@1 Block=Bloc en @1
@1 Pickaxe=Pioche en @1
@1 Shovel=Pelle en @1
@1 Axe=Hache en @1
@1 Sword=Épée en @1

Copper=cuivre
Tin=étain
Bronze=bronze
Silver=argent
Gold=or
Mithril=mithril
Copper Rail=Rail en cuivre
22 changes: 22 additions & 0 deletions locale/moreores.it.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# textdomain: moreores

# Translation by Pagliaccio

[moreores] loaded.=[moreores] caricato.

@1 Ore=Minerale di @1
@1 Lump=@1 grezzo
@1 Ingot=Lingotto di @1
@1 Block=Blocco di @1
@1 Pickaxe=Piccone di @1
@1 Shovel=Badile di @1
@1 Axe=Ascia di @1
@1 Sword=Spada di @1

Copper=Rame
Tin=Stagno
Bronze=Bronzo
Silver=Argento
Gold=Oro
Mithril=Mithril
Copper Rail=Binario di rame
19 changes: 19 additions & 0 deletions locale/moreores.nl.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# textdomain: moreores

[moreores] loaded.=[moreores] geladen.

@1 Ore=@1 Erts
@1 Lump=@1 Klomp
@1 Ingot=@1 Staaf
@1 Block=@1 Blok
@1 Pickaxe=@1 Pikhouweel
@1 Shovel=@1 Schep
@1 Axe=@1 Bijl
@1 Sword=@1 Zwaard

Copper=Koper
Tin=Tin
Bronze=Brons
Silver=Silver
Gold=Goud
Mithril=Mithril
22 changes: 22 additions & 0 deletions locale/moreores.pl.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# textdomain: moreores

# Translation by mat9117

[moreores] loaded.=[moreores] załadowano.

@1 Ore=@1 Ruda
@1 Lump=@1 Bryłka
@1 Ingot=@1 Sztabka
@1 Block=@1 Blok
@1 Pickaxe=@1 Kilof
@1 Shovel=@1 Łopatka
@1 Axe=@1 Siekiera
@1 Sword=@1 Miecz

Copper=Miedź
Tin=Cyna
Bronze=Brąz
Silver=Srebro
Gold=Złoto
Mithril=Mithril
Copper Rail=Miedziany tor
23 changes: 23 additions & 0 deletions locale/moreores.pt_br.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# textdomain: moreores

# Translation by github.com/caiorrs

[moreores] loaded.=[moreores] carregado.

@1 Ore=Minério de @1
@1 Lump=Pepita de @1
@1 Ingot=Lingote de @1
@1 Block=Bloco de @1
@1 Pickaxe=Picareta de @1
@1 Shovel=Pá de @1
@1 Axe=Machado de @1
@1 Sword=Espada de @1

Copper=Cobre
Tin=Estanho
Bronze=Bronze
Silver=Prata
Gold=Ouro
Mithril=Mitrilo

Copper Rail=Trilho de Cobre
Loading