Programmatic way to get all the available languages (in satellite assemblies)

前端 未结 7 520
青春惊慌失措
青春惊慌失措 2020-11-28 08:11

I\'m designing a multilingual application using .resx files.

I have a few files like GlobalStrings.resx, GlobalStrings.es.resx, GlobalStrings.en.resx, etc. When I wa

7条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 08:42

    I'm not sure about getting the languages, maybe you can scan your installation folder for dll-files, but setting your language to an unsupported language should not be a problem.

    .NET will fallback to the culture neutral resources if no culture specific files can be found so you can safely select unsupported languages.

    As long as you control the application yourself you could just store the available languages in a application setting somewhere. Just a comma-separated string with the culture names should suffice: "en, es"

提交回复
热议问题