dir $(SolutionDir)*.cs /S /B > projectfiles.txt
dir $(SolutionDir)*.aspx /S /B >> projectfiles.txt
dir $(SolutionDir)*.ascx /S /B >> projectfiles.txt
dir $(SolutionDir)*.master /S /B >> projectfiles.txt
rem create the english messages folder if it do not exists
if not exist $(ProjectDir)locale\en\LC_MESSAGES mkdir $(ProjectDir)locale\en\LC_MESSAGES
rem create a new .pot from sources
$(SolutionDir)lib\Gnu\xgettext.exe -k_ --from-code=UTF-8 -LC# --omit-header -o$(ProjectDir)locale\en\LC_MESSAGES\newmessages.pot -fprojectfiles.txt --force-po
rem create messages.po file if it do not exists
if not exist $(ProjectDir)locale\en\LC_MESSAGES\messages.po copy $(ProjectDir)locale\en\LC_MESSAGES\newmessages.pot $(ProjectDir)locale\en\LC_MESSAGES\messages.po
rem merge .pot file with existing messages.po
$(SolutionDir)lib\Gnu\msgmerge.exe --backup=none -U $(ProjectDir)locale\en\LC_MESSAGES\messages.po $(ProjectDir)locale\en\LC_MESSAGES\newmessages.pot
rem create a new spanish messages folder if it do not exists
if not exist $(ProjectDir)locale\es\LC_MESSAGES mkdir $(ProjectDir)locale\es\LC_MESSAGES
rem create messages.po file if it do not exists
if not exist $(ProjectDir)locale\es\LC_MESSAGES\messages.po copy $(ProjectDir)locale\en\LC_MESSAGES\newmessages.pot $(ProjectDir)locale\es\LC_MESSAGES\messages.po
rem Merge the newly created .pot file with the Spanish translations:
$(SolutionDir)lib\Gnu\msgmerge.exe --backup=none -U $(ProjectDir)locale\es\LC_MESSAGES\messages.po $(ProjectDir)locale\en\LC_MESSAGES\newmessages.pot