How to localize your Office COM add-in
Let’s be honest, the present day market place is an international one. It is no longer good enough to only have your application and/or add-in support just in one language. If you’re planning on taking over the world you need to start thinking “localization”.
The top three most popular languages spoken worldwide today is:
- Mandarin – 882 million
- Spanish – 325 million
- English – 312 to 380 million
In today’s post I’ll show you how to enable your ADX add-in to support localization. We’ll tap into the English and Spanish markets with our sample add-in. Apologies in advance for our Spanish readers if I made a few grammatical errors. :)
Start by creating a new ADX COM Add-in project in Visual Studio.
Finish the wizard by selecting Visual C# as the programming language, Microsoft Office 2007 as the minimum supported Office version and Microsoft Outlook as the supported application.
Open the AddinModule designer and set its Localizable property to True and make sure the Language property is set to Default. This is needed if your add-in is installed on a pc where the supported languages are not installed. Your add-in will then use the default language.
Add a Ribbon Tab control to the designer and change its design to resemble the screenshot below.
Next, change the AddinModule’s Language property to Spanish. Change the components’ Caption properties to Spanish.
You’ll notice as you change the Language property of the AddinModule, new .resx files are added below the AddinModule.cs file in the Solution Explorer. Each of these files contains string values for the specific language.
Build, register and run your project. You should see the Archive ribbon tab in Outlook. To test the Spanish localization in Windows 7, go to Control Panel > Change display language and select espanol in the language dropdown list.
You’ll need to log off in order for the new display language to be used, when you open Outlook again, you’ll notice that your add-in is now in Spanish.
Thank you for reading. Until next time, keep coding!