Skip to content

Commit d8fac11

Browse files
committed
Use Minetest's built-in translation library
1 parent 9c569da commit d8fac11

File tree

7 files changed

+134
-152
lines changed

7 files changed

+134
-152
lines changed

cgpsmap.lua

+1-12
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,7 @@
77
local growing_wall_maps=false
88

99

10-
-- Boilerplate to support localized strings if intllib mod is installed.
11-
local S
12-
if (minetest.global_exists("intllib")) then
13-
dofile(minetest.get_modpath("intllib").."/intllib.lua")
14-
if (intllib.make_gettext_pair) then
15-
S = intllib.make_gettext_pair(minetest.get_current_modname())
16-
else
17-
S = intllib.Getter(minetest.get_current_modname())
18-
end
19-
else
20-
S = function ( s ) return s end
21-
end
10+
local S = minetest.get_translator(minetest.get_current_modname())
2211

2312

2413
local selected_cgpsmap = {}

depends.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
default
2-
intllib?
32
craft_guide?

init.lua

+1-11
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,7 @@
1414
--added pos and distance to display list
1515
--added hud showing current pos -> target pos : distance
1616

17-
-- Boilerplate to support localized strings if intllib mod is installed.
18-
local S
19-
if (minetest.global_exists("intllib")) then
20-
if (intllib.make_gettext_pair) then
21-
S = intllib.make_gettext_pair()
22-
else
23-
S = intllib.Getter()
24-
end
25-
else
26-
S = function ( s ) return s end
27-
end
17+
local S = minetest.get_translator(minetest.get_current_modname())
2818

2919
local hud_default_x=0.4
3020
local hud_default_y=0.01

locale/compassgps.de.tr

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
2+
Can create shared bookmarks for use by anyone with a compassgps=
3+
bkmrkidx\=nil=bkmrkidx\=nil
4+
playername\=%s=playername\=%s
5+
playername\=nil=playername\=nil
6+
%s's map=Karte von %s
7+
A bookmark with the name '%s' can't be created.=Ein weiterer Wegpunkt mit dem Namen '%s' kann nicht erstellt werden.
8+
Admin=Administrator
9+
Bookmark '%s' added at %s type\=%s=Wegpunkt '%s' wurde bei %s vom Typ %s erstellt.
10+
Change hud:=Ändere HUD:
11+
Color:=Farbe:
12+
Dist:=Entfernung:
13+
Compass Type:=Kompasstyp:
14+
Give the bookmark a name.=Geben Sie dem Wegpunkt einen Namen
15+
Lets the compassgps point to the bookmark=Lässt den Kompass auf den Wegpunkt zeigen.
16+
No=Nein
17+
No bookmark was specified.=Kein Wegpunkt wurde angegegeben.
18+
Pointing at %s.=Zeige auf %s.
19+
Pointing at default location.=Zeige auf die Standardposition.
20+
Private=Privat
21+
Remove bookmark: =Entferne Wegpunkt:
22+
Removes the bookmark specified by <bookmark_name>=Entfernt den Wegpunkt der mit <bookmark_name> angegeben ist.
23+
Settings=Einstellungen
24+
Shared=Geteilt
25+
Show:=Zeige:
26+
Sort by:=Sortiere nach:
27+
Teleporting to %s=Teleportiere zu %s
28+
The bookmark =Der Wegpunkt
29+
The maximum number of shared bookmarks any user can create is %d.=Jeder Nutzer kann nur %d geteilte Wegpunkte erstellen.
30+
Yes=Ja
31+
You already have a bookmark with that name.=Sie haben bereits einen Wegpunkt mit diesem Namen.
32+
You have no bookmark with this name.=Sie haben keinen Wegpunkt mit diesem Namen.
33+
bookmark=Wegpunkt
34+
compassgps reading bookmarks=compassgps liest die Wegpunkte.
35+
compassgps reading settings=compassgps liest die Einstellungen.
36+
compassgps=Kompass
37+
compassgps teleporting player %s to %s=compassgps teleportiert Spieler %s nach %s.
38+
compassgps writing settings=compassgps schreibt die Einstellungen.
39+
compassgps.%s invalid bkrmkidx=compassgps.%s ungültige bkmrkidx.
40+
compassgps.%s invalid bookmark playername\=%s bkmrkid\=%s=compassgps.%s ungültiger Wegpunkt Spielername\=%s bkmrkidx\=%s.
41+
compassgps.%s player not found=compassgps.%s Spieler nicht gefunden.
42+
compassgps: hud color not valid hex number=compassgps: HUD Farbe ist keine zulässige Hexadezimalzahl.
43+
compassgps: hud coords are not numeric. Change to between 0 and 1=compassgps: HUD Koordinaten sind keine Zahlen. Ändern sie diese zu Werten zwischen 0 und 1.
44+
compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore=compassgps: HUD Koordinaten sind außerhalb des zulässigen Bereichs. Ändern sie diese zu Werten zwischen 0 und 1 um das HUD wiederherzustellen.
45+
compassgps:%s invalid bookmark=compassgps.%s ungültiger Wegpunkt
46+
Create admin=Erstelle Administratorwegpunkt
47+
Create bookmark=Erstelle Wegpunkt
48+
Create shared=Erstelle geteilten Wegpunkt
49+
current position : =Momentane Position :
50+
distance=Entfernung
51+
Show selected bookmark=Zeigen den ausgewählten Wegpunkt
52+
list_bookmarks: Lists all bookmarks of a player=list_bookmarks: Zeigt alle Wegpunkte eines Spielers.
53+
name=Name
54+
Remove bookmark=Entferne den Wegpunkt
55+
remove bookmark playername\=%s bkmrkidx\=%s=Entferne den Wegpunkt Spielername\=%s bkmrkidx\=%s
56+
removed %s=%s entfernt.
57+
set_bookmark: Sets a location bookmark for the player=set_bookmark: Setzt einen Wegpunkt für den Spieler.
58+
teleport to bookmark=Teleportiere zu dem Wegpunkt.
59+
you can not remove someone elses bookmark:=Sie können den Wegpunkt eines anderen Spielers nicht entfernen:
60+
CompassGPS Map (blank)=CompassGPS Karte (leer)
61+
CompassGPS Map (marked)=CompassGPS Karte (markiert)
62+
Write to cgpsmap=Schreibe auf die Karte
63+
Copy bookmark to compassgps=Kopiere den Wegpunkt in Kompass.
64+
Bookmark name:=Name des Wegpunkts:
65+
Bookmark pos:=Position des Wegpunkts:
66+
Rename bookmark=Lesezeichen umbenennen

