diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index fa0c532..28f6854 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -2196,7 +2196,7 @@ func (h *MenuHandlers) persistInitialLanguageCode(ctx context.Context, sessionId if !db.IsNotFound(err) { return err } - err = store.WriteEntry(ctx, sessionId, storedb.DATA_SELECTED_LANGUAGE_CODE, []byte(code)) + err = store.WriteEntry(ctx, sessionId, storedb.DATA_INITIAL_LANGUAGE_CODE, []byte(code)) if err != nil { logg.ErrorCtxf(ctx, "failed to persist initial language code", "key", storedb.DATA_INITIAL_LANGUAGE_CODE, "value", code, "error", err) return err diff --git a/handlers/application/menuhandler_test.go b/handlers/application/menuhandler_test.go index cf5b4a5..3244ce4 100644 --- a/handlers/application/menuhandler_test.go +++ b/handlers/application/menuhandler_test.go @@ -825,6 +825,17 @@ func TestSetLanguage(t *testing.T) { // Assert that the Result FlagSet has the required flags after language switch assert.Equal(t, res, tt.expectedResult, "Result should match expected result") + code, err := store.ReadEntry(ctx, sessionId, storedb.DATA_SELECTED_LANGUAGE_CODE) + if err != nil { + t.Error(err) + } + + assert.Equal(t, string(code), tt.expectedResult.Content) + code, err = store.ReadEntry(ctx, sessionId, storedb.DATA_INITIAL_LANGUAGE_CODE) + if err != nil { + t.Error(err) + } + assert.Equal(t, string(code), "eng") }) } }