Use gettext for the Quit function

This commit is contained in:
Alfred Kamanda 2024-08-29 23:05:41 +03:00
parent 75ca39b012
commit ca86ef1507
Signed by untrusted user: Alfred-mk
GPG Key ID: 7EA3D01708908703
2 changed files with 9 additions and 6 deletions

View File

@ -452,12 +452,12 @@ func (h *Handlers) CheckAccountStatus(ctx context.Context, sym string, input []b
// Quit displays the Thank you message and exits the menu
func (h *Handlers) Quit(ctx context.Context, sym string, input []byte) (resource.Result, error) {
res := resource.Result{}
switch codeFromCtx(ctx) {
case "swa":
res.Content = "Asante kwa kutumia huduma ya Sarafu. Kwaheri!"
default:
res.Content = "Thank you for using Sarafu. Goodbye!"
}
code := codeFromCtx(ctx)
l := gotext.NewLocale(translationDir, code)
l.AddDomain("default")
res.Content = l.Get("Thank you for using Sarafu. Goodbye!")
res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_UNLOCKED)
return res, nil
}

View File

@ -3,3 +3,6 @@ msgstr "Salio lako ni %s"
msgid "Your request has been sent. %s will receive %s from %s."
msgstr "Ombi lako limetumwa. %s atapokea %s kutoka kwa %s."
msgid "Thank you for using Sarafu. Goodbye!"
msgstr "Asante kwa kutumia huduma ya Sarafu. Kwaheri!"