Help with Localization

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CGuy

    Help with Localization

    Hi,

    I'm trying to develop an ASPX page that supports multiple languages.
    Everything has gone well till now -

    1. Created a project in VS.NET 2003
    2. Added 2 resource files named Captions.resx and Captions.fr.res x for
    English and French cultures respectively
    3. Used the following code in the ASPX Code Behind file

    resourceManager = new ResourceManager ("MyProject.Cap tions",
    Assembly.GetExe cutingAssembly( ));
    this.Label.Text = resourceManager .GetString("LAB EL_CAPTION");

    4. Compiled the project in VS.NET 2003. The page loads fine with the
    label's caption set to English or French (depending on the Culture)

    Now the problem

    Since I plan to support more languages and there are going to be more
    resource files (per language, per category etc), I would like to organize
    them into several directories. So, I moved both my resource files into a
    "Resources" directory and recompiled the project - BOOM - get a runtime
    error saying:

    "Could not find any resources appropriate for the specified culture (or the
    neutral culture) in the given assembly. Make sure
    "MyProject.Capt ions.resources" was correctly embedded or linked into
    assembly "MyProject" . baseName: MyProject.Capti ons locationInfo: <null>
    resource file name: MyProject.Capti ons.resources assembly: MyProject,
    Version=1.0.136 1.33724, Culture=neutral , PublicKeyToken= null "

    I guess the problem is due to the fact that VS.NET is unable to locate the
    resx files during compilation. How do I fix this problem? Any help in this
    matter is greatly appreciated.

    CGuy


  • Grant Richins [MS]

    #2
    Re: Help with Localization

    Actually I believe the VS project system is including the directory name
    into the resource name. So I would change your code correspondingly :
    resourceManager = new
    ResourceManager ("MyProject.Res ources.Captions ",
    Assembly.GetExe cutingAssembly( ));


    --
    --Grant
    This posting is provided "AS IS" with no warranties, and confers no rights.


    Comment

    • Grant Richins [MS]

      #3
      Re: Help with Localization

      Actually I believe the VS project system is including the directory name
      into the resource name. So I would change your code correspondingly :
      resourceManager = new
      ResourceManager ("MyProject.Res ources.Captions ",
      Assembly.GetExe cutingAssembly( ));


      --
      --Grant
      This posting is provided "AS IS" with no warranties, and confers no rights.


      Comment

      Working...