Redirect to localized login page after logout

I’m implementing a logout feature and would like to control the language of the login screen shown after logout.

Specifically, is there a recommended way to store or pass a language preference (for example via session, cookie, query parameter, or request header) during logout, so that after the user logs out they are redirected to the login page in the specified language?

Example scenario:

  • User logs out before using en (or ja, etc.) in app

  • Language is set to en (or ja, etc.)

  • User is redirected to /login with the login UI already localized to that language

I’m interested in best practices and common approaches for this, especially in API-based or SPA architectures.

Any advice or real-world patterns would be appreciated.