Ebeworld’s Weblog

Trying to create

Localization

One of the nice way to localize a web page is

  protected override void InitializeCulture()

    {

        CultureInfo ci = new CultureInfo(“es-mx”, false);

        Thread.CurrentThread.CurrentUICulture = ci;

        Thread.CurrentThread.CurrentCulture = ci;

    }

 

but it goes out of hand very quickly, unless we do it in master page, or HttpModule’s PreRequest

HandlerExecute event or an application’s global.asax Application_BeginRequest method. Also one nasty thing about it is, the method is called even before all the controls initialized,therefore all control values are unavailable. Using parameter info, such as Request.Form["CultureSelectorDropDown"] can be a solution.

Programitically,   this.lblGreeting.Text = GetLocalResourceObject(“greeting”).ToString(); would work. or putting meta:resourcekey in aspx.

March 2, 2009 - Posted by ebeworld | Uncategorized | | No Comments Yet

No comments yet.

Leave a comment