Can hpricot help me substitute hardcoded strings and if not please point me in the right direction

2 views
Skip to first unread message

Neil H

unread,
Nov 22, 2012, 9:32:37 AM11/22/12
to hpric...@googlegroups.com
I have an issue whereby we have a large site written in ASP.net (I don'y get to choose the tools we use).

We have been tasked with localizing the site - which is a bit of a task as there will be bits of free text all about the place.

I need to detect these things, and ideally substitute them for a control which can be localised.

for example:
.....
<td><strong>Why do we use tables?</strong></td>
<td>We are timid.<td>
.....
needs to become 
.....
<td><strong><asp:label runat="server" text="Why do we use tables?" /></strong></td>
<td><asp:label runat="server" text="We are timid." /><td>
.....

Given you can syntax highlight these things, I figured I could get a robust regex to do this for me, but no luck without bunches of false positives.

So to the questions:
  1. Will hpricot be upset at me feeding it aspx files (presumably well formed with very little javascript)
  2. Can I use hpricot to make the substitution
  3. If yes to these - can you point me toward an example
  4. If no to the above - can you point me toward another tool?
All responses are appreciated. The site is massive, and although the .Net localisation stuff is pretty workable, all the Visual Studio based tools to help are mince at the html like part, and work on the codebehind.

Thanks!
Reply all
Reply to author
Forward
0 new messages