Notifications locale

This commit is contained in:
Brahim Hadriche committed 2024-03-20 00:36:38 -04:00
1 parent 9061275d6f
commit feb968a72e
7 files changed
+208 -9

No files matched your search

@@ -1,3 +1,5 @@
import "pkg:/source/utils/Locale.bs"
namespace LoungeDeviceConnected
const NOTIFICATION_NODE_ID = "DeviceConnectedNotification"
@@ -9,7 +11,7 @@ namespace LoungeDeviceConnected
end if
if StringUtils.IsNullOrEmpty(deviceName)
deviceName = "Device"
deviceName = Tr(Locale.LoungeNotification.Device)
end if
if StringUtils.IsNullOrEmpty(userAvatarUri)
userAvatarUri = "pkg:/images/icons/user.png"
@@ -16,9 +16,9 @@ end function
function OnActionSet()
action = m.top.action
category = m.top.segment.category
categoryTitle = m.service.SegmentShortTitle(category)
categoryTitle = Tr(ValidString(m.service.SegmentShortTitle(category)))
if action = "AutoSkip"
m.categoryLabel.text = `Skipped\n${categoryTitle}`
m.categoryLabel.text = Tr(Locale.SponsorBlock.Skipped) + `\n` + categoryTitle
else
m.categoryLabel.text = categoryTitle
end if
@@ -94,7 +94,7 @@ namespace SponsorBlock
end if
if (segmentStart <= time) and (segmentEnd >= time)
m.top.chapter = m.sponsorBlockService.SegmentTitle(category)
m.top.chapter = Tr(ValidString(m.sponsorBlockService.SegmentTitle(category)))
return
end if
end for