Solved

Issues with culture in .Net 2.0

Posted on 2006-06-19
3
414 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
[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
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

737 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