wsprd: Pass the user language between wspr and JS
Fixes: https://github.com/vanadium/issues/issues/364
MultiPart: 2/2
Change-Id: I31ca64005c9d04b462658e0fcfc8f6dc278e0b34
diff --git a/services/wspr/internal/app/app.go b/services/wspr/internal/app/app.go
index baa5bda..1496e41 100644
--- a/services/wspr/internal/app/app.go
+++ b/services/wspr/internal/app/app.go
@@ -17,6 +17,7 @@
"v.io/v23"
"v.io/v23/context"
+ "v.io/v23/i18n"
"v.io/v23/naming"
"v.io/v23/options"
"v.io/v23/rpc"
@@ -510,6 +511,7 @@
vlog.VI(2).Infof("Rpc: %s.%s(..., streaming=%v)", msg.Name, msg.Method, msg.IsStreaming)
spanName := fmt.Sprintf("<wspr>%q.%s", msg.Name, msg.Method)
ctx, span := vtrace.WithContinuedTrace(ctx, spanName, msg.TraceRequest)
+ ctx = i18n.WithLangID(ctx, i18n.LangID(msg.Context.Language))
var cctx *context.T
var cancel context.CancelFunc