Debugging JavaScript in Visual Studio.NET
Jan 04

To watch the full version in just one file, click here -> Localization-Globalization in ASP.NET

Hello everyone, this is my first video tutorial and if I do everything right I hope is not going to be the last, but for this I beg you that after watching this movie, please give me a feedback, you can write anything, that you didn’t like, it was terrible, or maybe that you liked, so before we can start, let me introduce myself, my name is Luciano Sampaio, I’m from Brazil, I’m the Lead Developer of Apollo Media and in charge now to bring not only to my co-workers, but also to you or anyone that is interest to, some video tutorials about the most common tasks you’ll probably find on your days job, I believe I’ll be making at least 3 of these tutorials every week.

Part 1

Part 2 

 

For the very first tutorial, I’ll talk about something very basic but that has a big importance for the company I work for, which is how can we make multilingual websites for our clients without the need to spend too much time, but always with high quality patterns on our minds, and now you can ask “why should I bother creating a website for more than one language”. Well first you have to think, who is your website’s target? Is it only your city? Your country? Or the whole world? Because like Canada which I assume everybody knows is an official Bi-lingual country, so people can either speak English or French. That’s why I decided to create this tutorial which is supposed to show you some of the options you might have to accomplish this task, but it does not mean is always the only or better way to do it. So like my friend Darius likes to say “Knowledge is power”, use it at your own risk.

Microsoft has created on the .NET Framework 2.0 two wonderful features, which are called “Localization” and “Globalization”; they exist on Web and Windows applications with the same concept with only a few differences related to the steps on how to add to your applications. This tutorial will only cover how to work with them on Web applications. We are not going to do anything fence, but if you just like me are a visual person, in other words, you rather see than read, I’m going to show you exactly what are the steps you have to do to make your website support more than one language.

To download the code, click here -> Localization-Globalization in ASP.NET

Author: Luciano Sampaio

8 Responses to “Localization and Globalization in ASP.NET”

  1. Darius Bashar Says:

    I did in fact state that “knowledge is power” But I would like to correct my statement Luciano.

    Knowledge is almost power…But before it transforms into power it needs to be applied!

    So the new statement is “knowledge when applied is POWER”

    By the way I thought you did a terrific job in your first video tutorial. People take it to granted just how difficult making a video tutorial can be.

    You my friend did a great job and I am very proud of you. :)

  2. radhika Says:

    Hi Luciano Sampaio,

    The video is useful to me,but i don’t know what “hello” is called in brazil then how to change the text .Can you tell me how to globaliz in different languages u don’t even know .Is that possible?

  3. Luciano Sampaio Says:

    Hi Radhika, thanks for you comment.
    Localize and globalize using .NET is REALLY easy, but unfortunately it does not automatically translate for you. You have to know the other language, there is no way the framework will know that “Hello” in English means “Olá” in Portuguese(Brazilian Language). I believe that if you’re are creating a website for users let’s say in CHINA, you probably know someone that speaks Chinese and who can help you translate your website. thanks again!

  4. Bruno Says:

    Muito legal, véio. vc tah foda tanto na linguagem quanto no inglês. mandando bem mesmo. só vi esse primeiro veio por enquanto, mas vou dar uma olhada nos outros, e nos q ainda estão por vir. Queria saber 2 coisas, primeiro, q programa vc tah usando pra fazer esses videos? e segundo, c comprou algum livro pra tirar a certificação .net ou arranjou na internet? to estudando pra tirar a certificação java e depois to querendo aproveitar e tirar a .net tb. abraço véio. continue nesse ritmo.

  5. Praneth Says:

    Hi! There, the video is great. I have some doubts to convert the languages. Let say if we are developing web site with multi-languages. The whole page has to correspond to the user prefer select language. It would be great if you can point out some hints to go about it. Do I have to store everything data in different languages in database? How about the global resource file? Do I have to create different page to store different language that it point to?

  6. Luciano Sampaio Says:

    Hello Praneth, Thanks for your comment. Well first let me answer your questions. 1 question: If you’re thinking to localize the whole website, I would suggest to store the Static texts in the localization or globalization files and the dynamic texts in a database, because you have to remember that the localization and globalization are just normal XML files, so you could have problems if your website gets a lot of traffic. 2 question: You don’t have to create different pages, you just need to create different localized files for the static texts and the Framework will bind them to each element for you. But for the dynamic texts you will have to write your own code. I hope I answered your questions, let me know if you need anything else! thanks!

  7. w11z Says:

    Thanks Luciano, It helped me a lot… I have 2 questions
    1- What if someone coming from Portugal (or any other Portugueese country) visited the site. Does the BR in pt-BR would come in conflict with the pt-Portugal?
    2- What about a second page… How doe ASP.NET knows which language to display… Can you show me? I have looked everywhere and can’t seem to find the solution. My project displays the right language on one page (if chosen in that particular page) but went clicking the submit button, The other page only displays the English version.

    Thanks and keep up the good work

  8. Luciano Sampaio Says:

    Hello again,
    1- Answer: The framework will always try to match the language of the user, if the website doesn’t support that language, it will try to match the closest one, so if the user is coming from Portugal and the only Portuguese language that your website supports is pt-BR so that will be the language displayed to the user.
    2-Answer: Unfortunately the framework by itself doesn’t know which language the user wants in all the pages, this is up to you, what you can do is if the user chooses a language, you can set a cookie or a session so on the other pages you will be able to know which language to show.
    Let me know if you need more help!!!

Leave a Reply