Compare commits
2 Commits
ce36e584dd
...
8223a0b4d5
| Author | SHA1 | Date | |
|---|---|---|---|
| 8223a0b4d5 | |||
| c57aa220e6 |
@ -181,8 +181,18 @@ func (h *MenuHandlers) GetVoucherList(ctx context.Context, sym string, input []b
|
||||
return res, fmt.Errorf("missing session")
|
||||
}
|
||||
|
||||
code := codeFromCtx(ctx)
|
||||
l := gotext.NewLocale(translationDir, code)
|
||||
l.AddDomain("default")
|
||||
|
||||
userStore := h.userdataStore
|
||||
|
||||
// Fetch session data
|
||||
_, _, activeSym, _, _, _, err := h.getSessionData(ctx, sessionId)
|
||||
if err != nil {
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// Read vouchers from the store
|
||||
voucherData, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_VOUCHER_SYMBOLS)
|
||||
logg.InfoCtxf(ctx, "reading voucherData in GetVoucherList", "sessionId", sessionId, "key", storedb.DATA_VOUCHER_SYMBOLS, "voucherData", voucherData)
|
||||
@ -191,6 +201,11 @@ func (h *MenuHandlers) GetVoucherList(ctx context.Context, sym string, input []b
|
||||
return res, err
|
||||
}
|
||||
|
||||
if len(voucherData) == 0 {
|
||||
res.Content = l.Get("Your active voucher %s is already set", string(activeSym))
|
||||
return res, nil
|
||||
}
|
||||
|
||||
voucherBalances, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_VOUCHER_BALANCES)
|
||||
logg.InfoCtxf(ctx, "reading voucherBalances in GetVoucherList", "sessionId", sessionId, "key", storedb.DATA_VOUCHER_BALANCES, "voucherBalances", voucherBalances)
|
||||
if err != nil {
|
||||
@ -203,7 +218,7 @@ func (h *MenuHandlers) GetVoucherList(ctx context.Context, sym string, input []b
|
||||
|
||||
logg.InfoCtxf(ctx, "final output for GetVoucherList", "sessionId", sessionId, "finalOutput", finalOutput)
|
||||
|
||||
res.Content = finalOutput
|
||||
res.Content = l.Get("Select number or symbol from your vouchers:\n%s", finalOutput)
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@ -77,4 +77,10 @@ msgid "You can remove a maximum of %s %s from '%s' pool\n\nEnter amount of %s:"
|
||||
msgstr "Unaweza kuondoa kiwango cha juu cha %s %s kutoka kwenye '%s'\n\nWeka kiwango cha %s:"
|
||||
|
||||
msgid "Please confirm that you will use %s %s to remove your debt of %s %s\n"
|
||||
msgstr "Tafadhali thibitisha kwamba utatumia %s %s kulipa deni lako la %s %s.\nWeka PIN yako:"
|
||||
msgstr "Tafadhali thibitisha kwamba utatumia %s %s kulipa deni lako la %s %s.\nWeka PIN yako:"
|
||||
|
||||
msgid "Your active voucher %s is already set"
|
||||
msgstr "Sarafu yako %s ishachaguliwa"
|
||||
|
||||
msgid "Select number or symbol from your vouchers:\n%s"
|
||||
msgstr "Chagua nambari au ishara kutoka kwa sarafu zako:\n%s"
|
||||
@ -1,2 +1 @@
|
||||
Select number or symbol from your vouchers:
|
||||
{{.get_vouchers}}
|
||||
@ -1,2 +0,0 @@
|
||||
Chagua nambari au ishara kutoka kwa salio zako:
|
||||
{{.get_vouchers}}
|
||||
Loading…
Reference in New Issue
Block a user