[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Localization : How to process XML data file?

Posted on 2014-11-05
4
Medium Priority
?
181 Views
Last Modified: 2014-11-14
Based on the article ASP Internationalization, I have created a separate resource file for each locale. I can process all the views and built in code. But how should I process data specified in XML file?

The @Resources.Home doesn't work
<?xml version="1.0" encoding="utf-8" ?>
<items>
  <item Text="@Resources.Home" NavigateUrl="~/Home">
    <item Text="@Resources.Dashboard" NavigateUrl="~/Routing/Dashboard"/>
  </item>

</items>

Open in new window

0
Comment
Question by:ran_deep
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40425042
What is that XML file for?
0
 
LVL 2

Accepted Solution

by:
ran_deep earned 0 total points
ID: 40426506
Its actually binding to my menu control.
I came out with a solution to have a xml file for each locale. And then bind the path with a locale helper class.

        public static string GetPath()
        {
            var culture = Thread.CurrentThread.CurrentUICulture;
            string letters = culture.TwoLetterISOLanguageName;
            if (String.IsNullOrWhiteSpace(letters))
                return String.Empty;
            return HttpContext.Current.Server.MapPath(String.Format("~/App_Data/TopMenu.{0}.xml", letters));

        }

Open in new window


E.g. TopMenu.en.xml, TopMenu.es.xml

.BindToXML(CultureHelper.GetPath(), "/items/*").GetHtml()
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40426617
Since you can't use @Resource, you would need to find a code solution.  One possible solution would be to use a marker that you can replace with text.

The problem is determining the better approach to replace the resource name with the value (i.e. @Resources.Home with the value from the selected resource file).
0
 
LVL 2

Author Closing Comment

by:ran_deep
ID: 40442246
This is my final answer
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question