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 3600596
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:30:55+00:00 2026-05-18T20:30:55+00:00

Background: I am working on a site that will be available in multiple regions.

  • 0

Background:

I am working on a site that will be available in multiple regions. Each region can have a different language, or different spellings for the same language. We are planning on using an XML label file which will contain all the text that will be displayed for any given region.

So regionA will load RegionALabels.xml and all of its text will come from that. RegionB will load RegionBLabels.xml, and so on.

I’m thinking of implementing this by structuring the XML file so that it follows the same structure as my application. For example,

<Base> <!--BaseController-->
  <Home> <!--HomeController-->
    <HomePartial1>
      <lblFirstName>text for label with ID lblFirstName</lblFirstName>
      <lblLastName>text for label with ID lblLastName</lblLastName>
    </HomePartial1>
    <HomePartial2>
      <!--a bunch of labels-->
    </HomePartial2>
  </Home>
  <Accounts>
    <AccountsPartial1>
      <!--a bunch of labels-->
    </AccountsPartial1>
    <AccountsPartial2>
      <!--a bunch of labels-->
    </AccountsPartial2>
  </Accounts>
</Base>

The reason I want to do it this way is because I want to imploy Convention over Configuration, so it becomes implicit where to find the text for any given partial view.

using this structure, I can use Linq-to-XML to select the text relevant to the partial view I’m going to Render. For example, if I’m rendering the partial view HomePartial1, I can get the labels associated with that partial view with something like:

        var nodes = from f in
                        (from res in this.XmlConfiguration.Descendants("Base")
                         select res).Descendants("Home")
                    select f;

        var HomePartial1Labels = nodes.Elements("HomePartial1").ToList();

Question:

So this being the case, basically what I want to ask is if anyone can point out any obvious holes in this approach before I attempt to implement this? Can anyone who has dealt with this before suggest something better?

also, I have one specific requriement to render a partial view with a number of tabs, each of which has to display text & a number of results associated with that tab. For example, I have 3 tabs:

Fund
Company
Group

If somebody does a search, the tabs have to display the number of results the search term returns for the tab, so if I search for ‘JP Morgan’ they become:

Fund (10) // 10 funds contain the name 'JP Morgan'
Company (12) // 12 companies contain the name 'JP Morgan'
Group (15) // 15 groups contain the name 'JP Morgan'

In order to contain the text “Fund”, “Company” and “Group” in the label file, I’m going to have to supply the “(” and “)” also, which means I think I’ll have to use a place holder and replace it with the actual value when I’m rendering the partial. So the XML will begin to look like:

<Base> <!--BaseController-->
  <Home> <!--HomeController-->
    <Tabs>
      <lblFundTab>Funds (#value#)</lblFundTab>
      <lblCompanyTab>Company (#value#)</lblCompanyTab>
      <lblGroupTab>Group (#value#)</lblGroupTab>
    </Tabs>
  </Home>
</Base>

but I think this is going to start to look messy and a little hackish. Can somebody suggest something better? Thanks.

  • 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-18T20:30:56+00:00Added an answer on May 18, 2026 at 8:30 pm

    I have recently had the same thing in a project.

    I implemented a LabelService that essesntially wrapped a Singleton array of “LabelFiles” which were loaded into memory on application_start. So my code looks similar but is working on in memory objects and not xml files avoiding a lot of potential IO issues (locks etc).

    Your xml label file is fine, assuming it is to be edited by an application or possibly a developer but if it is going to be edited by the client /non-techie how are they to know what “base” is? Or controller? Etc etc – I’m a fan of CoC but sometimes it is better to stick closer to the domain terminology for domain-specific apps.

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

Sidebar

Related Questions

Background: I am working on a site that will be available in multiple regions.
I am working on a background program that will be running for a long
Background: We have an offshore group working up a Silverlight 2 prototype for us.
Background Lately I've become a fanatic that everything I type while working on a
i'm working with a multi-threaded program (using pthreads) that currently create a background thread
First a bit of background. I have been working on the MS platform for
Background I am working on a legacy small-business automation system (inventory, sales, procurement, etc.)
Background I am working on a phonetic converter program which converts english text into
I am working with: #top ul li.corner span.right-corner:hover { background-image:url(images/corner-right-over.gif); width:4px; height:15px; float:left; }
Background: I have a little video playing app with a UI inspired by the

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.