Groups | Blog | Home
all groups > dotnet internationalization > april 2007 >

dotnet internationalization : Default language


Robert Scheer
4/19/2007 5:28:23 AM
Hi.

I am writing web and desktop applications that need
internationalization and all of these applications will have a default
language, say English. I know I have to create the different resources
for each language, but do I need to create one for the English
language too? Since it will be the default language, I am thinking of
write the text directly on my labels, menus etc. and just load the
resource files when a different language is really needed, thus
simplifying the design. Is it ok?

Thanks,
Robert Scheer
Hugh Robinson
4/19/2007 12:01:47 PM
I'm not an expert, but I'd say there are advantages to doing all languages
the same way, i.e. using resources for English.

1. If you're using .NET to code, then you get automatic failback to English
if you forget to provide a resource in some other language (which is better
than getting some empty string)
2. You avoid having to do one thing in your code for English and another for
non-English languages, which presumably would make your code simpler
3. If you use satellite assemblies, then you can change the text without
recompiling the whole app (may not be a huge advantage since you might need
to make your labels wider when you change the text).

I haven't used the built-in .NET approach for internationalizing forms, etc.
since I didn't want to create a separate copy of each form for each language
(which may even be my misunderstanding of the method). Instead I use the
widest size I need and use a .NET component on the form to get the text for
whatever language I need...



[quoted text, click to view]

Clive Dixon
4/20/2007 12:00:00 AM

[quoted text, click to view]

No, you don't need a separate resource for English. Use English as the
default in your forms and create separate satellite resources for the other
languages supported. The resource fallback mechanism will automatically
provide English if there is no satellite resource for the current language.
In your AssemblyInfo.cs you can also add the assembly level attribute (for
example)

[assembly: System.Resources.NeutralResourcesLanguage("en-GB")]
to indicate the default culture used in the assembly and optimise resource
loading when the current culture is the same as the default culture.

AddThis Social Bookmark Button