Solved

Issues with culture in .Net 2.0

Posted on 2006-06-19
3
407 Views
Last Modified: 2008-01-09
Hi,
Could anyone provide any suggestions on how to implement localization features for a multilingual website. Before you jump the guns, let me define the site structure a little more. We have a global site and around 40 country sites. Each of these country sites have localised information both in the native language (fr,de,de-at,it,ar,ar-ae etc). Also, each of these local country sites would have an english counterpart (fr-en,de-en etc). Currently, we do not see how we could define the resource files for the english version of the regional country sites. The issue being that there are no 'cultures' defined as 'fr-en' or 'en-fr'. Is there any way we can map an existing resource file somewhere within the server and use it within my application without copying the files to my App_LocalResource folder?

Also, is there any way we can specify the culture to be used for a page from within a user control or vice-versa. The way we see it, you have have individual resource files for both the page and the user control (and no, using the App_GlobalResources folder is not an option at the moment)

Hope you get the idea. Any help would be greatly appreciated.

Regards,
Sajit
0
Comment
Question by:ap_sajith
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
SnowFlake earned 500 total points
ID: 16937785
I will have to read again more carefully at a more reasonable hour (its past midnight here)
but for the
>Also, is there any way we can specify the culture to be used for a page from within a user control or vice-versa.

the answer for the grneral case is AFAIK:
No, you can not.
this is because the CurrentUICulture can only be set by overriding the Page.InitializeCulture method. This means that when a change is required due to a user action it must be done by remembering the new required UICulture in some server side storage (profile or session) and redirecting back to the current page where you set up the
System.Threading.Thread.CurrentThread.CurrentUICulture based on the previously stored value.

something like:

    protected override void InitializeCulture() {
        base.InitializeCulture();
        if (Session.Contents["UICulture"] != null) {
            System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo((String)Session["UICulture"]);
        }

as for the rest of your Q,
for the
>The issue being that there are no 'cultures' defined as 'fr-en' or 'en-fr'.
maybe this:
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=a193b952-2e44-45ed-811d-c1fabf2f6e8a
can help

also maybe you will find this:
http://www.codeproject.com/useritems/ChangeUICulture.asp
to be helpful.

SnowFlake
0
 
LVL 21

Author Comment

by:ap_sajith
ID: 16978133
Thanks SnowFlake, we managed to use the 'Custom Culture' features as explained in the links provided by you.

Cheers!
0
 
LVL 15

Expert Comment

by:SnowFlake
ID: 16978436
your welcome.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now