.NET Internationalization: The Developer's Guide to Building Global Windows and Web Applications

Category: Operating Systems
Author: Guy Smith-Ferrier
4.5
All Stack Overflow 8
This Month Stack Overflow 4

Comments

by anonymous   2019-07-21

Personally, I'd probably leave the EmployeeStatus codes in the DB and move all localization logic into the client. If this is a web app (ASP.NET or ASP.NET MVC) then you'd use the the EmployeeStatus code as a key into a resource file, and then use UICulture="Auto" and Culture="Auto" to tell ASP.NET to pick up the right resources based upon the "Accept-Language" HTTP Header.

You'd provide default (culture insensitive) resources embedded in your app, and allow satalite assemblies to override the defaults where they needed.

The problem, for me, with adding localization into the DB is that you firstly end up with much more complicated queries, you have to keep pumping the locale into each of these queries, and you can't cache the outputs of the queries so widely. Secondly, you have a mixure of tables that hold entities and tables that hold localization. Finally, a DBA is required to do the localization.

Ideally you want someone who understands how to translate text to do the localization, and for them to use some tool that they're comfortable with. There are plenty of .resx tools out there, and apps that allow language experts to "do their thing".

If you're stuck with DB tables for localization because "that's how it is" then perhaps you should query the lookups seperately to the real data, and join the two at the UI. This would at least give you an "upgrade path" to .RESX in the future.

You should check out Guy Smith-Ferrier's book on i18n if you're interested in this area:

http://www.amazon.co.uk/NET-Internationalization-Developers-Guide-Building/dp/0321341384/ref=sr_1_1?ie=UTF8&s=books&qid=1239106912&sr=8-1

by Gishu   2019-07-21

All your queries shall be answered in the book below. The initial chapters explain all the main concepts and terminology and fancy abbreviations like i18n. Didn't get time to read it till the end.. but good till the point I read. Recommended if you are serious about doing it the right way and have the time :)

http://www.amazon.com/NET-Internationalization-Developers-Applications-Development/dp/0321341384 Image

by anonymous   2019-07-21

In your views, do you have a page directive? If so, do you have UICulture="Auto" and Culture="Auto"?

For example...

<%@ Page Language="C#" Inherits="..." 
    culture="auto" uiculture="auto" %>

This will ensure that the Accept-Language header, passed by the browser in the request, gets used to set the Thread cultures. It's the UICulture that influences which resource file to pick.

For more on ASP.NET i18n this book is very good...

http://www.amazon.co.uk/NET-Internationalization-Developers-Guide-Building/dp/0321341384/ref=sr_1_1?ie=UTF8&s=books&qid=1241010151&sr=8-1

It doesn't cover MVC, but covers ASP.NET and, as such, many things continue to be relevant.

by Andrew   2019-07-21

I can thoroughly recommend reading .Net Internationalization by Guy Smith-Ferrier.

It covers the application globalisation, internationalisation and localisation options in detail (with pros and cons and excellent examples), and also topics I hadn't considered such as localising the deployment (i.e. ClickOnce and Setup Projects)

The version of the book I have is aimed at VS2005 / .Net2.0, and includes considerations for ASP.Net although it is primarily focussed on Windows Forms applications

alt text

by Chris Doggett   2017-08-20

Check out the Localization/Internationalization samples here:

http://msdn.microsoft.com/en-us/goglobal/bb688096.aspx

I've also heard good things about this book.

by anonymous   2017-08-20

Use Resource files.

Guy Smith-Ferrier is the best resource on this subject.

How To Achieve World (Ready) Domination In ASP.NET MVC 4

So you’ve written your ASP.NET MVC application and you want it to work in another language ? Then this session is for you. World-Readiness is all of the work that a developer needs to do to globalize an application and make it localizable (i.e. capable of being localized). In this session we will cover localizing HTML and HTML Helpers, localizing and globalizing Data Annotations, localizing and globalizing JavaScript and localizing URLs. No previous experience of ASP.NET localization is required.

Slides and Source

Maybe read a book: .NET Internationalization: The Developer's Guide to Building Global Windows and Web Applications