It's not outrageous to read HTTP standard headers from gRPC. I'm not super-well versed with grpc-gateway, but I'm not seeing any configuration for this supported by grpc-gateway. (SystemParameters <https://cloud.google.com/service-infrastructure/docs/service-management/reference/rpc/google.api#google.api.SystemParameters> *may* be a solution, but it doesn't seem supported by grpc-gateway and is unclear if it is the "right" solution.)
So I guess either just read from Accept-Language directly or add the "string language_preferences=2" and read from Accept-Language if language_preferences is empty. On Mon, Nov 12, 2018 at 5:28 AM Mark Wardle <m...@wardle.org> wrote: > > Dear all, > > I have a gRPC service that provides results that can be localized. I am > using gRPC as well as the grpc-gateway to automatically generate a REST > service running in parallel. > > The usual way of specifying locale preferences in REST services is via > Accept-Language tags. As this is, strictly speaking, part of the API > contract, does it make sense to write a gRPC service description that > explicitly documents this parameter. I could therefore easily add a "string > language_preferences=2" to the request message definition? If so, is there > a clever way to populate this in the grpc-gateway much like URL parameters? > > Or is there a better way of handling language preferences in grpc and > grpc-gateway? > > Many thanks, > > Mark > > -- > You received this message because you are subscribed to the Google Groups " > grpc.io" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to grpc-io+unsubscr...@googlegroups.com. > To post to this group, send email to grpc-io@googlegroups.com. > Visit this group at https://groups.google.com/group/grpc-io. > To view this discussion on the web visit > https://groups.google.com/d/msgid/grpc-io/8033c8e1-2516-40b2-889d-60885ca77419%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/8033c8e1-2516-40b2-889d-60885ca77419%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CA%2B4M1oOrSWjPR4%2BbrGZPibNs48L%3DMxWxfgvt7x8C0Y%2BJTEXayQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
smime.p7s
Description: S/MIME Cryptographic Signature