Custom DetectDeviceLanguage behavior?
			
	
						7 years 3 days ago		 -  7 years 3 days ago		#3279
		by bkane
	
	
		
			
	
	
			 		
													
	
				Custom DetectDeviceLanguage behavior? was created by bkane			
			
				Hi Frank,
I have a platform that returns its system language as a region/language code (e.g. "en" instead of "English"). It's similar to how Android is handled in LocalizationManager_SystemLanguage.cs, where the language code gets converted to a language name via "GoogleLanguages.GetLanguageName".
It's trivial enough to add the logic we need by modifying LocalizationManager.DetectDeviceLanguage directly, but I was curious if there was a better approach. The approaches used by things like the SpecializationManager and CustomPersistentStorage are great, and allow us to avoid losing modifications when we upgrade I2Loc versions.
Thanks!
- Ben
Edit: Currently using 2.8.9f1 from the Asset Store.
					I have a platform that returns its system language as a region/language code (e.g. "en" instead of "English"). It's similar to how Android is handled in LocalizationManager_SystemLanguage.cs, where the language code gets converted to a language name via "GoogleLanguages.GetLanguageName".
It's trivial enough to add the logic we need by modifying LocalizationManager.DetectDeviceLanguage directly, but I was curious if there was a better approach. The approaches used by things like the SpecializationManager and CustomPersistentStorage are great, and allow us to avoid losing modifications when we upgrade I2Loc versions.
Thanks!
- Ben
Edit: Currently using 2.8.9f1 from the Asset Store.
		Last edit: 7 years 3 days ago  by bkane.			
			Please Log in or Create an account to join the conversation.
		Time to create page: 0.184 seconds