Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Satellite assemblies and Globalization

1 view
Skip to first unread message

K. Sriram Srivatsan

unread,
Dec 8, 2002, 10:00:37 AM12/8/02
to
Hi

I apologise for this long posting in advance but I have some critical
questions on Localization.

The Literature on Globalization (I've read a lot of them on MSDN and the
like) says for a globally "aware" application, one needs the following
things.

1. The Main assembly EXE file contains an embedded resource which is the
language neutral resource file and fallback resource
2. The directories such as "de", "ja" for each language that the
application supports.

Now, with this in mind I have a couple of questions and would greatly
appreciate it if someone could answer them.

Q1) Do I need to have a unique folder for the LCID specific resource.

For example

* MainApp Folder with the embedded resource
* zh (Chinese) folder
- zh-HK folder with the satellite dll for this Chinese Hong Kong
- zh-TW folder with the satellite dll for this Chinese Taiwanese

Q2) If I support, just one LCID .. as in the above example, zh-TW, will it
do to have the folder structure and hierarchy as given above?

Q3) In my application, there is a possibility of plugging different views
and as such, everything gets generated at runtime right from the toolbars to
the views which are UserControls late bounded to the form at runtime and
loaded and displayed on the screen.

In such a scenario., my reasoning was to have a wrapper that aggregates the
Resource Manager object. This wrapper gets created by the base application
object and has methods such as LoadString, LoadIcon, LoadPicture taking an
enum value which matches to the ids in the resource file as argument.

Now, if the wrapper gets created by the main object and set to the
UserControl where this UserControl makes calls to the wrapper to load images
etc., IF the resource doesnt exist, will the fallback culture resource get
loaded? The reason why I do this is my requirement is to enable language
support changes even when the application is running.

I hope Im clear with my questions. Someone please do reply as I am in a fix
as to what I should be doing.

In anticipation..
S


Tom

unread,
Dec 8, 2002, 2:21:34 PM12/8/02
to
> 1. The Main assembly EXE file contains an embedded resource which is the
> language neutral resource file and fallback resource

Correct. The main assembly will need to contain every satellite assembly
that you support.

> 2. The directories such as "de", "ja" for each language that the
> application supports.

Correct. VS.NET, if you're using it, will automatically generate these
directories for you.

> Q1) Do I need to have a unique folder for the LCID specific resource.
>
> For example
>
> * MainApp Folder with the embedded resource
> * zh (Chinese) folder
> - zh-HK folder with the satellite dll for this Chinese Hong Kong
> - zh-TW folder with the satellite dll for this Chinese Taiwanese

Yes, you do. VS.NET will generate this.

> Q2) If I support, just one LCID .. as in the above example, zh-TW, will it
> do to have the folder structure and hierarchy as given above?

Yes, unless zh-TW is your "fallback" resource. String-resources will look
like:

myStrings.resx // default
myStrings.zh-TW.resx // Taiwan

> Q3) In my application, there is a possibility of plugging different views
> and as such, everything gets generated at runtime right from the toolbars
to
> the views which are UserControls late bounded to the form at runtime and
> loaded and displayed on the screen.
>
> In such a scenario., my reasoning was to have a wrapper that aggregates
the
> Resource Manager object. This wrapper gets created by the base
application
> object and has methods such as LoadString, LoadIcon, LoadPicture taking an
> enum value which matches to the ids in the resource file as argument.
>
> Now, if the wrapper gets created by the main object and set to the
> UserControl where this UserControl makes calls to the wrapper to load
images
> etc., IF the resource doesnt exist, will the fallback culture resource get
> loaded? The reason why I do this is my requirement is to enable language
> support changes even when the application is running.

Yes, the fallback culture will be used if the resource-SET does not exist.
This means that if you're running the Taiwanese culture and there's not a
resource-file for it, the fallback will be used (myStrings.resx). However,
if the resource does not exist in the given set (myStrings.zh-TW.resx),
you'll need to treat it as an error and handle gracefully.

> I hope Im clear with my questions. Someone please do reply as I am in a
fix
> as to what I should be doing.

Keep in mind that if you compile an application and the generated
resource-files are NOT in the main assembly. You'll need to copy them there
or it will not work. I.e. if you have a a structure like:

PROJECT_A
myStrings.resx
myStrings.zh-TW.resx

MAIN_ASSEMBLY
References
PROJECT_A

Localization will not work until you copy the generated satellite assemblies
in the catalog zh-TW from PROJECT_A/bin/debug to MAIN_ASSEMBLY/bin/debug.
This is a confusing issue for many. It was decided to work this way due to
performance reasons.

Sriram Srivatsan

unread,
Dec 11, 2002, 3:42:08 AM12/11/02
to
Thanks Tom. I will check this out and get back if I encounter any issues on
the same Im sure :)


"Tom" <som...@nobody.com> wrote in message
news:OFNAF8unCHA.2428@TK2MSFTNGP09...

0 new messages