I am modifying an existing working .wmk file to turn a monolingual site
into a bilingual one. I believe I have the lang_tag plugin working
properly, but my output code -- which worked fine as a monolingual site
-- is no longer working as expected. The relevant portion of my .wmk
file is:

First, source files are defined. They are in the ../src directory or
subdirectories thereof, and have the extension .txt. One source file
corresponds to one html output file in each language (e.g. foo.txt maps
to foo.en.html and foo.es.html). This part is unchanged from my working
monolingual site code, and seems to be working as desired.

Then output files are created. Here I took my working monolingual site
code and ran through it twice, first for Spanish (es) and then for
English (en). The English pages (last to be output) are made as
expected, but the Spanish pages are made with English headers and
footers. If I reverse the order of output (English first, then Spanish)
the problem is reversed: the Spanish pages are fine and the English ones
have Spanish headers and footers.

Presumably my output files section is buggy but I can´t for the life of
me spot what my problem is. Any ideas?