call the method os.path.dirname with an argument potfile, join the result, locale and string 'LC_MESSAGES' into a file path,
basedir = os . path . join ( os . path . dirname ( potfile ) , locale , 'LC_MESSAGES' )