Compare commits

...

9 Commits

53 changed files with 87 additions and 41 deletions

View File

@ -116,6 +116,7 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, userdataStore
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob) rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit) rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction) rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
rs.AddLocalFunc("set_new_language", ussdHandlers.SetNewLanguage)
return ussdHandlers, nil return ussdHandlers, nil
} }

View File

@ -86,6 +86,7 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, userdataStore
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob) rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit) rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction) rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
rs.AddLocalFunc("set_new_language", ussdHandlers.SetNewLanguage)
return ussdHandlers, nil return ussdHandlers, nil
} }

View File

@ -76,6 +76,7 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, userdataStore
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob) rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit) rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction) rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
rs.AddLocalFunc("set_new_language", ussdHandlers.SetNewLanguage)
return ussdHandlers, nil return ussdHandlers, nil
} }

View File

@ -71,6 +71,7 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, pe *persist.P
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob) rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit) rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction) rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
rs.AddLocalFunc("set_new_language", ussdHandlers.SetNewLanguage)
return ussdHandlers, nil return ussdHandlers, nil
} }

View File

@ -968,3 +968,22 @@ func (h *Handlers) GetProfileInfo(ctx context.Context, sym string, input []byte)
return res, nil return res, nil
} }
// SetNewLanguage sets the new language based on user input
func (h *Handlers) SetNewLanguage(ctx context.Context, sym string, input []byte) (resource.Result, error) {
var res resource.Result
inputStr := string(input)
switch inputStr {
case "0":
res.FlagSet = append(res.FlagSet, state.FLAG_LANG)
res.Content = "eng"
case "1":
res.FlagSet = append(res.FlagSet, state.FLAG_LANG)
res.Content = "swa"
default:
}
return res, nil
}

View File

@ -1 +1 @@
Salio Salio:

View File

@ -0,0 +1 @@
Select language:

View File

@ -0,0 +1,10 @@
LOAD reset_account_authorized 0
LOAD reset_incorrect 0
CATCH incorrect_pin flag_incorrect_pin 1
CATCH pin_entry flag_account_authorized 0
MOUT english 0
MOUT kiswahili 1
HALT
INCMP language_changed 0
INCMP language_changed 1
INCMP . *

View File

@ -0,0 +1 @@
Chagua lugha:

View File

@ -1,2 +1 @@
Your community balance is: 0.00SRF Your community balance is: 0.00SRF

View File

@ -0,0 +1 @@
Your language change request was successful.

View File

@ -0,0 +1,6 @@
LOAD set_new_language 6
MOUT back 0
MOUT quit 9
HALT
INCMP ^ 0
INCMP quit 9

View File

@ -0,0 +1 @@
Ombi lako la kubadilisha lugha limefanikiwa.

View File

@ -9,6 +9,7 @@ MOUT back 0
HALT HALT
INCMP _ 0 INCMP _ 0
INCMP edit_profile 1 INCMP edit_profile 1
INCMP change_language 2
INCMP balances 3 INCMP balances 3
INCMP pin_management 5 INCMP pin_management 5
INCMP address 6 INCMP address 6

View File

@ -0,0 +1 @@
Quit

View File

@ -0,0 +1 @@
Ondoka

View File

@ -1 +1,2 @@
Wasifu wangu Wasifu wangu:
{{.get_profile_info}}