I was recently asked to provide the ability to store multiple language shape text and page names in Visio 2010. An interesting request that has inspired me create a useful add-in for Visio 2010 (Multi-Language Text for Visio coming soon), and prompted me to investigate language support in Visio 2010. I have written Visio add-ins that have needed to work in several different language editions of Visio before, and have been aware of the special considerations in creating ShapeSheet formulae, but this is more about supporting different languages in the same edition of Visio … and I was surprised how good this feature is!
Firstly, each Visio application is installed as a particular language. You can find yours by typing the following in the VBA Immediate Window:
My copy returns 1033, whic is English (United States), see http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx for Locale IDs Assigned by Microsoft. My edition of Visio is downloaded from MSDN, so it may not be typical of the version sold publicly in the UK.
Secondly, each Visio document stores its language ID, which you can find by looking at the DocLangID cell in the Document Properties section of the DocumentSheet or by typing the following in the VBA Immediate Window:
My copy of Visio returns 1033 for documents created using the US Units templates, or 2057, which is English (United Kingdom), for documents created from the Metric templates. See http://msdn.microsoft.com/en-us/library/ff767057.aspx for information about DocLangID.
You can also view or edit the language of the document from the Advanced Properties drop-down button on the File \ Info backstage view.
You can then select the language on the Properties dialog.
Thirdly, each shape in a Visio document stores its own language in the LangID cell of the Miscellaneous section of the ShapeSheet, or this can be discovered by selecting a shape, the typing the following in the VBA Immediate Window:
There is also a LangID cell in the Shape Data and Character sections of a ShapeSheet, and in the Annotation section of the PageSheet.
In my version of Visio, all of the shapes have the LangID of 1033, regardless of whether they are from the Metric or US Units stencils, and the Shape Data rows on these shapes have a LangID of 1033. However, inserting a new Shape Data row creates a LangID of 1033 on the US Units document, but 2057 on the Metric units document. I would suggest that this is inconsistent behavior, and if Microsoft are doing their localisation of templates and stencils correctly, then the shapes and Shape Data rows should have the same LangID as the template and stencil.
I note that the LangID of the Characters section is the same as the template, as it should be.
So, what of this LangID code? Well, their are 115 different LCIDs listed for Visio, so I assumed that these would be a subset of the 238 listed on the Microsoft Locale Ids document mentioned earlier, and that these would be available in the System.Globalization namespace as a CultureInfo object. However, I was wrong!
This table lists the language code supported by Visio, but not supported (yet) by the .Net Framework System.Globalization… so, beware, if you speak Latin!