Added schedules empty message for kmb
This commit is contained in:
@@ -174,6 +174,8 @@ func (this *QueryResult) Message() (string, error) {
|
|||||||
sb.WriteString("\n")
|
sb.WriteString("\n")
|
||||||
writeShortRoute(&this.Lang, &sb, r)
|
writeShortRoute(&this.Lang, &sb, r)
|
||||||
|
|
||||||
|
noSchedules := true
|
||||||
|
|
||||||
for _, schedule := range *(*this.Schedules)[r] {
|
for _, schedule := range *(*this.Schedules)[r] {
|
||||||
|
|
||||||
if !schedule.ETA.IsZero() {
|
if !schedule.ETA.IsZero() {
|
||||||
@@ -189,6 +191,8 @@ func (this *QueryResult) Message() (string, error) {
|
|||||||
} else {
|
} else {
|
||||||
utils.WriteMDv2Text(&sb, eta)
|
utils.WriteMDv2Text(&sb, eta)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
noSchedules = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if schedule.Remarks_en != "" {
|
if schedule.Remarks_en != "" {
|
||||||
@@ -204,6 +208,10 @@ func (this *QueryResult) Message() (string, error) {
|
|||||||
sb.WriteString("\n")
|
sb.WriteString("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noSchedules {
|
||||||
|
utils.WriteMDv2Text(&sb, i18n.DS_KMB_NO_SCHEDULES.Text(langPack))
|
||||||
|
}
|
||||||
|
|
||||||
sb.WriteString("\n")
|
sb.WriteString("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +249,7 @@ func (this *QueryResult) Message() (string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return "", fmt.Errorf("No Results")
|
return "", fmt.Errorf(i18n.NO_RESULTS.Text(langPack))
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.String(), nil
|
return sb.String(), nil
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const (
|
|||||||
DS_KMB_ETA_DEPARTED Key = "DS.KMB.ETA.DEPARTED"
|
DS_KMB_ETA_DEPARTED Key = "DS.KMB.ETA.DEPARTED"
|
||||||
DS_KMB_NEAREST_STOPS Key = "DS.KMB.NEAREST_STOPS"
|
DS_KMB_NEAREST_STOPS Key = "DS.KMB.NEAREST_STOPS"
|
||||||
DS_KMB_NO_NEAREST_STOPS Key = "DS.KMB.NO_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_NEAREST_STOPS Key = "DS.MTR.NEAREST_STOPS"
|
||||||
DS_MTR_NO_NEAREST_STOPS Key = "DS.MTR.NO_NEAREST_STOPS"
|
DS_MTR_NO_NEAREST_STOPS Key = "DS.MTR.NO_NEAREST_STOPS"
|
||||||
DS_MTR_NO_SCHEDULES Key = "DS.MTR.NO_SCHEDULES"
|
DS_MTR_NO_SCHEDULES Key = "DS.MTR.NO_SCHEDULES"
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
"DS.KMB.ETA.DEPARTED": "%s (走左了?)",
|
"DS.KMB.ETA.DEPARTED": "%s (走左了?)",
|
||||||
"DS.KMB.NEAREST_STOPS": "%s 範圍內九巴站",
|
"DS.KMB.NEAREST_STOPS": "%s 範圍內九巴站",
|
||||||
"DS.KMB.NO_NEAREST_STOPS": "%s 範圍內找不到九巴站,最近 %d 個站為:",
|
"DS.KMB.NO_NEAREST_STOPS": "%s 範圍內找不到九巴站,最近 %d 個站為:",
|
||||||
|
"DS.KMB.NO_SCHEDULES": "沒有行程(收左工了?全日得一班?)",
|
||||||
"DS.MTR.NEAREST_STOPS": "%s 範圍內港鐵巴士車站",
|
"DS.MTR.NEAREST_STOPS": "%s 範圍內港鐵巴士車站",
|
||||||
"DS.MTR.NO_NEAREST_STOPS": "%s 範圍內找不到港鐵巴士站,最近 %d 個站為:",
|
"DS.MTR.NO_NEAREST_STOPS": "%s 範圍內找不到港鐵巴士站,最近 %d 個站為:",
|
||||||
"DS.MTR.NO_SCHEDULES": "沒有行程(收左工了?)",
|
"DS.MTR.NO_SCHEDULES": "沒有行程(收左工了?全日得一班?)",
|
||||||
"NO_RESULTS": "找不到結果",
|
"NO_RESULTS": "找不到結果",
|
||||||
"UNITS.KM": "%.1f 公里",
|
"UNITS.KM": "%.1f 公里",
|
||||||
"UNITS.METER": "%.0f 米",
|
"UNITS.METER": "%.0f 米",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \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"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\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:"
|
"KMB: Unable to find stations under %s. Listing nearest %d stations instead:"
|
||||||
msgstr "%s 範圍內找不到九巴站,最近 %d 個站為:"
|
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
|
#: .DS.MTR.NEAREST_STOPS
|
||||||
msgid "MTR: Showing nearest bus stops under %s"
|
msgid "MTR: Showing nearest bus stops under %s"
|
||||||
msgstr "%s 範圍內港鐵巴士車站"
|
msgstr "%s 範圍內港鐵巴士車站"
|
||||||
@@ -36,8 +41,9 @@ msgid ""
|
|||||||
msgstr "%s 範圍內找不到港鐵巴士站,最近 %d 個站為:"
|
msgstr "%s 範圍內找不到港鐵巴士站,最近 %d 個站為:"
|
||||||
|
|
||||||
#: .DS.MTR.NO_SCHEDULES
|
#: .DS.MTR.NO_SCHEDULES
|
||||||
|
msgctxt ".DS.MTR.NO_SCHEDULES"
|
||||||
msgid "Schedules are empty...perhaps Out of Service Time?"
|
msgid "Schedules are empty...perhaps Out of Service Time?"
|
||||||
msgstr "沒有行程(收左工了?)"
|
msgstr "沒有行程(收左工了?全日得一班?)"
|
||||||
|
|
||||||
#: .NO_RESULTS
|
#: .NO_RESULTS
|
||||||
msgid "No Results"
|
msgid "No Results"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \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"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\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:"
|
"KMB: Unable to find stations under %s. Listing nearest %d stations instead:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: .DS.KMB.NO_SCHEDULES
|
||||||
|
msgctxt ".DS.KMB.NO_SCHEDULES"
|
||||||
|
msgid "Schedules are empty...perhaps Out of Service Time?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: .DS.MTR.NEAREST_STOPS
|
#: .DS.MTR.NEAREST_STOPS
|
||||||
msgid "MTR: Showing nearest bus stops under %s"
|
msgid "MTR: Showing nearest bus stops under %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -37,6 +42,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: .DS.MTR.NO_SCHEDULES
|
#: .DS.MTR.NO_SCHEDULES
|
||||||
|
msgctxt ".DS.MTR.NO_SCHEDULES"
|
||||||
msgid "Schedules are empty...perhaps Out of Service Time?"
|
msgid "Schedules are empty...perhaps Out of Service Time?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"DS.KMB.ETA.DEPARTED": "%s (Leaved?)",
|
"DS.KMB.ETA.DEPARTED": "%s (Leaved?)",
|
||||||
"DS.KMB.NEAREST_STOPS": "KMB: Showing nearest bus stops under %s",
|
"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_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.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_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?",
|
"DS.MTR.NO_SCHEDULES": "Schedules are empty...perhaps Out of Service Time?",
|
||||||
|
|||||||
Reference in New Issue
Block a user