-
Notifications
You must be signed in to change notification settings - Fork 12
Use the interface language to generate the document list #73
Conversation
So that the interface language can be read on the server-side.
624e0a6
to
0821cfb
Compare
Looks good to me. For anonymous users, using a cookie to store the lang pref looks relevent. |
Yep! |
I'm OK for merging then (unless you want to change the cookie expiration time first). |
Ok, I set the expire date to 1 year. Note, that I also pushed a commit removing the method |
OK for you @gberaudo ? |
Isn't it possible to avoid using cookies for anonymous users ? Would this be just for a single URL or for every URL served by the UI app ? I'm worried as this makes these elements hostile to caching. An alternative behaviour I can imagine would be to use the browser's language to display (or redirect to) the page in the correct language, and use the url to define the language used ( Or is this purely in the javascript part ? I'm basically reacting to this as I noticed the |
Unless there is a fondamental issue with caching, I am OK for merging. |
console.log('Failed to save interface language', e); | ||
} | ||
} | ||
// store the interface language as cookie, so that it is available on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obsolete comment, it is now 1 year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noticing.
As I understand it, by default Varnish resets the cookie because cookies often contain authentication information like the session id. In our case, we are not storing the authentication token in a cookie. We are just using the cookie to communicate the interface language to the server. Like you say, an alternative would be to make it an URL parameter. But if we configure Varnish properly (extract the language from the cookie and make it part of the cache key), we shouldn't have a problem with it. What do you think? |
31b1ece
to
b8325a4
Compare
Use the interface language to generate the document list
Requires c2corg/v6_api#115