?
Solved

Issues with culture in .Net 2.0

Posted on 2006-06-19
3
Medium Priority
?
418 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

850 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