Advice for translating a huge web app into different languages RRS feed

  • Question

  • User1090916182 posted

    Hi All!

    I currently have an internet application which is pretty large (approximately 100 pages).  Many use webcontrols, and many use text wrapped in <p> tags.  Also, many inject content into the page using literals from code behind, based on user interactions.

    I am now faced with translating it all into Norwegian (and maybe Kenyan too in future), so was wondering what the best approach is for this?  I've read all the tutorials I can find on ways to do this, but many seem to be largely focussed on using XML files containing the content for the webcontrols' Text property.

    I have considered multiple approaches so far:

    1. Duplicate the entire app and translate accordingly
      Disadvantage:  Twice as much server-side logic to maintain when changes are made
    2. Use XML files to contain different languages
      Disadvantage:  I don't think this works for static content in general HTML tags (I think Sealed)
    3. Create a control to show the correct language based on a user's Session variable (see below)
      Disadvantage: Not sure how easy this is to deal with currencies/cultures, etc.

    For Static Content

    <my:control runat="server">
        <template lang="en">
             <p>Hello, and welcome to a page of static content delivered in multiple languages!</p>
        <template lang="no">
            <p>Hei, og velkommen til en side med statisk innhold leveres på flere språk!</p>

    For Dynamic Content

    myLabel.Text = myTranslator("Hello", "Hei")
    myButton.Text = myTranslator("View Report Results", "Vis rapport resultater")

    Since we are now approaching version 4 of ASP.NET, I wondered if there were any new developments?  Also, what approaches have others used and how have they found the process?

    I welcome any feedback and hope this will be a useful resource for others to read in future... Smile

    Thursday, December 3, 2009 7:57 AM

All replies

  • User1925485754 posted


    Dynamic text is always a pain.

    Thursday, December 3, 2009 8:25 AM
  • User1090916182 posted

    Hi G0ggy

    Thanks for that link.  I had not seen that tutorial, but in fact it is better than most others that are available.   I was not aware that you could simply inject the relevant language into an otherwise static page (if I've read it correctly...!):

    <p><%$ Resources:myApp, MyIntroText %></p>

    That makes things a lot easier, although, as you say, dynamic text is going to be a real pain.  Also there's the issue that my app will double in size in terms of page numbers as all the resource files begin to appear...! Undecided

    Thursday, December 3, 2009 8:51 AM
  • User1925485754 posted

    The resource files compile (if that's the right word) to XML and are fairly lightweight, but yes, you will need 1 resource file, per page, per language!

    Thursday, December 3, 2009 10:53 AM
  • User1090916182 posted

    Yes I suppose whatever option is taken to achieve this, you will end up with lots of code - either in XML files or inline with your logic...

    I just wish there was a better way! Sealed

    Thursday, December 3, 2009 11:05 AM