Skip to content

Auto-select language and save cookie on language change

The language of the Totem website should be automatically selected if people's Accept-Language header corresponds to one of the hosted languages.

If the user changes the language based on the dropdown, this should be saved in a cookie. That cookie should be secure and stay available for long.

Example cookie:

openedx-language-preference=es;expires=Tue Dec 14 2021 15:52:25 GMT+0100 (Central European Standard Time);domain=.totem-project.org;secure=true

Note that the domain is .totem-project.org so learn.totem-project.org can access it too.

Make the date like this:

myDate = Date(); myDate.setMonth(myDate.getMonth() + 3)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information