Solved

Issues with culture in .Net 2.0

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 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