wip-account-creation #4

Merged
lash merged 143 commits from wip-account-creation into master 2024-08-30 14:37:58 +02:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit 3fdd702e93 - Show all commits

View File

@ -739,6 +739,9 @@ func (h *Handlers) QuitWithBalance(ctx context.Context, sym string, input []byte
// on the JSON file. // on the JSON file.
func (h *Handlers) InitiateTransaction(ctx context.Context, sym string, input []byte) (resource.Result, error) { func (h *Handlers) InitiateTransaction(ctx context.Context, sym string, input []byte) (resource.Result, error) {
res := resource.Result{} res := resource.Result{}
code := codeFromCtx(ctx)
l := gotext.NewLocale(translationDir, code)
l.AddDomain("default")
accountData, err := h.accountFileHandler.ReadAccountData() accountData, err := h.accountFileHandler.ReadAccountData()
if err != nil { if err != nil {
@ -748,12 +751,7 @@ func (h *Handlers) InitiateTransaction(ctx context.Context, sym string, input []
// TODO // TODO
// Use the amount, recipient and sender to call the API and initialize the transaction // Use the amount, recipient and sender to call the API and initialize the transaction
switch codeFromCtx(ctx) { res.Content = l.Get("Your request has been sent. %s will receive %s from %s.", accountData["Recipient"], accountData["Amount"], accountData["PublicKey"])
case "swa":
res.Content = fmt.Sprintf("Ombi lako limetumwa. %s atapokea %s kutoka kwa %s.", accountData["Recipient"], accountData["Amount"], accountData["PublicKey"])
default:
res.Content = fmt.Sprintf("Your request has been sent. %s will receive %s from %s.", accountData["Recipient"], accountData["Amount"], accountData["PublicKey"])
}
// reset the transaction // reset the transaction
accountData["Recipient"] = "" accountData["Recipient"] = ""

View File

@ -1,3 +1,5 @@
msgid "Your account balance is %s" msgid "Your account balance is %s"
msgstr "Salio lako ni %s" 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."