Use of HTMLparser to change language

Terry Reedy tjreedy at udel.edu
Fri Mar 20 16:14:18 EDT 2009


pranav wrote:
> Greetings All,
> 
> I have huge number of HTML files, all in english. I also have their
> counterpart files in Spanish. The non english files have their look
> and feel a little different than their english counterpart.
> 
> My task is to make sure that the English HTML files contain the
> Spanish text, with retaining the English look and feel.

But then they will not be English files, but Spanish files.
> 
> The most obvious and stupid way is to open the English and Spanish
> files in some HTML Editor. Look for the english text, see its
> counterpart in spanish and then replace it. (I don't know spanish, but
> as i said the look and feel is only little different, so i can easily
> guess which text is what + google translate).

So it seems to me that your task is to convert the look and feel of the 
Spanish files to match the look and feel of the English files (which 
someone prefers).  So you could think of the problem as changing the 
markup in the Spanish files rather than as changing the text in the 
English files.  If there is a consistent style in both sets, then you 
should be able to formulate a set of rules to convert the Spanish files. 
  If the English files are each idiosyncratic, then I do not envy you.

[Comment: stylesheets (or templates) make it a LOT easier to quickly 
change the style of multiple files.]

tjr




More information about the Python-list mailing list