#NEWLINE# def get_translation_path( export_format , lang ) : #NEWLINE# #INDENT# '\n    Return the translation path from selected lang.\n\n    >>> print get_translation_path("excel", "en")\n    /home/Me/tests/libs/excel/en.json\n\n    :param export_format: type of exporter\n    :type export_format: str\n    \n    :param lang: language\n    :type lang: str\n    \n    :return: path to translation file.\n    :rtype: str\n\n    :raises: TypeError, ValueError\n    ' #NEWLINE# if ( not isinstance ( export_format , str ) ) : #NEWLINE# #INDENT# raise TypeError ( ( "Expected basestring, got '%s' instead" % type ( export_format ) ) ) #NEWLINE# #UNINDENT# if ( not isinstance ( lang , str ) ) : #NEWLINE# #INDENT# raise TypeError ( ( "Expected basestring, got '%s' instead" % type ( lang ) ) ) #NEWLINE# #UNINDENT# if any ( ( True for x in ( '/' , '\\' , '.' ) if ( ( x in export_format ) or ( x in lang ) ) ) ) : #NEWLINE# #INDENT# raise ValueError ( "'.' character is not allowed." ) #NEWLINE# #UNINDENT# if ( export_format . lower ( ) not in ( 'excel' , 'word' ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Export format not available' ) #NEWLINE# #UNINDENT# module_path = os . sep . join ( __file__ . split ( os . sep ) [ 0 : ( - 1 ) ] ) #NEWLINE# return os . path . join ( module_path , export_format , ( '%s.json' % lang ) )