Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localized resx files as sub items in solution explorer

We have a large number of C# projects in a visual studio solution. For a lot of these we have a resource file called 'TextResources.resx'. These have been translated in the past creating several related resx files for example 'TextResources.fr.resx'. For these older projects these translated resx files are showing as sub items of the default english TextResources.resx however for several new projects the translated items are appearing as separate (same tree level) items.

Hopefully this diagram will explain:

Old Projects:

- TextResources.resx
     - TextResources.fr.resx 
     - TextResources.de.resx

New Projects:

- TextResources.fr.resx 
- TextResources.de.resx 
- TextResources.resx 

This not only looks odd but is a little confusing with so many projects. Anyone know why its grouping some translated resx files but not others?

like image 692
cheesemp Avatar asked Jul 15 '11 16:07

cheesemp


People also ask

What are RESX files?

resx file contains a standard set of header information that describes the format of the resource entries, and specifies the versioning information for the XML code that parses the data. These files contain all the strings, labels, captions, and titles for all text in the three IBM Cognos Office components.

Do RESX files need to be deployed?

You do not need to deploy . resx file with your application.


1 Answers

I had the same problem and found no answer either.

I ended up editing the project (.csproj) file by hand.

<EmbeddedResource Include="Folder\TextResources.de.resx">
  <DependentUpon>TextResources.resx</DependentUpon>
  <SubType>Designer</SubType>
</EmbeddedResource>

Add the

<DependentUpon></DependentUpon> 

tag and type out the name of the "parent" resource file without leading folders.

like image 67
cun83 Avatar answered Sep 25 '22 09:09

cun83