I spent a great deal of time learning about satellite assemblies the past few days. While I found this forum very helpful, I still couldn't find what I was looking for. I had a lot of problems figuring out how to reference Resources from satellite assemblies
from an ASP.NET 2.0 application.
So after I figured it out, I wrote up a quick HOW-TO on what I think is the good way to overcome several of the problems I came across, such as what Assembly to pass to the ResourceManger, falling back to the the main assembly for neutral values, and Strongly-Typed
resources.
I am not able to get the specific language of my choice displayed, it'd always go to the default strings.resx file. I have the German .resx file, and a couple of other custom languages added to the sample Solutions.
In global.asax, I had specified
CreateSpecificCulture("de-DE"); as per your article but I am only getting the English rendered each time!!
The problem lies with the application not finding a resource file for your language, and it's reverting to English.
First, did you build the project yourself or did you start with my sample project? If you did it yourself, you might start with the sample to eliminate any configuration issues. Then once you get it working and understand, then build it from scratch
Second, in step 16, does your project structure look like the one in the screenshot? The directory structure has to look exactly like the one in the screenshot with:
\Bin
MyWebApp.dll <-Must be equal to each other
\de-DE
MyWebApp.resources.dll <-Must be equal to each other
Also, double check that Default.aspx (or whatever you web page is) doesn't have either
Culture="Auto"
UICulture="Auto"
attributes in <%@ Page%> . If these are present, they will override the Culture defined in the Global.asax for that page only.
Also check in the debugger what the culture is defined as in the code behind for your test page.
I started with your sample project. And I don't have any Culture or UICulture settings on my Default.aspx page.
I have the same exact structure as the one you have on step 16.
In addition to the \de-DE folder, I have added a \fr-FR folder, but when building the solution, only the \de-DE\MyWebApp.resources.dll is created under the \bin folder, along with the \Bin\MyWebApp.dll, why isn't the \fr-FR created along with the rest?
I have made sure I follow every step.
After I reviewed your solution that you sent me, you missed step 7, which is to add a reference to the Satellite Assembly in your Web App. After I did that, the Bin directory was correct with the fr-FR directory and resource files, and after I updated the Global.asax
to use fr-FR, the page came up with your French values.
None
0 Points
7 Posts
How to Localize ASP.NET 2.0 Web Apps with Resources and Satellite Assemblies
Jan 26, 2006 09:32 PM|TechnoAg|LINK
So after I figured it out, I wrote up a quick HOW-TO on what I think is the good way to overcome several of the problems I came across, such as what Assembly to pass to the ResourceManger, falling back to the the main assembly for neutral values, and Strongly-Typed resources.
I welcome any feedback or improvements.
Localizing ASP.NET 2.0 Web Apps with Resources and Satellite Assemblies
MCSD.NET
None
0 Points
2 Posts
Re: How to Localize ASP.NET 2.0 Web Apps with Resources and Satellite Assemblies
Jan 30, 2006 10:52 AM|loislee|LINK
hi,
I am not able to get the specific language of my choice displayed, it'd always go to the default strings.resx file. I have the German .resx file, and a couple of other custom languages added to the sample Solutions.
In global.asax, I had specified
CreateSpecificCulture("de-DE"); as per your article but I am only getting the English rendered each time!!
I am not sure what I did wrong, please help!
Le Rien
None
0 Points
7 Posts
Re: How to Localize ASP.NET 2.0 Web Apps with Resources and Satellite Assemblies
Jan 30, 2006 03:32 PM|TechnoAg|LINK
First, did you build the project yourself or did you start with my sample project? If you did it yourself, you might start with the sample to eliminate any configuration issues. Then once you get it working and understand, then build it from scratch
Second, in step 16, does your project structure look like the one in the screenshot? The directory structure has to look exactly like the one in the screenshot with:
\Bin
MyWebApp.dll <-Must be equal to each other
\de-DE
MyWebApp.resources.dll <-Must be equal to each other
Also, double check that Default.aspx (or whatever you web page is) doesn't have either
Also check in the debugger what the culture is defined as in the code behind for your test page.
MCSD.NET
None
0 Points
2 Posts
Re: How to Localize ASP.NET 2.0 Web Apps with Resources and Satellite Assemblies
Jan 31, 2006 09:47 AM|loislee|LINK
I started with your sample project. And I don't have any Culture or UICulture settings on my Default.aspx page.
I have the same exact structure as the one you have on step 16.
In addition to the \de-DE folder, I have added a \fr-FR folder, but when building the solution, only the \de-DE\MyWebApp.resources.dll is created under the \bin folder, along with the \Bin\MyWebApp.dll, why isn't the \fr-FR created along with the rest? I have made sure I follow every step.
None
0 Points
7 Posts
Re: How to Localize ASP.NET 2.0 Web Apps with Resources and Satellite Assemblies
Jan 31, 2006 01:54 PM|TechnoAg|LINK
After I reviewed your solution that you sent me, you missed step 7, which is to add a reference to the Satellite Assembly in your Web App. After I did that, the Bin directory was correct with the fr-FR directory and resource files, and after I updated the Global.asax to use fr-FR, the page came up with your French values.
MCSD.NET