A
Alain Dekker
We've got a project that must support about 20 different languages. We're
doing this:
* Have a big Excel spreadsheet with all resource names, then columns for all
languages
* When one or more strings are updated, we run a VBA script which chugs
through the data and produces a "uif_strings.NN.resx" file (where NN is, for
example, "es" for Spanish); the VBA script handles correct XML formatting of
the strings (and works well)
* Each of these "uif_strings.NN.resx" files are added to the project as an
"Embedded Resource"
* At compilation, each resource compiles into a DLL in a sub-path such as
"es", filename PROJECT.resource.dll
Now I think I know what happens at runtime:
* When you load a string, you specify the current culture, say "es"
* .NET finds the resource DLL in the EXE-PATH\es folder, loads that DLL,
extracts the string and returns it
All good so far.
Due to an unforseen situation, the details of which are not relevant to the
question, I'd like to do something along these lines:
* Still have my "uif_strings.NN.resx" resource files added as an "Embedded
Resource"
* Instead of compiling to EXE-PATH\es\ChemLibrary.resource.dll, compile to
EXE-PATH\lang\Spanish.resource.dll
* At runtime, to obey .NET resource DLL paths, have a single folder called
"es"
* At runtime, if user selects "Spanish", then delete the
es\ChemLibrary.resource.dll file; copy the lang\Spanish.resource.dll into
es\ChemLibrary.resource.dll
* Continue as normal
* If user now selects "German", this time copy lang\German.resource.dll
Is this possible?
Alternatively, at runtime, instead of loading the resource in the official
..NET way from es\ChemLibrary.resource.dll, load the resource from
lang\Spanish.resource.dll. In this case, I'd need some way to compile the
resources into a custom path.
Is this possible?
Thanks,
Alain
doing this:
* Have a big Excel spreadsheet with all resource names, then columns for all
languages
* When one or more strings are updated, we run a VBA script which chugs
through the data and produces a "uif_strings.NN.resx" file (where NN is, for
example, "es" for Spanish); the VBA script handles correct XML formatting of
the strings (and works well)
* Each of these "uif_strings.NN.resx" files are added to the project as an
"Embedded Resource"
* At compilation, each resource compiles into a DLL in a sub-path such as
"es", filename PROJECT.resource.dll
Now I think I know what happens at runtime:
* When you load a string, you specify the current culture, say "es"
* .NET finds the resource DLL in the EXE-PATH\es folder, loads that DLL,
extracts the string and returns it
All good so far.
Due to an unforseen situation, the details of which are not relevant to the
question, I'd like to do something along these lines:
* Still have my "uif_strings.NN.resx" resource files added as an "Embedded
Resource"
* Instead of compiling to EXE-PATH\es\ChemLibrary.resource.dll, compile to
EXE-PATH\lang\Spanish.resource.dll
* At runtime, to obey .NET resource DLL paths, have a single folder called
"es"
* At runtime, if user selects "Spanish", then delete the
es\ChemLibrary.resource.dll file; copy the lang\Spanish.resource.dll into
es\ChemLibrary.resource.dll
* Continue as normal
* If user now selects "German", this time copy lang\German.resource.dll
Is this possible?
Alternatively, at runtime, instead of loading the resource in the official
..NET way from es\ChemLibrary.resource.dll, load the resource from
lang\Spanish.resource.dll. In this case, I'd need some way to compile the
resources into a custom path.
Is this possible?
Thanks,
Alain