|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Language detectionHi there. I need to detect what languages are supported by an application
using the VS automation IDE (for a VS add-in). Unfortunately, I can't seem to find any clean way of doing this other than searching for all (embedded) resource files and checking for the appropriate language extension (e.g., "MyResource.[<LanguageExtension>].resx"). Does anyone know if there's a cleaner way of doing this (none that I can find in the automation API so far) and more importantly, how do you determine what the default language is (since no language extension is present for default language resource files). Thanks in advance. Hi Michael,
I think that there is nothing in the extensibility model for the IDE, since that info belongs to the app, not to the IDE, but some pointers: - The System.Resource namespace has classes and attributes related to this stuff, such as the ResourceManager, the NeutralResourcesLanguageAtributte, etc. For example, given a compiled assembly, you can get its NeutralResourcesLanguage atributte through reflection. - The localization for forms (Localizable and Language properties) is done through and extender provider: System.ComponentModel.Design.LocalizationExtenderProvider. - The default language can be retrieved through the NeutralResourcesLanguageAtributte and if none exists, then CultureInfo.InvariantCulture(). -- Show quoteBest regards, Carlos J. Quintero MZ-Tools: Productivity add-ins for Visual Studio You can code, design and document much faster: http://www.mztools.com "Michael Brown" <no_spam@_nospam.com> escribió en el mensaje news:eUyolMAjGHA.3572@TK2MSFTNGP04.phx.gbl... > Hi there. I need to detect what languages are supported by an application > using the VS automation IDE (for a VS add-in). Unfortunately, I can't seem > to find any clean way of doing this other than searching for all > (embedded) resource files and checking for the appropriate language > extension (e.g., "MyResource.[<LanguageExtension>].resx"). Does anyone > know if there's a cleaner way of doing this (none that I can find in the > automation API so far) and more importantly, how do you determine what the > default language is (since no language extension is present for default > language resource files). Thanks in advance. >
Show quote
"Carlos J. Quintero [VB MVP]" <carlosq@NOSPAMsogecable.com> wrote in message Thanks for the feedback (appreciated). I'll look into these classes but can news:%237l6usfjGHA.1552@TK2MSFTNGP03.phx.gbl... > Hi Michael, > > I think that there is nothing in the extensibility model for the IDE, > since that info belongs to the app, not to the IDE, but some pointers: > > - The System.Resource namespace has classes and attributes related to this > stuff, such as the ResourceManager, the NeutralResourcesLanguageAtributte, > etc. For example, given a compiled assembly, you can get its > NeutralResourcesLanguage atributte through reflection. > > - The localization for forms (Localizable and Language properties) is done > through and extender provider: > System.ComponentModel.Design.LocalizationExtenderProvider. > > - The default language can be retrieved through the > NeutralResourcesLanguageAtributte and if none exists, then > CultureInfo.InvariantCulture(). you confirm that inspecting the resource file names is the correct (only) way to detect which languages are supported (at build time anyway). Thanks. Hi,
> can you confirm that inspecting the resource file names is the correct I don´t know if it is the correct or only way, but it is a valid one. I > (only) way to detect which languages are supported (at build time anyway). > Thanks. would use it. -- Best regards, Carlos J. Quintero MZ-Tools: Productivity add-ins for Visual Studio You can code, design and document much faster: http://www.mztools.com |
|||||||||||||||||||||||