Add sound notification (#86)

* Add sound notification

* Change sound

Update translations
This commit is contained in:
Athozus 2023-05-06 21:21:20 +02:00
parent a79ebd94b8
commit 955f7d123f
No known key found for this signature in database
GPG Key ID: B50895022E8484BF
13 changed files with 68 additions and 50 deletions

View File

@ -62,6 +62,7 @@ See the "LICENSE" file
* imre84 (UI fixes) * imre84 (UI fixes)
* Chache (Spanish translation) * Chache (Spanish translation)
* APercy (Brazilian Portuguese translation) * APercy (Brazilian Portuguese translation)
* Nuno Filipe Povoa (mail_notif.ogg - https://invent.kde.org/plasma/oxygen-sounds/-/blob/master/sounds/Oxygen-Im-Nudge.ogg)
# Contribute # Contribute

View File

@ -106,6 +106,9 @@ function mail.send(m)
minetest.chat_send_player(name, unified_inventory_alert) minetest.chat_send_player(name, unified_inventory_alert)
end end
end end
if mail.get_setting(name, "sound_notifications") == true then
minetest.sound_play("mail_notif", {to_player=name})
end
local receiver_entry = mail.get_storage_entry(name) local receiver_entry = mail.get_storage_entry(name)
local receiver_messages = receiver_entry.inbox local receiver_messages = receiver_entry.inbox
mail.hud_update(name, receiver_messages) mail.hud_update(name, receiver_messages)

View File

@ -30,6 +30,7 @@ mail = {
chat_notifications = {}, chat_notifications = {},
onjoin_notifications = {}, onjoin_notifications = {},
hud_notifications = {}, hud_notifications = {},
sound_notifications = {},
unreadcolorenable = {}, unreadcolorenable = {},
cccolorenable = {} cccolorenable = {}
}, },

View File

@ -16,6 +16,8 @@ BCC=BCC
Cancel=Abbrechen Cancel=Abbrechen
Save draft=Entwurf Speichern Save draft=Entwurf Speichern
Send=Senden Send=Senden
Subject=Betreff
To=An
CC=CC CC=CC
Name=Name Name=Name
No drafts=Keine Entwürfe No drafts=Keine Entwürfe
@ -30,23 +32,18 @@ Mail lists=Verteilerlisten
Options= Options=
Close=Schließen Close=Schließen
(No subject)=(Kein Betreff) (No subject)=(Kein Betreff)
To=An
Player name=Spielername Player name=Spielername
That name is already in your contacts= That name is already in your contacts=
The contact name cannot be empty.= The contact name cannot be empty.=
Save=Speichern
Maillist name=Verteilerlistenname Maillist name=Verteilerlistenname
Desc=Beschreibung Desc=Beschreibung
Players=Spieler Players=Spieler
That name is already in your mailing lists.= That name is already in your mailing lists.=
The mailing list name cannot be empty.= The mailing list name cannot be empty.=
Back=Zurück
Save=Speichern
Mark Read=Als gelesen makieren Mark Read=Als gelesen makieren
Mark Unread=Als ungelesen makieren Mark Unread=Als ungelesen makieren
From=Von From=Von
(No description)=(Keine Beschreibung)
No maillist=Keine Verteilerliste
You have mail! Type /mail to read=
Read=Lesen Read=Lesen
Filter= Filter=
Allow multiple selection= Allow multiple selection=
@ -56,19 +53,23 @@ No mail=Keine Nachrichten
Reply=Antworten Reply=Antworten
Reply all=Allen antworten Reply all=Allen antworten
Forward=Weiter Forward=Weiter
Date=Datum
Ascending= Ascending=
Descending= Descending=
Date=Datum (No description)=(Keine Beschreibung)
No maillist=Keine Verteilerliste
You have mail! Type /mail to read=
Add=Hinzufügen Add=Hinzufügen
Remove=Entfernen Remove=Entfernen
Back=Zurück
Notifications= Notifications=
Chat notifications= Chat notifications=
On join notifications= On join notifications=
HUD notifications= HUD notifications=
Sound notifications=
Message list= 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=Von/An From/To=Von/An
Reset= Reset=
Subject=Betreff

View File

@ -16,6 +16,8 @@ BCC=CCO
Cancel=Cancelar Cancel=Cancelar
Save draft=Guardar borrador Save draft=Guardar borrador
Send=Enviar Send=Enviar
Subject=Asunto
To=Para
CC=CC CC=CC
Name=Nombre Name=Nombre
No drafts=No hay borradores No drafts=No hay borradores
@ -30,23 +32,18 @@ Mail lists=Listas de correo
Options= Options=
Close=Cerrar Close=Cerrar
(No subject)=(Sin asunto) (No subject)=(Sin asunto)
To=Para
Player name=Nombre del jugador Player name=Nombre del jugador
That name is already in your contacts=Ese nombre ya está en tus contactos That name is already in your contacts=Ese nombre ya está en tus contactos
The contact name cannot be empty.=Ese nombre de contacto no puede estar vacío. The contact name cannot be empty.=Ese nombre de contacto no puede estar vacío.
Save=Guardar
Maillist name=Nombre de la lista de correo Maillist name=Nombre de la lista de correo
Desc=Desc Desc=Desc
Players=Jugadores Players=Jugadores
That name is already in your mailing lists.=Ese nombre ya está entus listas de correo. That name is already in your mailing lists.=Ese nombre ya está entus listas de correo.
The mailing list name cannot be empty.=Ese nombre de lista de correo no puede estar vacío. The mailing list name cannot be empty.=Ese nombre de lista de correo no puede estar vacío.
Back=Volver
Save=Guardar
Mark Read=Marcar como leído Mark Read=Marcar como leído
Mark Unread=Marcar como no leído Mark Unread=Marcar como no leído
From=De From=De
(No description)=(Sin descripción)
No maillist=Sin lista de correo
You have mail! Type /mail to read=
Read=Leído Read=Leído
Filter=Filtrar Filter=Filtrar
Allow multiple selection=Permitir selección múltiple Allow multiple selection=Permitir selección múltiple
@ -56,19 +53,23 @@ No mail=Sin correo
Reply=Responder Reply=Responder
Reply all=Responder a todos Reply all=Responder a todos
Forward=Reenviar Forward=Reenviar
Date=Fecha
Ascending=Ascendente Ascending=Ascendente
Descending=Descendiente Descending=Descendiente
Date=Fecha (No description)=(Sin descripción)
No maillist=Sin lista de correo
You have mail! Type /mail to read=
Add=Añadir Add=Añadir
Remove=Quitar Remove=Quitar
Back=Volver
Notifications= Notifications=
Chat notifications= Chat notifications=
On join notifications= On join notifications=
HUD notifications= HUD notifications=
Sound notifications=
Message list= 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=De/Para From/To=De/Para
Reset= Reset=
Subject=Asunto

View File

@ -16,6 +16,8 @@ BCC=Cci
Cancel=Annuler Cancel=Annuler
Save draft=Enregistrer le brouillon Save draft=Enregistrer le brouillon
Send=Envoyer Send=Envoyer
Subject=Objet
To=À
CC=Cc CC=Cc
Name=Nom Name=Nom
No drafts=Pas de brouillons No drafts=Pas de brouillons
@ -30,23 +32,18 @@ Mail lists=Listes de diffusion
Options=Options Options=Options
Close=Fermer Close=Fermer
(No subject)=(Sans objet) (No subject)=(Sans objet)
To=À
Player name=Nom du joueur Player name=Nom du joueur
That name is already in your contacts=Ce nom est déjà dans vos contacts That name is already in your contacts=Ce nom est déjà dans vos contacts
The contact name cannot be empty.=Le nom du contact ne peut pas être vide. The contact name cannot be empty.=Le nom du contact ne peut pas être vide.
Save=Sauvegarder
Maillist name=Nom de la liste de diffusion Maillist name=Nom de la liste de diffusion
Desc=Desc Desc=Desc
Players=Joueurs Players=Joueurs
That name is already in your mailing lists.=Ce nom est déjà dans vos listes de diffusion. That name is already in your mailing lists.=Ce nom est déjà dans vos listes de diffusion.
The mailing list name cannot be empty.=Le nom de la liste de diffusion ne peut pas être vide. The mailing list name cannot be empty.=Le nom de la liste de diffusion ne peut pas être vide.
Back=Retour
Save=Sauvegarder
Mark Read=Marquer comme lu Mark Read=Marquer comme lu
Mark Unread=Marquer non lu Mark Unread=Marquer non lu
From=De From=De
(No description)=Sans description
No maillist=Aucune liste de diffusion
You have mail! Type /mail to read=Vous avez reçu un mail ! Entrez /mail pour le consulter
Read=Lire Read=Lire
Filter=Filtre Filter=Filtre
Allow multiple selection=Autoriser la sélection multiple Allow multiple selection=Autoriser la sélection multiple
@ -56,19 +53,23 @@ No mail=Aucun mail
Reply=Répondre Reply=Répondre
Reply all=Répondre à tous Reply all=Répondre à tous
Forward=Transférer Forward=Transférer
Date=Date
Ascending=Croissant Ascending=Croissant
Descending=Décroissant Descending=Décroissant
Date=Date (No description)=Sans description
No maillist=Aucune liste de diffusion
You have mail! Type /mail to read=Vous avez reçu un mail ! Entrez /mail pour le consulter
Add=Ajouter Add=Ajouter
Remove=Enlever Remove=Enlever
Back=Retour
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
HUD notifications=Notifications ATH HUD notifications=Notifications ATH
Sound notifications=Notifications sonores
Message list=Liste de messages Message list=Liste de messages
Show unread in different color=Coloriser les non lus Show unread in different color=Coloriser les non lus
Show CC/BCC in different color=Coloriser les Cc/Cci Show CC/BCC in different color=Coloriser les Cc/Cci
Default sorting fields=Champs de tri par défaut Default sorting fields=Champs de tri par défaut
From/To=De/À From/To=De/À
Reset=Réinitialiser Reset=Réinitialiser
Subject=Objet

View File

@ -16,6 +16,8 @@ BCC=BCC
Cancel=Cancelar Cancel=Cancelar
Save draft=Salvar rascunho Save draft=Salvar rascunho
Send=Enviar Send=Enviar
Subject=Assunto
To=Para
CC=CC CC=CC
Name=Nome Name=Nome
No drafts=Sem rascunhos No drafts=Sem rascunhos
@ -30,23 +32,18 @@ Mail lists=Lista de correios
Options=Opções Options=Opções
Close=Fechar Close=Fechar
(No subject)=(Sem assunto) (No subject)=(Sem assunto)
To=Para
Player name=Nome do jogador Player name=Nome do jogador
That name is already in your contacts=Esse nome já consta em sua lista de contatos That name is already in your contacts=Esse nome já consta em sua lista de contatos
The contact name cannot be empty.=Informe o nome do destinatário The contact name cannot be empty.=Informe o nome do destinatário
Save=Salvar
Maillist name=Nome da lista de discussão Maillist name=Nome da lista de discussão
Desc=Descrição Desc=Descrição
Players=Jogador Players=Jogador
That name is already in your mailing lists.=Esse nome ja está sendo usado em sua lista de discussões That name is already in your mailing lists.=Esse nome ja está sendo usado em sua lista de discussões
The mailing list name cannot be empty.=O nome da lista de discussões deve ser informado The mailing list name cannot be empty.=O nome da lista de discussões deve ser informado
Back=Voltar
Save=Salvar
Mark Read=Marcar como lido Mark Read=Marcar como lido
Mark Unread=Marcar como não lido Mark Unread=Marcar como não lido
From=De From=De
(No description)=(sem descrição)
No maillist=Sem lista de discussão
You have mail! Type /mail to read=Você recebeu e-mail! Tecle /mail para ler
Read=Ler Read=Ler
Filter=Filtrar Filter=Filtrar
Allow multiple selection=Permitir selecionar vários Allow multiple selection=Permitir selecionar vários
@ -56,20 +53,23 @@ No mail=Sem e-mails no momento
Reply=Responder Reply=Responder
Reply all=Responder Todos Reply all=Responder Todos
Forward=Encaminhar Forward=Encaminhar
Date=Data
Ascending=Ascendente Ascending=Ascendente
Descending=Descendente Descending=Descendente
Date=Data (No description)=(sem descrição)
No maillist=Sem lista de discussão
You have mail! Type /mail to read=Você recebeu e-mail! Tecle /mail para ler
Add=Adicionar Add=Adicionar
Remove=Remover Remove=Remover
Back=Voltar
Notifications=Notificações Notifications=Notificações
Chat notifications=Notificação de conversa Chat notifications=Notificação de conversa
On join notifications=Notificação ao entrar On join notifications=Notificação ao entrar
HUD notifications=Notificação no HUD HUD notifications=Notificação no HUD
Sound notifications=
Message list=Lista de mensagens Message list=Lista de mensagens
Show unread in different color=Exibir mensagens não lidas em uma cor diferente Show unread in different color=Exibir mensagens não lidas em uma cor diferente
Show CC/BCC in different color=Exibir mensagens com copia em uma cor diferente Show CC/BCC in different color=Exibir mensagens com copia em uma cor diferente
Default sorting fields=Ordenamento de campos padrão Default sorting fields=Ordenamento de campos padrão
From/To=De/Para From/To=De/Para
Reset= Reset=
Subject=Assunto

View File

@ -16,6 +16,8 @@ BCC=密件副本
Cancel=取消 Cancel=取消
Save draft=儲存草稿 Save draft=儲存草稿
Send=發送 Send=發送
Subject=主旨
To=收件人
CC=副本 CC=副本
Name=名稱 Name=名稱
No drafts=沒有草稿 No drafts=沒有草稿
@ -30,23 +32,18 @@ Mail lists=郵件列表
Options= Options=
Close=關閉 Close=關閉
(No subject)=(沒有主旨) (No subject)=(沒有主旨)
To=收件人
Player name=玩家名稱 Player name=玩家名稱
That name is already in your contacts= That name is already in your contacts=
The contact name cannot be empty.= The contact name cannot be empty.=
Save=儲存
Maillist name=郵件列表名稱 Maillist name=郵件列表名稱
Desc=描述 Desc=描述
Players=玩家 Players=玩家
That name is already in your mailing lists.= That name is already in your mailing lists.=
The mailing list name cannot be empty.= The mailing list name cannot be empty.=
Back=返回
Save=儲存
Mark Read=標記已讀 Mark Read=標記已讀
Mark Unread=標記未讀 Mark Unread=標記未讀
From=寄件者 From=寄件者
(No description)=(沒有描述)
No maillist=沒有郵件列表
You have mail! Type /mail to read=
Read=閱讀 Read=閱讀
Filter= Filter=
Allow multiple selection= Allow multiple selection=
@ -56,19 +53,23 @@ No mail=沒有郵件
Reply=回覆 Reply=回覆
Reply all=回覆所有人 Reply all=回覆所有人
Forward=轉寄 Forward=轉寄
Date=日期
Ascending= Ascending=
Descending= Descending=
Date=日期 (No description)=(沒有描述)
No maillist=沒有郵件列表
You have mail! Type /mail to read=
Add=加入 Add=加入
Remove=移除 Remove=移除
Back=返回
Notifications= Notifications=
Chat notifications= Chat notifications=
On join notifications= On join notifications=
HUD notifications= HUD notifications=
Sound notifications=
Message list= 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=
Reset= Reset=
Subject=主旨

View File

@ -16,6 +16,8 @@ BCC=
Cancel= Cancel=
Save draft= Save draft=
Send= Send=
Subject=
To=
CC= CC=
Name= Name=
No drafts= No drafts=
@ -30,23 +32,18 @@ Mail lists=
Options= Options=
Close= Close=
(No subject)= (No subject)=
To=
Player name= Player name=
That name is already in your contacts= That name is already in your contacts=
The contact name cannot be empty.= The contact name cannot be empty.=
Save=
Maillist name= Maillist name=
Desc= Desc=
Players= Players=
That name is already in your mailing lists.= That name is already in your mailing lists.=
The mailing list name cannot be empty.= The mailing list name cannot be empty.=
Back=
Save=
Mark Read= Mark Read=
Mark Unread= Mark Unread=
From= From=
(No description)=
No maillist=
You have mail! Type /mail to read=
Read= Read=
Filter= Filter=
Allow multiple selection= Allow multiple selection=
@ -56,19 +53,23 @@ No mail=
Reply= Reply=
Reply all= Reply all=
Forward= Forward=
Date=
Ascending= Ascending=
Descending= Descending=
Date= (No description)=
No maillist=
You have mail! Type /mail to read=
Add= Add=
Remove= Remove=
Back=
Notifications= Notifications=
Chat notifications= Chat notifications=
On join notifications= On join notifications=
HUD notifications= HUD notifications=
Sound notifications=
Message list= 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=
Reset= Reset=
Subject=

BIN
sounds/mail_notif.ogg Normal file

Binary file not shown.

View File

@ -263,6 +263,7 @@ function mail.get_setting_default_value(setting_name)
chat_notifications = true, chat_notifications = true,
onjoin_notifications = true, onjoin_notifications = true,
hud_notifications = true, hud_notifications = true,
sound_notifications = true,
unreadcolorenable = true, unreadcolorenable = true,
cccolorenable = true, cccolorenable = true,
defaultsortfield = 3, defaultsortfield = 3,

View File

@ -37,7 +37,8 @@ function mail.show_about(name)
[[#FFF,NatureFreshMilk,Maintenance,]] .. [[#FFF,NatureFreshMilk,Maintenance,]] ..
[[#FFF,imre84,UI fixes,]] .. [[#FFF,imre84,UI fixes,]] ..
[[#FFF,Chache,Spanish translation,]] .. [[#FFF,Chache,Spanish translation,]] ..
[[#FFF,APercy,Brazilian Portuguese trans.] [[#FFF,APercy,Brazilian Portuguese trans.,]] ..
[[#FFF,Nuno Filipe Povoa,mail_notif.ogg]
]] .. mail.theme ]] .. mail.theme
minetest.show_formspec(name, FORMNAME, formspec) minetest.show_formspec(name, FORMNAME, formspec)

View File

@ -17,6 +17,8 @@ function mail.show_settings(name)
tostring(mail.get_setting(name, "onjoin_notifications")) .. [[] tostring(mail.get_setting(name, "onjoin_notifications")) .. [[]
checkbox[0,2.0;hud_notifications;]] .. S("HUD notifications") .. [[;]] .. checkbox[0,2.0;hud_notifications;]] .. S("HUD notifications") .. [[;]] ..
tostring(mail.get_setting(name, "hud_notifications")) .. [[] tostring(mail.get_setting(name, "hud_notifications")) .. [[]
checkbox[0,2.4;sound_notifications;]] .. S("Sound notifications") .. [[;]] ..
tostring(mail.get_setting(name, "sound_notifications")) .. [[]
box[5,0.8;3,0.45;#466432] box[5,0.8;3,0.45;#466432]
label[5.2,0.8;]] .. S("Message list") .. [[] label[5.2,0.8;]] .. S("Message list") .. [[]
@ -68,6 +70,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
elseif fields.hud_notifications then elseif fields.hud_notifications then
mail.selected_idxs.hud_notifications[playername] = fields.hud_notifications == "true" mail.selected_idxs.hud_notifications[playername] = fields.hud_notifications == "true"
elseif fields.sound_notifications then
mail.selected_idxs.sound_notifications[playername] = fields.sound_notifications == "true"
elseif fields.unreadcolorenable then elseif fields.unreadcolorenable then
mail.selected_idxs.unreadcolorenable[playername] = fields.unreadcolorenable == "true" mail.selected_idxs.unreadcolorenable[playername] = fields.unreadcolorenable == "true"
@ -79,6 +84,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
mail.set_setting(playername, "chat_notifications", mail.selected_idxs.chat_notifications[playername]) mail.set_setting(playername, "chat_notifications", mail.selected_idxs.chat_notifications[playername])
mail.set_setting(playername, "onjoin_notifications", mail.selected_idxs.onjoin_notifications[playername]) mail.set_setting(playername, "onjoin_notifications", mail.selected_idxs.onjoin_notifications[playername])
mail.set_setting(playername, "hud_notifications", mail.selected_idxs.hud_notifications[playername]) mail.set_setting(playername, "hud_notifications", mail.selected_idxs.hud_notifications[playername])
mail.set_setting(playername, "sound_notifications", mail.selected_idxs.sound_notifications[playername])
mail.set_setting(playername, "unreadcolorenable", mail.selected_idxs.unreadcolorenable[playername]) mail.set_setting(playername, "unreadcolorenable", mail.selected_idxs.unreadcolorenable[playername])
mail.set_setting(playername, "cccolorenable", mail.selected_idxs.cccolorenable[playername]) mail.set_setting(playername, "cccolorenable", mail.selected_idxs.cccolorenable[playername])
-- dropdowns -- dropdowns