split symbol

This commit is contained in:
Carlosokumu 2024-09-18 09:39:53 +03:00
parent 4098ac8a19
commit 8feee318b7
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953

View File

@ -123,12 +123,12 @@ func (h *Handlers) SetLanguage(ctx context.Context, sym string, input []byte) (r
var res resource.Result var res resource.Result
sym, _ = h.st.Where() sym, _ = h.st.Where()
code := strings.Split(sym, "_")[1]
switch sym { switch code {
case "set_default": case "default":
res.FlagSet = append(res.FlagSet, state.FLAG_LANG) res.FlagSet = append(res.FlagSet, state.FLAG_LANG)
res.Content = "eng" res.Content = "eng"
case "set_swa": case "swa":
res.FlagSet = append(res.FlagSet, state.FLAG_LANG) res.FlagSet = append(res.FlagSet, state.FLAG_LANG)
res.Content = "swa" res.Content = "swa"
default: default:
@ -645,7 +645,6 @@ func (h *Handlers) QuitWithHelp(ctx context.Context, sym string, input []byte) (
return res, nil return res, nil
} }
// VerifyYob verifies the length of the given input // VerifyYob verifies the length of the given input
func (h *Handlers) VerifyYob(ctx context.Context, sym string, input []byte) (resource.Result, error) { func (h *Handlers) VerifyYob(ctx context.Context, sym string, input []byte) (resource.Result, error) {
var res resource.Result var res resource.Result