Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Language detection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael Brown - 09 Jun 2006 21:27 GMT
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.
Carlos J. Quintero [VB MVP] - 12 Jun 2006 09:35 GMT
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().

Signature

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

> 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
[quoted text clipped - 5 lines]
> default language is (since no language extension is present for default
> language resource files). Thanks in advance.
Michael Brown - 12 Jun 2006 14:48 GMT
> Hi Michael,
>
[quoted text clipped - 13 lines]
> NeutralResourcesLanguageAtributte and if none exists, then
> CultureInfo.InvariantCulture().

Thanks for the feedback (appreciated). I'll look into these classes but can
you confirm that inspecting the resource file names is the correct (only)
way to detect which languages are supported (at build time anyway). Thanks.
Carlos J. Quintero [VB MVP] - 13 Jun 2006 11:33 GMT
Hi,

> can  you confirm that inspecting the resource file names is the correct
> (only) way to detect which languages are supported (at build time anyway).
> Thanks.

I don´t know if it is the correct or only way, but it is a valid one. I
would use it.

Signature

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.