Added schedules empty message for kmb

This commit is contained in:
2026-03-10 16:59:31 +08:00
parent 346a2a6042
commit 435637e1a4
6 changed files with 28 additions and 5 deletions

View File

@@ -174,6 +174,8 @@ func (this *QueryResult) Message() (string, error) {
sb.WriteString("\n")
writeShortRoute(&this.Lang, &sb, r)
noSchedules := true
for _, schedule := range *(*this.Schedules)[r] {
if !schedule.ETA.IsZero() {
@@ -189,6 +191,8 @@ func (this *QueryResult) Message() (string, error) {
} else {
utils.WriteMDv2Text(&sb, eta)
}
noSchedules = false
}
if schedule.Remarks_en != "" {
@@ -204,6 +208,10 @@ func (this *QueryResult) Message() (string, error) {
sb.WriteString("\n")
}
if noSchedules {
utils.WriteMDv2Text(&sb, i18n.DS_KMB_NO_SCHEDULES.Text(langPack))
}
sb.WriteString("\n")
}
@@ -241,7 +249,7 @@ func (this *QueryResult) Message() (string, error) {
}
}
} else {
return "", fmt.Errorf("No Results")
return "", fmt.Errorf(i18n.NO_RESULTS.Text(langPack))
}
return sb.String(), nil

View File

@@ -4,6 +4,7 @@ const (
DS_KMB_ETA_DEPARTED Key = "DS.KMB.ETA.DEPARTED"
DS_KMB_NEAREST_STOPS Key = "DS.KMB.NEAREST_STOPS"
DS_KMB_NO_NEAREST_STOPS Key = "DS.KMB.NO_NEAREST_STOPS"
DS_KMB_NO_SCHEDULES Key = "DS.KMB.NO_SCHEDULES"
DS_MTR_NEAREST_STOPS Key = "DS.MTR.NEAREST_STOPS"
DS_MTR_NO_NEAREST_STOPS Key = "DS.MTR.NO_NEAREST_STOPS"
DS_MTR_NO_SCHEDULES Key = "DS.MTR.NO_SCHEDULES"

View File

@@ -2,9 +2,10 @@
"DS.KMB.ETA.DEPARTED": "%s (走左了?)",
"DS.KMB.NEAREST_STOPS": "%s 範圍內九巴站",
"DS.KMB.NO_NEAREST_STOPS": "%s 範圍內找不到九巴站,最近 %d 個站為:",
"DS.KMB.NO_SCHEDULES": "沒有行程(收左工了?全日得一班?)",
"DS.MTR.NEAREST_STOPS": "%s 範圍內港鐵巴士車站",
"DS.MTR.NO_NEAREST_STOPS": "%s 範圍內找不到港鐵巴士站,最近 %d 個站為:",
"DS.MTR.NO_SCHEDULES": "沒有行程(收左工了?)",
"DS.MTR.NO_SCHEDULES": "沒有行程(收左工了?全日得一班?",
"NO_RESULTS": "找不到結果",
"UNITS.KM": "%.1f 公里",
"UNITS.METER": "%.0f 米",

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-03-10 15:23+0800\n"
"POT-Creation-Date: 2026-03-10 16:50+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -25,6 +25,11 @@ msgid ""
"KMB: Unable to find stations under %s. Listing nearest %d stations instead:"
msgstr "%s 範圍內找不到九巴站,最近 %d 個站為:"
#: .DS.KMB.NO_SCHEDULES
msgctxt ".DS.KMB.NO_SCHEDULES"
msgid "Schedules are empty...perhaps Out of Service Time?"
msgstr "沒有行程(收左工了?全日得一班?)"
#: .DS.MTR.NEAREST_STOPS
msgid "MTR: Showing nearest bus stops under %s"
msgstr "%s 範圍內港鐵巴士車站"
@@ -36,8 +41,9 @@ msgid ""
msgstr "%s 範圍內找不到港鐵巴士站,最近 %d 個站為:"
#: .DS.MTR.NO_SCHEDULES
msgctxt ".DS.MTR.NO_SCHEDULES"
msgid "Schedules are empty...perhaps Out of Service Time?"
msgstr "沒有行程(收左工了?)"
msgstr "沒有行程(收左工了?全日得一班?"
#: .NO_RESULTS
msgid "No Results"

View File

@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-03-10 15:23+0800\n"
"POT-Creation-Date: 2026-03-10 16:50+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -26,6 +26,11 @@ msgid ""
"KMB: Unable to find stations under %s. Listing nearest %d stations instead:"
msgstr ""
#: .DS.KMB.NO_SCHEDULES
msgctxt ".DS.KMB.NO_SCHEDULES"
msgid "Schedules are empty...perhaps Out of Service Time?"
msgstr ""
#: .DS.MTR.NEAREST_STOPS
msgid "MTR: Showing nearest bus stops under %s"
msgstr ""
@@ -37,6 +42,7 @@ msgid ""
msgstr ""
#: .DS.MTR.NO_SCHEDULES
msgctxt ".DS.MTR.NO_SCHEDULES"
msgid "Schedules are empty...perhaps Out of Service Time?"
msgstr ""

View File

@@ -2,6 +2,7 @@
"DS.KMB.ETA.DEPARTED": "%s (Leaved?)",
"DS.KMB.NEAREST_STOPS": "KMB: Showing nearest bus stops under %s",
"DS.KMB.NO_NEAREST_STOPS": "KMB: Unable to find stations under %s. Listing nearest %d stations instead:",
"DS.KMB.NO_SCHEDULES": "Schedules are empty...perhaps Out of Service Time?",
"DS.MTR.NEAREST_STOPS": "MTR: Showing nearest bus stops under %s",
"DS.MTR.NO_NEAREST_STOPS": "MTR Bus: Unable to find stations under %s. Listing nearest %d stations instead:",
"DS.MTR.NO_SCHEDULES": "Schedules are empty...perhaps Out of Service Time?",