Skip to content

Commit

Permalink
fix: next rpc svc fetch lang failed
Browse files Browse the repository at this point in the history
  • Loading branch information
SpectatorNan committed Jul 30, 2024
1 parent 1171869 commit 6c2bdb0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion goi18nx/rpc_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,9 @@ func (i *I18nGrpcInterceptor) saveLocalize(ctx context.Context) (context.Context
langTag := MatchCurrentLanguageTag(lang, i.supportTags)
bundle := NewBundle(langTag, i.localizationFiles...)
localizer := i18n2.NewLocalizer(bundle, lang)
return setLocalizer(ctx, localizer), nil
ctx = setLocalizer(ctx, localizer)

// Append the language metadata to the outgoing context
ctx = metadata.AppendToOutgoingContext(ctx, defaultLangHeaderKey, lang)
return ctx, nil
}

0 comments on commit 6c2bdb0

Please sign in to comment.