I am developing a VSTO add-on and want it to be localized according to the language version of the office product. Theoretically, how to do this:
int lcid = Application.LanguageSettings.get_LanguageID(Office.MsoAppLanguageID.msoLanguageIDUI); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lcid);
For this, I need the Application be initialized, of course. Therefore, the earliest moment I can execute this code is in the Startup event handler. At the moment, however, CreateRibbonExtensibilityObject() has already been called, so at least the title of my custom ribbon tab will display in Windows, which may be different. In the tape class, I have a handler for the IRibbonUI event, where I store an instance of IRibbonUI for later use. I could pass this instance to the addin class and let it call IRibbonUI.Invalidate() on it. But it seems a little strange - creating a tape to make it invalid after a couple of microseconds later. So I ask myself a question - and ask here if there is a more elegant way to localize the vsto add-on ribbon according to the language version of the office product.
(I saw this similar question , but the approach proposed there seems even worse for me.)
source share