Fix strings (translations and checks)
This commit is contained in:
parent
720029a73e
commit
95ab299016
@ -1,28 +1,33 @@
|
|||||||
# textdomain: mail
|
# textdomain: mail
|
||||||
|
Provided my mt-mods=
|
||||||
|
Version=
|
||||||
|
Licenses=
|
||||||
|
Expat (code), WTFPL (textures)=
|
||||||
|
Communication using this system is NOT guaranteed to be private!=
|
||||||
|
Admins are able to view the messages of any player.=
|
||||||
|
Contributors=
|
||||||
|
Note=Notiz
|
||||||
BCC=BCC
|
BCC=BCC
|
||||||
Cancel=Abbrechen
|
Cancel=Abbrechen
|
||||||
Save draft=Entwurf Speichern
|
Save draft=Entwurf Speichern
|
||||||
Send=Senden
|
Send=Senden
|
||||||
Edit=Bearbeiten
|
CC=CC
|
||||||
|
Subject=Betreff
|
||||||
|
To=An
|
||||||
|
Back=Zurück
|
||||||
New=Neu
|
New=Neu
|
||||||
Delete=Löschen
|
Delete=Löschen
|
||||||
No drafts=Keine Entwürfe
|
No drafts=Keine Entwürfe
|
||||||
Player name=Spielername
|
Player name=Spielername
|
||||||
your contacts.=ihre Kontakte.
|
That name is already in your contacts=
|
||||||
The contact=Der Kontakt
|
The contact name cannot be empty.=
|
||||||
Maillist name=Verteilerlistenname
|
Maillist name=Verteilerlistenname
|
||||||
Desc=Beschreibung
|
Desc=Beschreibung
|
||||||
Players=Spieler
|
Players=Spieler
|
||||||
your maillists.=ihre Verteilerlisten.
|
That name is already in your mailing lists.=
|
||||||
The maillist=Die Verteilerliste
|
The mailing list name cannot be empty.=
|
||||||
Save=Speichern
|
|
||||||
That name=Der Name
|
|
||||||
is already in=ist bereits in
|
|
||||||
name cannot=Name kann nicht
|
|
||||||
be empty.=leer sein.
|
|
||||||
Mark Read=Als gelesen makieren
|
Mark Read=Als gelesen makieren
|
||||||
Mark Unread=Als ungelesen makieren
|
Mark Unread=Als ungelesen makieren
|
||||||
From=Von
|
|
||||||
Read=Lesen
|
Read=Lesen
|
||||||
Filter=
|
Filter=
|
||||||
Allow multiple selection=
|
Allow multiple selection=
|
||||||
@ -31,7 +36,12 @@ selected=
|
|||||||
No mail=Keine Nachrichten
|
No mail=Keine Nachrichten
|
||||||
(No description)=(Keine Beschreibung)
|
(No description)=(Keine Beschreibung)
|
||||||
No maillist=Keine Verteilerliste
|
No maillist=Keine Verteilerliste
|
||||||
Subject=Betreff
|
Edit=Bearbeiten
|
||||||
|
Name=Name
|
||||||
|
From=Von
|
||||||
|
Reply=Antworten
|
||||||
|
Reply all=Allen antworten
|
||||||
|
Forward=Weiter
|
||||||
Inbox=Posteingang
|
Inbox=Posteingang
|
||||||
Sent messages=Nachrichten senden
|
Sent messages=Nachrichten senden
|
||||||
Drafts=Entwürfe
|
Drafts=Entwürfe
|
||||||
@ -40,16 +50,8 @@ Mail lists=Verteilerlisten
|
|||||||
Options=
|
Options=
|
||||||
Close=Schließen
|
Close=Schließen
|
||||||
(No subject)=(Kein Betreff)
|
(No subject)=(Kein Betreff)
|
||||||
Reply=Antworten
|
|
||||||
Reply all=Allen antworten
|
|
||||||
Forward=Weiter
|
|
||||||
Add=Hinzufügen
|
Add=Hinzufügen
|
||||||
Remove=Entfernen
|
Remove=Entfernen
|
||||||
CC=CC
|
|
||||||
Note=Notiz
|
|
||||||
Back=Zurück
|
|
||||||
Name=Name
|
|
||||||
To=An
|
|
||||||
Notifications=
|
Notifications=
|
||||||
Chat notifications=
|
Chat notifications=
|
||||||
On join notifications=
|
On join notifications=
|
||||||
@ -58,10 +60,23 @@ Message list=
|
|||||||
Show unread in different color=
|
Show unread in different color=
|
||||||
Show CC/BCC in different color=
|
Show CC/BCC in different color=
|
||||||
Default sorting fields=
|
Default sorting fields=
|
||||||
From/To=
|
From/To=Von/An
|
||||||
Reset=
|
Reset=
|
||||||
Settings=
|
Settings=
|
||||||
About=Über
|
About=Über
|
||||||
|
Save=Speichern
|
||||||
Ascending=
|
Ascending=
|
||||||
Descending=
|
Descending=
|
||||||
Date=Datum
|
Date=Datum
|
||||||
|
|
||||||
|
|
||||||
|
##### not used anymore #####
|
||||||
|
|
||||||
|
That name=Der Name
|
||||||
|
is already in=ist bereits in
|
||||||
|
your maillists.=ihre Verteilerlisten.
|
||||||
|
The maillist=Die Verteilerliste
|
||||||
|
name cannot=Name kann nicht
|
||||||
|
be empty.=leer sein.
|
||||||
|
your contacts.=ihre Kontakte.
|
||||||
|
The contact=Der Kontakt
|
||||||
|
@ -1,28 +1,33 @@
|
|||||||
# textdomain: mail
|
# textdomain: mail
|
||||||
|
Provided my mt-mods=Fourni par mt-mods
|
||||||
|
Version=Version
|
||||||
|
Licenses=Licences
|
||||||
|
Expat (code), WTFPL (textures)=Expat (code), WTFPL (textures)
|
||||||
|
Communication using this system is NOT guaranteed to be private!=La communication par ce système n'est pas garantie d'être privée !
|
||||||
|
Admins are able to view the messages of any player.=Les administrateurs peuvent voir les messages de chaque joueur.
|
||||||
|
Contributors=Contributeurs
|
||||||
|
Note=Note
|
||||||
BCC=Cci
|
BCC=Cci
|
||||||
Cancel=Annuler
|
Cancel=Annuler
|
||||||
Save draft=Enregistrer le brouillon
|
Save draft=Enregistrer le brouillon
|
||||||
Send=Envoyer
|
Send=Envoyer
|
||||||
Edit=Modifier
|
CC=Cc
|
||||||
|
Subject=Objet
|
||||||
|
To=À
|
||||||
|
Back=Retour
|
||||||
New=Nouveau
|
New=Nouveau
|
||||||
Delete=Supprimer
|
Delete=Supprimer
|
||||||
No drafts=Pas de brouillons
|
No drafts=Pas de brouillons
|
||||||
Player name=Nom du joueur
|
Player name=Nom du joueur
|
||||||
your contacts.=vos contacts.
|
That name is already in your contacts=Ce nom est déjà dans vos contacts
|
||||||
The contact=Ce contact
|
The contact name cannot be empty.=Le nom du contact ne peut pas être vide.
|
||||||
Maillist name=Nom de la liste de diffusion
|
Maillist name=Nom de la liste de diffusion
|
||||||
Desc=Desc
|
Desc=Desc
|
||||||
Players=Joueurs
|
Players=Joueurs
|
||||||
your maillists.=vos listes de diffusion.
|
That name is already in your mailing lists.=Ce nom est déjà dans vos listes de diffusion.
|
||||||
The maillist=Cette liste de diffusion
|
The mailing list name cannot be empty.=Le nom de la liste de diffusion ne peut pas être vide.
|
||||||
Save=Sauvegarder
|
|
||||||
That name=Ce nom
|
|
||||||
is already in=existe déjà
|
|
||||||
name cannot=nom ne peut pas
|
|
||||||
be empty.=être vide.
|
|
||||||
Mark Read=Marquer comme lu
|
Mark Read=Marquer comme lu
|
||||||
Mark Unread=Marquer non lu
|
Mark Unread=Marquer non lu
|
||||||
From=De
|
|
||||||
Read=Lire
|
Read=Lire
|
||||||
Filter=Filtre
|
Filter=Filtre
|
||||||
Allow multiple selection=Autoriser la sélection multiple
|
Allow multiple selection=Autoriser la sélection multiple
|
||||||
@ -31,7 +36,12 @@ selected=sélectionnés
|
|||||||
No mail=Aucun mail
|
No mail=Aucun mail
|
||||||
(No description)=Sans description
|
(No description)=Sans description
|
||||||
No maillist=Aucune liste de diffusion
|
No maillist=Aucune liste de diffusion
|
||||||
Subject=Objet
|
Edit=Modifier
|
||||||
|
Name=Nom
|
||||||
|
From=De
|
||||||
|
Reply=Répondre
|
||||||
|
Reply all=Répondre à tous
|
||||||
|
Forward=Transférer
|
||||||
Inbox=Boîte de réception
|
Inbox=Boîte de réception
|
||||||
Sent messages=Messages envoyés
|
Sent messages=Messages envoyés
|
||||||
Drafts=Brouillons
|
Drafts=Brouillons
|
||||||
@ -40,16 +50,8 @@ Mail lists=Listes de diffusion
|
|||||||
Options=Options
|
Options=Options
|
||||||
Close=Fermer
|
Close=Fermer
|
||||||
(No subject)=(Sans objet)
|
(No subject)=(Sans objet)
|
||||||
Reply=Répondre
|
|
||||||
Reply all=Répondre à tous
|
|
||||||
Forward=Transférer
|
|
||||||
Add=Ajouter
|
Add=Ajouter
|
||||||
Remove=Enlever
|
Remove=Enlever
|
||||||
CC=Cc
|
|
||||||
Note=Note
|
|
||||||
Back=Retour
|
|
||||||
Name=Nom
|
|
||||||
To=À
|
|
||||||
Notifications=Notifications
|
Notifications=Notifications
|
||||||
Chat notifications=Notifications dans le tchat
|
Chat notifications=Notifications dans le tchat
|
||||||
On join notifications=Notifications à la connexion
|
On join notifications=Notifications à la connexion
|
||||||
@ -62,6 +64,7 @@ From/To=De/À
|
|||||||
Reset=Réinitialiser
|
Reset=Réinitialiser
|
||||||
Settings=Paramètres
|
Settings=Paramètres
|
||||||
About=À propos
|
About=À propos
|
||||||
|
Save=Sauvegarder
|
||||||
Ascending=Croissant
|
Ascending=Croissant
|
||||||
Descending=Décroissant
|
Descending=Décroissant
|
||||||
Date=Date
|
Date=Date
|
||||||
|
@ -1,28 +1,33 @@
|
|||||||
# textdomain: mail
|
# textdomain: mail
|
||||||
|
Provided my mt-mods=
|
||||||
|
Version=
|
||||||
|
Licenses=
|
||||||
|
Expat (code), WTFPL (textures)=
|
||||||
|
Communication using this system is NOT guaranteed to be private!=
|
||||||
|
Admins are able to view the messages of any player.=
|
||||||
|
Contributors=
|
||||||
|
Note=備註
|
||||||
BCC=密件副本
|
BCC=密件副本
|
||||||
Cancel=取消
|
Cancel=取消
|
||||||
Save draft=儲存草稿
|
Save draft=儲存草稿
|
||||||
Send=發送
|
Send=發送
|
||||||
Edit=編輯
|
CC=副本
|
||||||
|
Subject=主旨
|
||||||
|
To=收件人
|
||||||
|
Back=返回
|
||||||
New=新建
|
New=新建
|
||||||
Delete=刪除
|
Delete=刪除
|
||||||
No drafts=沒有草稿
|
No drafts=沒有草稿
|
||||||
Player name=玩家名稱
|
Player name=玩家名稱
|
||||||
your contacts.=
|
That name is already in your contacts=
|
||||||
The contact=
|
The contact name cannot be empty.=
|
||||||
Maillist name=郵件列表名稱
|
Maillist name=郵件列表名稱
|
||||||
Desc=描述
|
Desc=描述
|
||||||
Players=玩家
|
Players=玩家
|
||||||
your maillists.=
|
That name is already in your mailing lists.=
|
||||||
The maillist=
|
The mailing list name cannot be empty.=
|
||||||
Save=儲存
|
|
||||||
That name=
|
|
||||||
is already in=
|
|
||||||
name cannot=
|
|
||||||
be empty.=
|
|
||||||
Mark Read=標記已讀
|
Mark Read=標記已讀
|
||||||
Mark Unread=標記未讀
|
Mark Unread=標記未讀
|
||||||
From=寄件者
|
|
||||||
Read=閱讀
|
Read=閱讀
|
||||||
Filter=
|
Filter=
|
||||||
Allow multiple selection=
|
Allow multiple selection=
|
||||||
@ -31,7 +36,12 @@ selected=
|
|||||||
No mail=沒有郵件
|
No mail=沒有郵件
|
||||||
(No description)=(沒有描述)
|
(No description)=(沒有描述)
|
||||||
No maillist=沒有郵件列表
|
No maillist=沒有郵件列表
|
||||||
Subject=主旨
|
Edit=編輯
|
||||||
|
Name=名稱
|
||||||
|
From=寄件者
|
||||||
|
Reply=回覆
|
||||||
|
Reply all=回覆所有人
|
||||||
|
Forward=轉寄
|
||||||
Inbox=收件箱
|
Inbox=收件箱
|
||||||
Sent messages=寄件備份
|
Sent messages=寄件備份
|
||||||
Drafts=草稿
|
Drafts=草稿
|
||||||
@ -40,16 +50,8 @@ Mail lists=郵件列表
|
|||||||
Options=
|
Options=
|
||||||
Close=關閉
|
Close=關閉
|
||||||
(No subject)=(沒有主旨)
|
(No subject)=(沒有主旨)
|
||||||
Reply=回覆
|
|
||||||
Reply all=回覆所有人
|
|
||||||
Forward=轉寄
|
|
||||||
Add=加入
|
Add=加入
|
||||||
Remove=移除
|
Remove=移除
|
||||||
CC=副本
|
|
||||||
Note=備註
|
|
||||||
Back=返回
|
|
||||||
Name=名稱
|
|
||||||
To=收件人
|
|
||||||
Notifications=
|
Notifications=
|
||||||
Chat notifications=
|
Chat notifications=
|
||||||
On join notifications=
|
On join notifications=
|
||||||
@ -62,6 +64,7 @@ From/To=
|
|||||||
Reset=
|
Reset=
|
||||||
Settings=
|
Settings=
|
||||||
About=關於
|
About=關於
|
||||||
|
Save=儲存
|
||||||
Ascending=
|
Ascending=
|
||||||
Descending=
|
Descending=
|
||||||
Date=日期
|
Date=日期
|
||||||
|
@ -1,28 +1,33 @@
|
|||||||
# textdomain: mail
|
# textdomain: mail
|
||||||
|
Provided my mt-mods=
|
||||||
|
Version=
|
||||||
|
Licenses=
|
||||||
|
Expat (code), WTFPL (textures)=
|
||||||
|
Communication using this system is NOT guaranteed to be private!=
|
||||||
|
Admins are able to view the messages of any player.=
|
||||||
|
Contributors=
|
||||||
|
Note=
|
||||||
BCC=
|
BCC=
|
||||||
Cancel=
|
Cancel=
|
||||||
Save draft=
|
Save draft=
|
||||||
Send=
|
Send=
|
||||||
Edit=
|
CC=
|
||||||
|
Subject=
|
||||||
|
To=
|
||||||
|
Back=
|
||||||
New=
|
New=
|
||||||
Delete=
|
Delete=
|
||||||
No drafts=
|
No drafts=
|
||||||
Player name=
|
Player name=
|
||||||
your contacts.=
|
That name is already in your contacts=
|
||||||
The contact=
|
The contact name cannot be empty.=
|
||||||
Maillist name=
|
Maillist name=
|
||||||
Desc=
|
Desc=
|
||||||
Players=
|
Players=
|
||||||
your maillists.=
|
That name is already in your mailing lists.=
|
||||||
The maillist=
|
The mailing list name cannot be empty.=
|
||||||
Save=
|
|
||||||
That name=
|
|
||||||
is already in=
|
|
||||||
name cannot=
|
|
||||||
be empty.=
|
|
||||||
Mark Read=
|
Mark Read=
|
||||||
Mark Unread=
|
Mark Unread=
|
||||||
From=
|
|
||||||
Read=
|
Read=
|
||||||
Filter=
|
Filter=
|
||||||
Allow multiple selection=
|
Allow multiple selection=
|
||||||
@ -31,7 +36,12 @@ selected=
|
|||||||
No mail=
|
No mail=
|
||||||
(No description)=
|
(No description)=
|
||||||
No maillist=
|
No maillist=
|
||||||
Subject=
|
Edit=
|
||||||
|
Name=
|
||||||
|
From=
|
||||||
|
Reply=
|
||||||
|
Reply all=
|
||||||
|
Forward=
|
||||||
Inbox=
|
Inbox=
|
||||||
Sent messages=
|
Sent messages=
|
||||||
Drafts=
|
Drafts=
|
||||||
@ -40,16 +50,8 @@ Mail lists=
|
|||||||
Options=
|
Options=
|
||||||
Close=
|
Close=
|
||||||
(No subject)=
|
(No subject)=
|
||||||
Reply=
|
|
||||||
Reply all=
|
|
||||||
Forward=
|
|
||||||
Add=
|
Add=
|
||||||
Remove=
|
Remove=
|
||||||
CC=
|
|
||||||
Note=
|
|
||||||
Back=
|
|
||||||
Name=
|
|
||||||
To=
|
|
||||||
Notifications=
|
Notifications=
|
||||||
Chat notifications=
|
Chat notifications=
|
||||||
On join notifications=
|
On join notifications=
|
||||||
@ -62,6 +64,7 @@ From/To=
|
|||||||
Reset=
|
Reset=
|
||||||
Settings=
|
Settings=
|
||||||
About=
|
About=
|
||||||
|
Save=
|
||||||
Ascending=
|
Ascending=
|
||||||
Descending=
|
Descending=
|
||||||
Date=
|
Date=
|
||||||
|
11
storage.lua
11
storage.lua
@ -178,6 +178,17 @@ function mail.get_contacts(playername)
|
|||||||
return entry.contacts
|
return entry.contacts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- get a contact
|
||||||
|
function mail.get_contact(playername, contactname)
|
||||||
|
local entry = mail.get_storage_entry(playername)
|
||||||
|
for _, existing_contact in ipairs(entry.contacts) do
|
||||||
|
if existing_contact.name == contactname then
|
||||||
|
return existing_contact
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
-- returns the maillists of a player
|
-- returns the maillists of a player
|
||||||
function mail.get_maillists(playername)
|
function mail.get_maillists(playername)
|
||||||
local entry = mail.get_storage_entry(playername)
|
local entry = mail.get_storage_entry(playername)
|
||||||
|
16
ui/about.lua
16
ui/about.lua
@ -9,19 +9,19 @@ function mail.show_about(name)
|
|||||||
tabheader[0.3,1;optionstab;]] .. S("Settings") .. "," .. S("About") .. [[;2;false;false]
|
tabheader[0.3,1;optionstab;]] .. S("Settings") .. "," .. S("About") .. [[;2;false;false]
|
||||||
button[9.35,0;0.75,0.5;back;X]
|
button[9.35,0;0.75,0.5;back;X]
|
||||||
label[0,0.8;Mail]
|
label[0,0.8;Mail]
|
||||||
label[0,1.2;Provided my mt-mods]
|
label[0,1.2;]] .. S("Provided my mt-mods") .. [[]
|
||||||
label[0,1.6;Version: 1.2.0-dev]
|
label[0,1.6;]] .. S("Version") .. [[ : 1.2.0-dev]
|
||||||
label[0,2.2;Licenses:]
|
label[0,2.2;]] .. S("Licenses") .. [[ :]
|
||||||
label[0.2,2.6;Expat (code), WTFPL (textures)]
|
label[0.2,2.6;]] .. S("Expat (code), WTFPL (textures)") .. [[]
|
||||||
label[0,3.2;https://github.com/mt-mods/mail]
|
label[0,3.2;https://github.com/mt-mods/mail]
|
||||||
label[0,3.6;https://content.minetest.net/packages/mt-mods/mail]
|
label[0,3.6;https://content.minetest.net/packages/mt-mods/mail]
|
||||||
textarea[0.5,4.8;4,5.5;;Note;]] ..
|
textarea[0.5,4.8;4,5.5;;]] .. S("Note") .. [[;]] ..
|
||||||
[[NOTE: Communication using this system is NOT guaranteed to be private!]] ..
|
S("Communication using this system is NOT guaranteed to be private!") .. " " ..
|
||||||
[[ Admins are able to view the messages of any player.]
|
S("Admins are able to view the messages of any player.") .. [[]
|
||||||
|
|
||||||
tablecolumns[color;text;text]
|
tablecolumns[color;text;text]
|
||||||
table[5,0.75;4.9,5.5;contributors;]] ..
|
table[5,0.75;4.9,5.5;contributors;]] ..
|
||||||
[[#999,Contributors,,]] ..
|
[[#999,]] .. S("Contributors") .. [[,,]] ..
|
||||||
[[#FFD700,Cheapie,Initial idea/project,]] ..
|
[[#FFD700,Cheapie,Initial idea/project,]] ..
|
||||||
[[#FFF,Rubenwardy,Lua/UI improvements,]] ..
|
[[#FFF,Rubenwardy,Lua/UI improvements,]] ..
|
||||||
[[#FFF,BuckarooBanzay,Clean-ups\, Refactoring,]] ..
|
[[#FFF,BuckarooBanzay,Clean-ups\, Refactoring,]] ..
|
||||||
|
@ -29,7 +29,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
local evt = minetest.explode_table_event(fields.contacts)
|
local evt = minetest.explode_table_event(fields.contacts)
|
||||||
for k, _, i in mail.pairsByKeys(contacts) do
|
for k, _, i in mail.pairsByKeys(contacts) do
|
||||||
if i == evt.row - 1 then
|
if i == evt.row - 1 then
|
||||||
mail.selected_idxs.contacts[name] = k
|
mail.selected_idxs.contacts[name] = tonumber(k)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -60,14 +60,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
local last = nil
|
local last = nil
|
||||||
for k in mail.pairsByKeys(contacts) do
|
for k in mail.pairsByKeys(contacts) do
|
||||||
if found then
|
if found then
|
||||||
mail.selected_idxs.contacts[name] = k
|
mail.selected_idxs.contacts[name] = tonumber(k)
|
||||||
break
|
break
|
||||||
elseif k == mail.selected_idxs.contacts[name] then
|
elseif k == mail.selected_idxs.contacts[name] then
|
||||||
mail.delete_contact(name, contacts[mail.selected_idxs.contacts[name]].name)
|
mail.delete_contact(name, contacts[mail.selected_idxs.contacts[name]].name)
|
||||||
mail.selected_idxs.contacts[name] = nil
|
mail.selected_idxs.contacts[name] = nil
|
||||||
found = true
|
found = true
|
||||||
else
|
else
|
||||||
last = k
|
last = tonumber(k)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if found and not mail.selected_idxs.contacts[name] then
|
if found and not mail.selected_idxs.contacts[name] then
|
||||||
|
@ -13,15 +13,13 @@ function mail.show_edit_contact(name, contact_name, note, illegal_name_hint)
|
|||||||
]]
|
]]
|
||||||
if illegal_name_hint == "collision" then
|
if illegal_name_hint == "collision" then
|
||||||
formspec = formspec .. [[
|
formspec = formspec .. [[
|
||||||
label[4,1;]] .. S("That name") .. [[]
|
textarea[4.25,1;2.5,6;;;]] ..
|
||||||
label[4,1.5;]] .. S("is already in") .. [[]
|
S("That name is already in your contacts") .. [[]
|
||||||
label[4,2;]] .. S("your contacts.") .. [[]
|
|
||||||
]]
|
]]
|
||||||
elseif illegal_name_hint == "empty" then
|
elseif illegal_name_hint == "empty" then
|
||||||
formspec = formspec .. [[
|
formspec = formspec .. [[
|
||||||
label[4,1;]] .. S("The contact") .. [[]
|
textarea[4.25,1;2.5,6;;;]] ..
|
||||||
label[4,1.5;]] .. S("name cannot") .. [[]
|
S("The contact name cannot be empty.") .. [[]
|
||||||
label[4,2;]] .. S("be empty.") .. [[]
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
formspec = formspec .. mail.theme
|
formspec = formspec .. mail.theme
|
||||||
@ -40,19 +38,21 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
local contacts = mail.get_contacts(name)
|
local contacts = mail.get_contacts(name)
|
||||||
|
|
||||||
if fields.save then
|
if fields.save then
|
||||||
if mail.selected_idxs.contacts[name] and mail.selected_idxs.contacts[name] ~= "#NEW#" then
|
if mail.selected_idxs.contacts[name] then
|
||||||
local contact = contacts[mail.selected_idxs.contacts[name]]
|
local contact = contacts[mail.selected_idxs.contacts[name]] or {name = ""}
|
||||||
if mail.selected_idxs.contacts[name] ~= string.lower(fields.name) then
|
if contact.name ~= fields.name or fields.name == "" then
|
||||||
-- name changed!
|
-- name changed!
|
||||||
if #fields.name == 0 then
|
if #fields.name == 0 then
|
||||||
mail.show_edit_contact(name, contact.name, fields.note, "empty")
|
mail.show_edit_contact(name, contact.name, fields.note, "empty")
|
||||||
return true
|
return true
|
||||||
|
|
||||||
elseif contacts[string.lower(fields.name)] ~= nil then
|
elseif mail.get_contact(name, fields.name) then
|
||||||
mail.show_edit_contact(name, contact.name, fields.note, "collision")
|
mail.show_edit_contact(name, contact.name, fields.note, "collision")
|
||||||
return true
|
return true
|
||||||
|
|
||||||
else
|
else
|
||||||
|
contact.name = fields.name
|
||||||
|
contact.note = fields.note
|
||||||
mail.update_contact(name, contact)
|
mail.update_contact(name, contact)
|
||||||
contacts[mail.selected_idxs.contacts[name]] = nil
|
contacts[mail.selected_idxs.contacts[name]] = nil
|
||||||
end
|
end
|
||||||
|
@ -16,15 +16,13 @@ function mail.show_edit_maillist(playername, maillist_name, desc, players, illeg
|
|||||||
]]
|
]]
|
||||||
if illegal_name_hint == "collision" then
|
if illegal_name_hint == "collision" then
|
||||||
formspec = formspec .. [[
|
formspec = formspec .. [[
|
||||||
label[4,1;]] .. S("That name") .. [[]
|
textarea[4.25,1;2.5,6;;;]] ..
|
||||||
label[4,1.5;]] .. S("is already in") .. [[]
|
S("That name is already in your mailing lists.") .. [[]
|
||||||
label[4,2;]] .. S("your maillists.") .. [[]
|
|
||||||
]]
|
]]
|
||||||
elseif illegal_name_hint == "empty" then
|
elseif illegal_name_hint == "empty" then
|
||||||
formspec = formspec .. [[
|
formspec = formspec .. [[
|
||||||
label[4,1;]] .. S("The maillist") .. [[]
|
textarea[4.25,1;2.5,6;;;]] ..
|
||||||
label[4,1.5;]] .. S("name cannot") .. [[]
|
S("The mailing list name cannot be empty.") .. [[]
|
||||||
label[4,2;]] .. S("be empty.") .. [[]
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
formspec = formspec .. mail.theme
|
formspec = formspec .. mail.theme
|
||||||
@ -41,13 +39,46 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
local maillists = mail.get_maillists(name)
|
||||||
|
|
||||||
if fields.save then
|
if fields.save then
|
||||||
|
if mail.selected_idxs.maillists[name] then
|
||||||
|
local maillist = maillists[mail.selected_idxs.maillists[name]] or {name = ""}
|
||||||
|
if maillist.name ~= fields.name or fields.name == "" then
|
||||||
|
-- name changed!
|
||||||
|
if #fields.name == 0 then
|
||||||
|
mail.show_edit_maillist(name, maillist.name, fields.desc, fields.players, "empty")
|
||||||
|
return true
|
||||||
|
|
||||||
|
elseif mail.get_maillist_by_name(name, fields.name) then
|
||||||
|
mail.show_edit_maillist(name, maillist.name, fields.desc, fields.players, "collision")
|
||||||
|
return true
|
||||||
|
|
||||||
|
else
|
||||||
mail.update_maillist(name, {
|
mail.update_maillist(name, {
|
||||||
owner = name,
|
owner = name,
|
||||||
name = fields.name,
|
name = fields.name,
|
||||||
desc = fields.desc,
|
desc = fields.desc,
|
||||||
players = mail.parse_player_list(fields.players)
|
players = mail.parse_player_list(fields.players)
|
||||||
}, old_lists_names[name])
|
}, old_lists_names[name])
|
||||||
|
maillists[mail.selected_idxs.maillists[name]] = nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
mail.update_maillist(name, {
|
||||||
|
owner = name,
|
||||||
|
name = fields.name,
|
||||||
|
desc = fields.desc,
|
||||||
|
players = mail.parse_player_list(fields.players)
|
||||||
|
}, old_lists_names[name])
|
||||||
|
end
|
||||||
|
else
|
||||||
|
mail.update_maillist(name, {
|
||||||
|
owner = name,
|
||||||
|
name = fields.name,
|
||||||
|
desc = fields.desc,
|
||||||
|
players = mail.parse_player_list(fields.players)
|
||||||
|
}, old_lists_names[name])
|
||||||
|
end
|
||||||
mail.show_maillists(name)
|
mail.show_maillists(name)
|
||||||
|
|
||||||
elseif fields.back then
|
elseif fields.back then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user