diff --git a/audio1/audio.go b/audio1/audio.go index 194149d8d..dd9cffca3 100644 --- a/audio1/audio.go +++ b/audio1/audio.go @@ -326,7 +326,7 @@ func sendNotify(icon, summary, body string) { return } n := notifications.NewNotifications(sessionBus) - _, err = n.Notify(0, "dde-control-center", 0, + _, err = n.Notify(0, Tr("dde-control-center"), 0, icon, summary, body, nil, nil, -1) logger.Debugf("send notification icon: %q, summary: %q, body: %q", diff --git a/audio1/audio_events.go b/audio1/audio_events.go index 6e2672891..6a22e1132 100644 --- a/audio1/audio_events.go +++ b/audio1/audio_events.go @@ -474,7 +474,7 @@ func (a *Audio) notifyPortDisabled(cardId uint32, port pulse.CardPortInfo) { notify := notifications.NewNotifications(session) _, err = notify.Notify( 0, - "dde-control-center", + gettext.Tr("dde-control-center"), 0, icon, message, diff --git a/bin/dde-session-daemon/main.go b/bin/dde-session-daemon/main.go index 366771e19..838825e70 100644 --- a/bin/dde-session-daemon/main.go +++ b/bin/dde-session-daemon/main.go @@ -476,7 +476,7 @@ func sendLoginNotify() { notify := notifications.NewNotifications(session) _, err = notify.Notify( 0, - "dde-control-center", + Tr("dde-control-center"), 0, icon, "", diff --git a/bluetooth1/obex_agent.go b/bluetooth1/obex_agent.go index 5eba0cf06..e2a7433d3 100644 --- a/bluetooth1/obex_agent.go +++ b/bluetooth1/obex_agent.go @@ -377,7 +377,7 @@ func (a *obexAgent) notifyProgress(notify notifications.Notifications, replaceID hints := map[string]dbus.Variant{"suppress-sound": dbus.MakeVariant(true)} notifyID, err = notify.Notify(0, - "dde-control-center", + gettext.Tr("dde-control-center"), replaceID, notifyIconBluetoothConnected, fmt.Sprintf(gettext.Tr("Receiving %[1]q from %[2]q"), filename, device), @@ -392,7 +392,7 @@ func (a *obexAgent) notifyProgress(notify notifications.Notifications, replaceID actions = []string{"_view", gettext.Tr("View")} hints := map[string]dbus.Variant{"x-deepin-action-_view": dbus.MakeVariant("xdg-open," + receiveBaseDir)} notifyID, err = notify.Notify(0, - "dde-control-center", + gettext.Tr("dde-control-center"), replaceID, notifyIconBluetoothConnected, fmt.Sprintf(gettext.Tr("You have received files from %q successfully"), device), @@ -419,7 +419,7 @@ func (a *obexAgent) notifyFailed(notify notifications.Notifications, replaceID u } notifyID, err := notify.Notify(0, - "dde-control-center", + gettext.Tr("dde-control-center"), replaceID, notifyIconBluetoothConnectFailed, summary, @@ -452,7 +452,7 @@ func (a *obexAgent) requestReceive(deviceName, filename string) (bool, error) { actions := []string{"decline", gettext.Tr("Decline"), "receive", gettext.Tr("Receive")} notifyID, err := notify.Notify(0, - "dde-control-center", + gettext.Tr("dde-control-center"), 0, notifyIconBluetoothConnected, gettext.Tr("Bluetooth File Transfer"), @@ -507,7 +507,7 @@ func (a *obexAgent) requestReceive(deviceName, filename string) (bool, error) { // notifyReceiveFileTimeout 接收文件请求超时通知 func (a *obexAgent) notifyReceiveFileTimeout(notify notifications.Notifications, replaceID uint32, filename string) { _, err := notify.Notify(0, - "dde-control-center", + gettext.Tr("dde-control-center"), replaceID, notifyIconBluetoothConnectFailed, gettext.Tr("Stop Receiving Files"), diff --git a/bluetooth1/utils_notify.go b/bluetooth1/utils_notify.go index a5528e7a7..d50683a8a 100644 --- a/bluetooth1/utils_notify.go +++ b/bluetooth1/utils_notify.go @@ -74,7 +74,7 @@ func notify(icon, summary, body string) { nid := globalNotifyId globalNotifyMu.Unlock() - nid, err := globalNotifications.Notify(0, "dde-control-center", nid, icon, + nid, err := globalNotifications.Notify(0, Tr("dde-control-center"), nid, icon, summary, body, nil, nil, -1) if err != nil { logger.Warning(err) @@ -140,7 +140,7 @@ func notifyPassiveConnect(dev *DeviceInfo, pinCode string) error { // notify connect request to dde-control-center // set notify time out as -1, default time out is 5 seconds - nid, err = globalNotifications.Notify(0, "dde-control-center", nid, notifyIconBluetoothConnected, + nid, err = globalNotifications.Notify(0, Tr("dde-control-center"), nid, notifyIconBluetoothConnected, summary, body, as, hints, 30*1000) if err != nil { logger.Warningf("notify message failed,err:%v", err) diff --git a/debian/changelog b/debian/changelog index a1a0c93a1..8fa98c723 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dde-daemon (6.0.41) unstable; urgency=medium + + * Add translations of dde-control-center in notification titles + + -- Yutao Meng Thu, 06 Jun 2024 13:28:25 +0800 + dde-daemon (6.0.40) unstable; urgency=medium * chore(deps): bump golang.org/x/net from 0.17.0 to 0.23.0 diff --git a/housekeeping/init.go b/housekeeping/init.go index 68a98b398..96b146f7f 100644 --- a/housekeeping/init.go +++ b/housekeeping/init.go @@ -103,7 +103,7 @@ func sendNotify(icon, summary, body string) error { return err } notifier := notifications.NewNotifications(sessionConn) - _, err = notifier.Notify(0, "dde-control-center", 0, + _, err = notifier.Notify(0, Tr("dde-control-center"), 0, icon, summary, body, nil, nil, -1) return err diff --git a/langselector1/locale.go b/langselector1/locale.go index e30148274..07a66627d 100644 --- a/langselector1/locale.go +++ b/langselector1/locale.go @@ -28,7 +28,7 @@ import ( gio "github.com/linuxdeepin/go-gir/gio-2.0" "github.com/linuxdeepin/go-lib/dbusutil" - . "github.com/linuxdeepin/go-lib/gettext" + . "github.com/linuxdeepin/go-lib/gettext" "github.com/linuxdeepin/go-lib/gsettings" "github.com/linuxdeepin/go-lib/strv" "github.com/linuxdeepin/go-lib/xdg/basedir" @@ -236,7 +236,7 @@ func sendNotify(icon, summary, body string) { return } n := notifications.NewNotifications(sessionBus) - _, err = n.Notify(0, "dde-control-center", 0, + _, err = n.Notify(0, Tr("dde-control-center"), 0, icon, summary, body, nil, nil, -1) logger.Debugf("send notification icon: %q, summary: %q, body: %q", diff --git a/lastore1/notify.go b/lastore1/notify.go index d5d3c0ed4..762a6b39d 100644 --- a/lastore1/notify.go +++ b/lastore1/notify.go @@ -116,12 +116,12 @@ func (l *Lastore) notifyLowPower() { func (l *Lastore) notifyAutoClean() { msg := gettext.Tr("Package cache wiped") - l.sendNotify("deepin-appstore", "", msg, nil, nil, notifyExpireTimeoutDefault, "dde-control-center") + l.sendNotify("deepin-appstore", "", msg, nil, nil, notifyExpireTimeoutDefault, gettext.Tr(gettext.Tr("dde-control-center"))) } func (l *Lastore) notifyUpdateSource(actions []NotifyAction) { msg := gettext.Tr("Updates Available") - l.sendNotify("preferences-system", "", msg, actions, nil, notifyExpireTimeoutDefault, "dde-control-center") + l.sendNotify("preferences-system", "", msg, actions, nil, notifyExpireTimeoutDefault, gettext.Tr(gettext.Tr("dde-control-center"))) } func (l *Lastore) updateSucceedNotify(actions []NotifyAction) { @@ -129,7 +129,7 @@ func (l *Lastore) updateSucceedNotify(actions []NotifyAction) { msg := gettext.Tr("Restart the computer to use the system and applications properly") hints := map[string]dbus.Variant{"x-deepin-action-RebootNow": dbus.MakeVariant("busctl,--user,call,org.deepin.dde.SessionManager1," + "/org/deepin/dde/SessionManager1,org.deepin.dde.SessionManager1,RequestReboot")} - l.sendNotify(systemUpdatedIcon, summary, msg, actions, hints, notifyExpireTimeoutReboot, "dde-control-center") + l.sendNotify(systemUpdatedIcon, summary, msg, actions, hints, notifyExpireTimeoutReboot, gettext.Tr(gettext.Tr("dde-control-center"))) // 默认弹出横幅时间为每2小时 l.resetUpdateSucceedNotifyTimer(l.intervalTime) @@ -139,7 +139,7 @@ func (l *Lastore) lowBatteryInUpdatingNotify() { msg := gettext.Tr("Your system is being updated, but the capacity is lower than 50%, please plug in to avoid power outage") actions := []string{"ok", gettext.Tr("OK")} notifyID, err := l.notifications.Notify(0, - "dde-control-center", + gettext.Tr("dde-control-center"), 0, systemUpdatedIcon, "", diff --git a/misc/po/dde-daemon.pot b/misc/po/dde-daemon.pot index 3f8fddf1b..85d6dfcc7 100644 --- a/misc/po/dde-daemon.pot +++ b/misc/po/dde-daemon.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-19 13:21+0800\n" +"POT-Creation-Date: 2024-06-04 07:52+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -505,6 +505,11 @@ msgstr "" msgid "Package cache wiped" msgstr "" +#: ../../lastore1/notify.go:119 ../../lastore1/notify.go:124 +#: ../../lastore1/notify.go:132 +msgid "dde-control-center" +msgstr "deepin Control Center" + #: ../../lastore1/notify.go:123 msgid "Updates Available" msgstr "" diff --git a/misc/po/en_US.po b/misc/po/en_US.po index c1e07a036..4739eb785 100644 --- a/misc/po/en_US.po +++ b/misc/po/en_US.po @@ -514,6 +514,11 @@ msgstr "" msgid "Package cache wiped" msgstr "Package cache wiped" +#: ../../lastore1/notify.go:119 ../../lastore1/notify.go:124 +#: ../../lastore1/notify.go:132 +msgid "dde-control-center" +msgstr "deepin Control Center" + #: ../../lastore1/notify.go:123 msgid "Updates Available" msgstr "Updates Available" diff --git a/misc/po/zh_CN.po b/misc/po/zh_CN.po index adda6ff5a..4af228964 100644 --- a/misc/po/zh_CN.po +++ b/misc/po/zh_CN.po @@ -516,6 +516,12 @@ msgstr "为防止自动关机,请连接电源以保证安全更新。" msgid "Package cache wiped" msgstr "已成功清理软件包缓存" +#: ../../lastore1/notify.go:119 ../../lastore1/notify.go:124 +#: ../../lastore1/notify.go:132 +msgid "dde-control-center" +msgstr "控制中心" + + #: ../../lastore1/notify.go:123 msgid "Updates Available" msgstr "检测到有更新可用" diff --git a/misc/po/zh_HK.po b/misc/po/zh_HK.po index a0da7edac..178bbbbee 100644 --- a/misc/po/zh_HK.po +++ b/misc/po/zh_HK.po @@ -512,6 +512,11 @@ msgstr "為免自動關機,更新時請接上電源。" msgid "Package cache wiped" msgstr "已成功清理軟件包緩存 " +#: ../../lastore1/notify.go:119 ../../lastore1/notify.go:124 +#: ../../lastore1/notify.go:132 +msgid "dde-control-center" +msgstr "控制中心" + #: ../../lastore1/notify.go:123 msgid "Updates Available" msgstr "檢測到有更新可用" diff --git a/misc/po/zh_TW.po b/misc/po/zh_TW.po index 4efae55bb..543faa9c5 100644 --- a/misc/po/zh_TW.po +++ b/misc/po/zh_TW.po @@ -516,6 +516,11 @@ msgstr "為防止自動關機,請在更新期間接上電源。" msgid "Package cache wiped" msgstr "已清除軟體包快取" +#: ../../lastore1/notify.go:119 ../../lastore1/notify.go:124 +#: ../../lastore1/notify.go:132 +msgid "dde-control-center" +msgstr "控制中心" + #: ../../lastore1/notify.go:123 msgid "Updates Available" msgstr "檢測到有更新可用" diff --git a/network/proxychains/utils_notify.go b/network/proxychains/utils_notify.go index b7327cce8..ebf1c7560 100644 --- a/network/proxychains/utils_notify.go +++ b/network/proxychains/utils_notify.go @@ -43,7 +43,7 @@ func createNotify(appName string) func(string, string, string) { } } -var notify = createNotify("dde-control-center") +var notify = createNotify(Tr("dde-control-center")) func notifyAppProxyEnabled() { notify(notifyIconProxyEnabled, Tr("Network"), Tr("Application proxy is set successfully")) diff --git a/network/utils_notify.go b/network/utils_notify.go index 5e3323b97..62ed645ff 100644 --- a/network/utils_notify.go +++ b/network/utils_notify.go @@ -154,7 +154,7 @@ func _notify(icon, summary, body string) { nid := notifyId notifyIdMu.Unlock() - nid, err := notification.Notify(0, "dde-control-center", nid, + nid, err := notification.Notify(0, Tr("dde-control-center"), nid, icon, summary, body, nil, nil, -1) if err != nil { logger.Warning(err) diff --git a/service_trigger/manager.go b/service_trigger/manager.go index 79b4df42a..506615548 100644 --- a/service_trigger/manager.go +++ b/service_trigger/manager.go @@ -139,7 +139,7 @@ func (m *Manager) notify(bodyNotify *sessionmsg.BodyNotify) { appName := bodyNotify.AppName if appName == "" { - appName = "dde-control-center" + appName = Tr("dde-control-center") } _, err := m.notifications.Notify(0, appName, 0, bodyNotify.Icon, diff --git a/session/power1/utils.go b/session/power1/utils.go index 4d94a4eaa..8054db8f5 100644 --- a/session/power1/utils.go +++ b/session/power1/utils.go @@ -331,7 +331,7 @@ func (m *Manager) sendNotify(icon, summary, body string) { return } n := m.helper.Notifications - _, err := n.Notify(0, "dde-control-center", 0, icon, summary, body, nil, nil, -1) + _, err := n.Notify(0, Tr("dde-control-center"), 0, icon, summary, body, nil, nil, -1) if err != nil { logger.Warning(err) } @@ -339,7 +339,7 @@ func (m *Manager) sendNotify(icon, summary, body string) { func (m *Manager) sendChangeNotify(icon, summary, body string) { n := m.helper.Notifications - _, err := n.Notify(0, "dde-control-center", 0, icon, summary, body, nil, nil, -1) + _, err := n.Notify(0, Tr("dde-control-center"), 0, icon, summary, body, nil, nil, -1) if err != nil { logger.Warning(err) }