locale/de.txt

-64
This file was deleted.

locale/template.txt

+65-63
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,65 @@
1-
bkmrkidx\=nil =
2-
playername\=%s =
3-
playername\=nil =
4-
%s's map =
5-
A bookmark with the name '%s' can't be created. =
6-
Admin =
7-
Bookmark '%s' added at %s type\=%s =
8-
Change hud: =
9-
Color: =
10-
Dist: =
11-
Compass Type: =
12-
Give the bookmark a name. =
13-
Lets the compassgps point to the bookmark =
14-
No =
15-
No bookmark was specified. =
16-
Pointing at %s. =
17-
Pointing at default location. =
18-
Private =
19-
Remove bookmark: =
20-
Removes the bookmark specified by <bookmark_name> =
21-
Settings =
22-
Shared =
23-
Show: =
24-
Sort by: =
25-
Teleporting to %s =
26-
The bookmark =
27-
The maximum number of shared bookmarks any user can create is %d. =
28-
Yes =
29-
You already have a bookmark with that name. =
30-
You have no bookmark with this name. =
31-
bookmark =
32-
compassgps reading bookmarks =
33-
compassgps reading settings =
34-
compassgps =
35-
compassgps teleporting player %s to %s =
36-
compassgps writing settings =
37-
compassgps.%s invalid bkrmkidx =
38-
compassgps.%s invalid bookmark playername\=%s bkmrkid\=%s =
39-
compassgps.%s player not found =
40-
compassgps: hud color not valid hex number =
41-
compassgps: hud coords are not numeric. Change to between 0 and 1 =
42-
compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore =
43-
compassgps:%s invalid bookmark =
44-
create admin =
45-
create bookmark =
46-
create shared =
47-
current position : =
48-
distance =
49-
find selected bookmark =
50-
list_bookmarks: Lists all bookmarks of a player =
51-
name =
52-
remove bookmark =
53-
remove bookmark playername\=%s bkmrkidx\=%s =
54-
removed %s =
55-
set_bookmark: Sets a location bookmark for the player =
56-
teleport to bookmark =
57-
you can not remove someone elses bookmark: =
58-
CompassGPS Map (blank) =
59-
CompassGPS Map (marked) =
60-
Write to cgpsmap =
61-
copy bookmark to your compassgps =
62-
bookmark name: =
63-
bookmark pos: =
1+
2+
Can create shared bookmarks for use by anyone with a compassgps=
3+
bkmrkidx\=nil=
4+
playername\=%s=
5+
playername\=nil=
6+
%s's map=
7+
A bookmark with the name '%s' can't be created.=
8+
Admin=
9+
Bookmark '%s' added at %s type\=%s=
10+
Change hud:=
11+
Color:=
12+
Dist:=
13+
Compass Type:=
14+
Give the bookmark a name.=
15+
Lets the compassgps point to the bookmark=
16+
No=
17+
No bookmark was specified.=
18+
Pointing at %s.=
19+
Pointing at default location.=
20+
Private=
21+
Remove bookmark: =
22+
Removes the bookmark specified by <bookmark_name>=
23+
Settings=
24+
Shared=
25+
Show:=
26+
Sort by:=
27+
Teleporting to %s=
28+
The bookmark =
29+
The maximum number of shared bookmarks any user can create is %d.=
30+
Yes=
31+
You already have a bookmark with that name.=
32+
You have no bookmark with this name.=
33+
bookmark=
34+
compassgps reading bookmarks=
35+
compassgps reading settings=
36+
compassgps=
37+
compassgps teleporting player %s to %s=
38+
compassgps writing settings=
39+
compassgps.%s invalid bkrmkidx=
40+
compassgps.%s invalid bookmark playername\=%s bkmrkid\=%s=
41+
compassgps.%s player not found=
42+
compassgps: hud color not valid hex number=
43+
compassgps: hud coords are not numeric. Change to between 0 and 1=
44+
compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore=
45+
compassgps:%s invalid bookmark=
46+
create admin=
47+
create bookmark=
48+
create shared=
49+
current position : =
50+
distance=
51+
find selected bookmark=
52+
list_bookmarks: Lists all bookmarks of a player=
53+
name=
54+
remove bookmark=
55+
remove bookmark playername\=%s bkmrkidx\=%s=
56+
removed %s=
57+
set_bookmark: Sets a location bookmark for the player=
58+
teleport to bookmark=
59+
you can not remove someone elses bookmark:=
60+
CompassGPS Map (blank)=
61+
CompassGPS Map (marked)=
62+
Write to cgpsmap=
63+
copy bookmark to your compassgps=
64+
bookmark name:=
65+
bookmark pos:=

mod.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name = compassgps
22
description = A customizable compass with user settable bookmarks.
33
depends = default
4-
optional_depends = intllib, craft_guide
4+
optional_depends = craft_guide

0 commit comments

Comments
 (0)