<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate(env,**kw):
 """ Generate `msgfmt` tool """

  import SCons.Util
  from SCons.Tool.GettextCommon import _detect_msgfmt
  try:
    env['MSGFMT'] = _detect_msgfmt(env)
  except:
    env['MSGFMT'] = 'msgfmt'
  env.SetDefault(
    MSGFMTFLAGS = [ SCons.Util.CLVar('-c') ],
    MSGFMTCOM = '$MSGFMT $MSGFMTFLAGS -o $TARGET $SOURCE',
    MSGFMTCOMSTR = '',
    MOSUFFIX = ['.mo'],
    POSUFFIX = ['.po']
  )
  env.Append( BUILDERS = { 'MOFiles'  : _create_mo_file_builder(env) } )