Fix a bug when there no language sent (many OPDS client do that).
This commit is contained in:
		
							parent
							
								
									211f90e2f3
								
							
						
					
					
						commit
						62a6e1d412
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		
							
								
								
									
										6
									
								
								base.php
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								base.php
									
										
									
									
									
								
							|  | @ -48,7 +48,11 @@ function localize($phrase) { | ||||||
|     static $translations = NULL; |     static $translations = NULL; | ||||||
|     /* If no instance of $translations has occured load the language file */ |     /* If no instance of $translations has occured load the language file */ | ||||||
|     if (is_null($translations)) { |     if (is_null($translations)) { | ||||||
|         $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); |         $lang = "en"; | ||||||
|  |         if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) | ||||||
|  |         { | ||||||
|  |             $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); | ||||||
|  |         } | ||||||
|         $lang_file_en = NULL; |         $lang_file_en = NULL; | ||||||
|         $lang_file = 'lang/Localization_' . $lang . '.json'; |         $lang_file = 'lang/Localization_' . $lang . '.json'; | ||||||
|         if (!file_exists($lang_file)) { |         if (!file_exists($lang_file)) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue