-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SEPs: use Accept-Language
header instead of lang
request attribute
#1157
Comments
Agree - Language locale is more appropriate to use and I vote for header - "Accept-Language" |
I'm on the fence about this. I agree with the points in the description. Also: While Accept-Language exists, modifying a web page automatically based on the header can be at times confusing for a user. This might not apply to the pages served by SEP servers, but in typical web pages it is preferable to have a unique URL for a specific locale. Why: search engines index pages based on URLS, users share specific URLs expecting content to be consistent, using Accept-Language alone doesn't allow a user to change what page they're viewing and for multi-user devices not all users might want the same language. For a mobile app wallet that is communicating with a SEP server, it would also break the flow if the app is configured with lang X, but the phones default browser Accept-Language is configured with Y, X, and so then Y lang is used in pages loaded by the app. |
I was leaning towards preferring the "Accept-Language" header, but based on what @leighmcculloch stated maybe we could instead allowing the Sep-24 @vniranjankumar @JakeUrban how does that sound to you? |
Mike from Lobstr provided some input via Slack:
|
ISO639 is the first two-to-three letters in locale formats like en-US, so if we support the latter we support the former. Ideally implementers follow the typical fallback schemes, i.e. if user requests So, I think what we would reference in SEPs is: |
cc @mike-lobstr |
Based on all the conversation, I guess below is what we are leaning towards ? Please confirm.
|
Looking at the Sep-24 docs, there are currently only 2 endpoints which support the lang parameter:
Thoughts on adding |
If we are deprecating |
I don't see a problem with this. It makes sense that anchors be able to offer localization of messages in the response that are intended for passing through to the user. I think it is important to note that for any API response any localization should not impact the format of any fields intended for parsing by the requesting client, such as date-time fields, amount fields, etc. |
@lijamie98 @JakeUrban I think we should stick with We can pursue more explicit best practices with RFC4646 (ref) around how to use the lang value separately to this issue if folks think it is compelling. |
@lijamie98 @JakeUrban are you OK on keeping the |
That works for me 👍 |
Yes, that works. 👍 |
@lijamie98 @JakeUrban Great! Another proposal here was to also add the Let us know in case you have any objections to it, otherwise next week I'm planning on opening a PR to update the SEP with the |
@CassioMG That sounds good. 👍 |
@CassioMG @lijamie98 have we reached a consensus to use |
Yes, we've reached a consensus on using the This issue is safe to be closed |
What problem does your feature solve?
Many of our SEPs have a
lang
parameter or attribute in requests, which is meant to communicate to the anchor which language any human readable content should be returned in.However, there are two reasons why this is not ideal.
Language is not as specific as locale
The current
lang
parameter uses ISO 639-1 values, butAccept-Language
values often include the client's country in addition to the language. This additional information can have a significant impact on the content returned.Accept-Language is widely used
Many client applications may send the
Accept-Language
header in all requests, including those sent to anchor services. This creates the possibility of sending conflicting header andlang
parameter values.It is also very likely that many client applications have not implemented the inclusion of the
lang
parameter, but by default send theAccept-Language
header, which means anchors are missing information that could help them return better content.What would you like to see?
We should deprecate all usages of the
lang
parameter and instead instruct clients and server-side applications to use theAccept-Language
header.The text was updated successfully, but these errors were encountered: