Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7607391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:39:02+00:00 2026-05-31T00:39:02+00:00

I am working on a new project where I am trying to stick with

  • 0

I am working on a new project where I am trying to stick with some self-defined rules to see if I can solve old problems in a better way but I have few doubts and I would love some feedback from more experienced developers.

I am developing UI layer with bootstrap and jQuery, aspx is basically generating static html and doing a lot of ajax.

One old problem is localization in few different languages. What I am doing is wrapping localized fragments of the page in custom tags like below:

<localization culture="en" runat="server">
    <h3>Add everything...</h3>
    <p><i>Remember you can add also <a href="">by email</a> and <a href="">by gtalk</a>.</i></p>
</localization>
<localization culture="it" runat="server">
    <h3>Aggiungi tutto...</h3>
    <p><i>Ricorda che puoi farlo anche <a href="">via email</a> e <a href="">via gtalk</a>.</i></p>
</localization>

Then in my page_load I call a recursive function:

  protected void Page_Load(object sender, EventArgs e)
  {
     Localization(Page);
  }

Which do the following:

  protected void Localization(Control parent)
  {
     foreach (Control c in parent.Controls)
     {
        if (c.GetType() == typeof(HtmlGenericControl))
        {
           HtmlGenericControl hgc = (HtmlGenericControl)c;
           if( hgc.TagName == "localization")
           {
              if (hgc.Attributes["culture"] != null && hgc.Attributes["culture"] != lu.ui_culture)
              {
                 c.Visible = false;
              }
           }
        }

        Localization(c);
     }
  }

I can see few drawbacks in this approach: I can’t have the translations in a separate xml file and I am processing the html with a recursive function.

But at the same time I like it because it make it easy to translate fragments with a lot of html markup, and I can also have everything in one place.

In the past I was using a different approach, rendering the html with xslt+xml, but was a nightmare too, even if you succeed in being purist having no inline javascript and no inline CSS is visually complex to manage xml and html in one file.


So my questions are:

  1. is that a stupid solution?
  2. performance wise is it too bad?
  3. how could I manage the most dynamic content in a way non-techie people could edit a translation file?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:39:03+00:00Added an answer on May 31, 2026 at 12:39 am

    I ran some simple test, using the recursive function above, and doing some xslt to replace the text in the html according to the language selected.
    With the recursive function above it tool 0,001349 seconds, using the xslt it took 0,006989.
    Nevertheless at the end I choose to use xslt and then cache the results varying by language selected, to improve performance and be able to maintain all the translations in a single xml file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a new project and for some reason decided to create two
I am working on a new project and am trying to log into the
I'm creating a new web project and i trying to get jQuery working with
I am working on a new project and I am trying to write the
I'm after some guidance on a new project I'm working on that requires low
We're two people trying to get a new project up and running while working
I'm working on a new iPhone project and I'm running into problems with sqlite.
I am working on a new project for a client; they have supplied the
I'm working on a new project where I want to use Phil Haack Areas
I'm working on a new project with a full ANT build. I use eclipse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.