browse by category or date

My brother’s blog is having a problem. At his main page, the sidebar is rendered below the Content.

Strangely, if you open one single post, the sidebar is rendered properly on the right side.

I’ve spent few hours playing with the template, doesn’t seem to solve it. Do you know what’s wrong with this template?

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

I have previously made a small pet project done in Ext.NET MVC that requires multi-language UI. So today I’ll share with you what i’ve done, hopefully it can be useful to those who need it. If you have a better idea, kindly let me know. So that I learn something too 😉

Taken from Cuckoo’s call

All Strings in Resource Files

In order to translation, you must have a number of resource files. Each for the language that you plan to support. After you added the resource files, you should have something similar to this:

Make sure that each resource file has the same number of records and records Name.

Using the resource file in the UI

Below is example of the usage of the resource file on the front-end


   
       
       
        
    

Selecting the Correct Language

Now that we have all the resource files that is needed, we need to tell ASP.NET rendering engine to pick-up the correct resource file. To do that, we need to switch the Culture before the Controllers is doing their job. For my case, I override Application_AuthenticateRequest method in Global.asax.cs to execute the following code:

HttpRequest Req = HttpContext.Current.Request;
if (Req.UserLanguages != null && Req.UserLanguages.Length>0)
{
	var Lang = Request.UserLanguages[0]; //Browser Locale Setting

	//My UI allows its users to change the language preference
	//and stored the selection in a Cookie
	if (Req.Cookies["cultureCode"] != null
		&& !String.IsNullOrEmpty(Req.Cookies["cultureCode"].Value))
		Lang = Req.Cookies["cultureCode"].Value;

	if (!String.IsNullOrEmpty(Lang))
	{
		System.Globalization.CultureInfo Culture = null;
		try
		{
			Culture = new System.Globalization.CultureInfo(Lang);
		}
		catch
		{
			//Lang is not a valid culture code (e.g. en-US, fr-CA)
			//Do something or Ignore
		}
		if (Culture != null) {
			System.Threading.Thread.CurrentThread.CurrentCulture = Culture;
			System.Threading.Thread.CurrentThread.CurrentUICulture = Culture;
		}
	}
}

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

Just because I seriously hate my PC, it doesn’t mean that you will hate it too. Buy my PC now!!! Buy it here!

It’s either this guy is a marketing genius, or he is just crazy. Another proof that there’s only a thin line between genius and crazy 🙂

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant: