From 162e6c19343a4b12f2eb5230686da1684e7fb8ee Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Fri, 3 Jan 2025 11:26:56 +0300 Subject: [PATCH] fix: language change --- internal/utils/isocode.go | 6 +++--- services/registration/change_language.vis | 2 +- services/registration/set_default.vis | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 services/registration/set_default.vis diff --git a/internal/utils/isocode.go b/internal/utils/isocode.go index 3bdfbeb..692b7bb 100644 --- a/internal/utils/isocode.go +++ b/internal/utils/isocode.go @@ -1,9 +1,9 @@ package utils var isoCodes = map[string]bool{ - "eng": true, // English - "swa": true, // Swahili - + "eng": true, // English + "swa": true, // Swahili + "default": true, // Default language: English } func IsValidISO639(code string) bool { diff --git a/services/registration/change_language.vis b/services/registration/change_language.vis index 8b1def9..f20bcfb 100644 --- a/services/registration/change_language.vis +++ b/services/registration/change_language.vis @@ -5,6 +5,6 @@ CATCH pin_entry flag_account_authorized 0 MOUT english 1 MOUT kiswahili 2 HALT -INCMP set_default 1 +INCMP set_eng 1 INCMP set_swa 2 INCMP . * diff --git a/services/registration/set_default.vis b/services/registration/set_default.vis new file mode 100644 index 0000000..b66a1b7 --- /dev/null +++ b/services/registration/set_default.vis @@ -0,0 +1,4 @@ +LOAD set_language 6 +RELOAD set_language +CATCH terms flag_account_created 0 +MOVE language_changed