| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | import { createContext } from 'use-context-selector' | 
					
						
							|  |  |  | import type { Locale } from '@/i18n' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type II18NContext = { | 
					
						
							|  |  |  |   locale: Locale | 
					
						
							| 
									
										
										
										
											2023-08-23 13:54:40 +08:00
										 |  |  |   i18n: Record<string, any> | 
					
						
							|  |  |  |   setLocaleOnClient: (locale: Locale, reloadPage?: boolean) => void | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const I18NContext = createContext<II18NContext>({ | 
					
						
							| 
									
										
										
										
											2024-02-23 14:31:06 +08:00
										 |  |  |   locale: 'en-US', | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   i18n: {}, | 
					
						
							| 
									
										
										
										
											2023-08-23 13:54:40 +08:00
										 |  |  |   setLocaleOnClient: (lang: Locale, reloadPage?: boolean) => { }, | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default I18NContext |