3

I'm not a programmer, but I have a little company website that I developed with MS Visual Web Developer 2010 Express (not Visual Studio), so I'm not completely inept. I want to add French and Spanish languages to my website. So some websites have, for instance, ?lang=fr after the URL or something similar.

Because I'm not a professional hard-core programmer, I need programs with a user-friendly GUI. Unlike Visual Studio, Visual Web Developer 2010 doesn't have friendly options for adding languages, or easy-to-comprehend tutorials on the web.

So I was thinking about just having the regular pages in my website as my English pages. Then, I can make /FR/ and /ES/ directories, and just copy all the aspx and aspx.vb pages to their respective directories and translate them. Then I would give the end-user a choice on the homepage to click "French" or "Espanol". So an end-user who clicks French would be directed to domain/FR/default.aspx.

Is this thinking wrong? Is there a simpler, easier way to accomplish 3 languages? Is there a more PROFESSIONAL way that looks more professional that I might understand?

I can install JQuery plugins. Anyone who can help me achieve this is a Godsend! Thank you for your time in reading this, and I sincerely appreciate any and all guidance you can offer!

Jason Weber

Jason Weber
  • 5,653
  • 6
  • 40
  • 73
  • Certainly, there is better, standard option. That is all strings should be externalized to resources and culture and uiculture attributes of your pages should be set to "auto". The problem is, I have no idea if this Visual Web Developer will let you do that. Probably not. – Paweł Dyda Jan 15 '12 at 09:10
  • On the other hand, take a look at [Globalize](https://github.com/jquery/globalize). It contains *localize* feature, which was not designed for translating the whole UI but for your choice of tools it might be the only reasonable idea... – Paweł Dyda Jan 15 '12 at 09:15
  • Hey Pawel, thanks for your responses! I'm guessing that Visual Web Developer is more of a remedial tool for programmers. I'm trying to learn more, though, so I appreciate you taking the time. I'm checking into Jquery (now javascript) Globalize -- it's intricate, but very detailed, with several dialects for each language. Thank you for turning me on to this. Appreciate the help! – Jason Weber Jan 15 '12 at 23:00
  • FYI, Pawel, I did download Visual Studio 2010 and I'm an official VS addict now. I used a combination of implicit and explicit localization to localize my website in 6 different languages -- and I'm getting fast! It's all set to "auto", which is great, but I want the client to be able to choose their own language manually right on my website, like, say, click a flag and have the entire website be in that language. Visual Web Developer is too rudimentary, though, so I appreciate the comment! – Jason Weber Jan 23 '12 at 07:59
  • You're asking the Wrong guy ;) I mean, I won't give you the solution (although I know one), since what you are up to is common anti-pattern (I repeat that like a mantra). Setting Culture and UICulture to "auto" is the right thing to do. It will use User's preferred language (from web browser). Only 5% of users (due to usability research) would change that and about 100% of this 5% knows how to modify browser's settings. Therefore it even does not make sense to implement language switching anti-pattern for (almost) nobody will use it. – Paweł Dyda Jan 23 '12 at 20:00
  • Yep -- and I finally found some things to help me, and Nuux really guided me through the entire process -- I have things set to auto, but I also have the flags on the master homepage if they'd like to manually set their own language -- and they can take it from there, as it lasts the entire session. But thank you again for your help in getting things started! It all worked out great! – Jason Weber Jan 23 '12 at 21:10

1 Answers1

2

This thinking is not wrong, but it does have a downside: every change you make to your pages you will have to repeat for all copies (e.g. changing the layout, fixing a bug or adding an image).

What most ASP.NET developers generally prefer to do, is to keep one set of pages, put all content that can be translated into so-called resource files and then let the server select the language content based on the user's choice.

This step-by-step tutorial on MSDN will help you to get your site localized in different languages using Visual Web Developer:

Walkthrough: Using Resources for Localization with ASP.NET

In this tutorial, the browser indicates the user's preferred language. So it doesn't use a separate menu to select the language. I suggest you first get familiar with ASP.NET resources and implicit localization, as this will introduce a lot of new concepts.

If you have localized your site this way, you can always switch to explicit localization, while still using the resources you have created by following the tutorial above.

Michiel van Oosterhout
  • 22,839
  • 15
  • 90
  • 132
  • Thank you very much for your time, Michiel. Appreciated! I read the article. I'm thinking about buying Visual Studio now, as it seems like a more thorough development tool than Visual Web Developer. The "Generate Local Resource" option is the key, which only Visual Studio has. This creates the App_LocalResources folder, and then you're on the right track and your resource files are added automatically. Just a quick question, Michiel. An end-user has his browser's settings to German. But maybe he wants to see MY website in English. Will your solution give him this option to switch? – Jason Weber Jan 15 '12 at 23:04
  • No, but that is a common requirement and I think you will be able to find many code examples (based on cookies, sessions or URLs with URL rewriting) or get some code to get you started here on Stack Overflow. – Michiel van Oosterhout Jan 15 '12 at 23:37
  • I'm downloading the Visual Studio 2010 Professional trial right now! I have the tutorial you linked me to, and once it's downloaded, I'll follow that tutorial. I'm looking forward to this. Thanks again, Michiel! – Jason Weber Jan 16 '12 at 01:28
  • Created my first aspx.resx page! After I downloaded Visual Studio, I chose the "web development" feature upon install, since I don't do anything else. I can see why VWD Express is remedial compared to Studio. It's going smoothly with the help of the tutorial! – Jason Weber Jan 16 '12 at 07:10
  • And now I have flags up so the client can choose their own language if their browsers aren't set up to do so, or if they just want to use another language. And I learned it all from you guys on this forum -- I have no books or anything. So everything is great, and I once again, appreciate your help, Michiel. – Jason Weber Jan 23 '12 at 21:12
  • It's how a lot us learned (and still learn). I'm happy to hear you made progress! – Michiel van Oosterhout Jan 23 '12 at 21:25