Dont fail when importing plugin_i18n for tests
This commit is contained in:
		
							parent
							
								
									1196e1df0d
								
							
						
					
					
						commit
						cb05671254
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -21,7 +21,13 @@ import gettext
 | 
			
		|||
from gajim.common import configpaths
 | 
			
		||||
 | 
			
		||||
DOMAIN = 'gajim_plugins'
 | 
			
		||||
plugin_user_dir = configpaths.get('PLUGINS_USER')
 | 
			
		||||
try:
 | 
			
		||||
    plugin_user_dir = configpaths.get('PLUGINS_USER')
 | 
			
		||||
except KeyError:
 | 
			
		||||
    # This allows to import the module for tests
 | 
			
		||||
    print('No plugin translation path available')
 | 
			
		||||
    plugin_user_dir = ''
 | 
			
		||||
 | 
			
		||||
plugins_locale_dir = os.path.join(plugin_user_dir, 'locale')
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue