mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	fix: #1210 change default lang to en
This commit is contained in:
		@@ -22,6 +22,7 @@ export const AllLangs = [
 | 
				
			|||||||
export type Lang = (typeof AllLangs)[number];
 | 
					export type Lang = (typeof AllLangs)[number];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const LANG_KEY = "lang";
 | 
					const LANG_KEY = "lang";
 | 
				
			||||||
 | 
					const DEFAULT_LANG = "en";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function getItem(key: string) {
 | 
					function getItem(key: string) {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
@@ -41,7 +42,8 @@ function getLanguage() {
 | 
				
			|||||||
  try {
 | 
					  try {
 | 
				
			||||||
    return navigator.language.toLowerCase();
 | 
					    return navigator.language.toLowerCase();
 | 
				
			||||||
  } catch {
 | 
					  } catch {
 | 
				
			||||||
    return "cn";
 | 
					    console.log("[Lang] failed to detect user lang.");
 | 
				
			||||||
 | 
					    return DEFAULT_LANG;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -60,7 +62,7 @@ export function getLang(): Lang {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return "en";
 | 
					  return DEFAULT_LANG;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function changeLang(lang: Lang) {
 | 
					export function changeLang(lang: Lang) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user