views:

21

answers:

1

Hi there, I'm working on an ASP.NET app

I have a couple of resource files with the different languages I can support example: Language.en.resx Language.pt.resx

is there any way to get, for example, a list with all the different languages dinamically?

tks

+2  A: 

If you are looking for a way which determine how many ( and what ) languages you localize for your application. There is no solution. You have to write a parser which look in a series of sub directories in your application ( or given ) path. the read and store the name of Resx files into a list.

Finally you have to split the name of Resx file with Dot (split('.')) and seperate the language part of the Resx files like

  string[] myString = new string[MyResxList.lenght];
  for (int i=0; i<=MyResxList.lenght;i++)
     myString[i] = MyResxList[i].toString().split('.')[3];

note that above code is a snippet and I wrote it here so you have to debugit if it's necessary

then you should remove the duplicates and return the List

Nasser Hadjloo