Language priority when a page is displayed
								
							
								
									 
									
Written By
										
	                       István Gergely-Tárnoki
										
									 
								
									
									How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
									While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
								 
								 
							 
						 
					 
						
							
								
							
							
								
Legacy Article								
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee. 
Before using any information from this article, independently verify its
suitability for your situation and project.							
 
						 
				 
				
						
Issue
- Which localization is being used when a page is displayed?
 
Resolution
- The language of a page can be determined by 3 factors:
- the page URL (whether there is a language id)
- GUEST_LANGUAGE_ID cookie
- jsessionid cookie (session variables)
 
- If we are using the default portal property:prepend.friendly.url.style=3, then we can ignore the page URL factor.
 
 
- Language settings are being stored in one cookie in your browser, which is GUEST_LANGUAGE_ID. 
 
 
- The way it works is the following: 
- if set for user, read that
- if not set for user, read group (site)
- if not set for site, read company (portal)
 
 
 
- The result will be one cookie: GUEST_LANGUAGE_ID. If the guest user sets the language to another then the default, it gets saved to the GUEST_LANGUAGE_ID. 
- GUEST_LANGUAGE_ID is being used by both the Guest user and a logged-in user. If the user logs in, then its language ID will be fetched from the database and gets put into the same cookie. This will overwrite the guest's language preference, which will be lost.
 
 
- As for the jsessionid, it gets reset whenever a user logs in and logs out. This means that the previous guest user's languageId would also not be retained by the session.
 
 
				
				
				
				
					
Did this article resolve your issue ?