We want to deliver a language independend CUIX-File and translate the UI at runtime after loading the CUIX like this:
foreach (RibbonTab tab in ComponentManager.Ribbon.Tabs)
foreach (RibbonPanel panel in tab.Panels)
foreach (RibbonItem item in panel.Source.Items)
TransRibbonItem(item)should translate the Item text displayed in the UI as well as the tooltip text.
This solution has some drawbacks:
Solved! Go to Solution.
Users aren't switching languages frequently, if ever past the installation. That makes real-time translation each time, every time unnecessary. You might want to consider something that makes the translation *once*, then does something like re-points/re-loads the CUIx with a translated copy, if not using it as an internal development tool to quickly generate language specific CUIx files for distribution.
*facepalm* Good luck.
(In the meantime this has been escalated to DevSup. But the link to DevSup doesn't work and I can't find it in my "Cases". So I add here...)
I have an additional question:
As for ribbonitems and tooltips I need to translate toolbars. Toolbars have names that are displayed as tooltip if you hover the mousepointer over the toolbar. See attached screenshot. The names are also visible in the list of available toolbars that pops up when you click on the “AcToolbarsCheckList” ribbon-button.
How can I translate these toolbar names at runtime?
Note: This screenshot was taken after a test-version of my translation function was run. It replaces each item's UI-text with the item's ID.
Sorry, there is no inbuilt mechanism in the API to do such runtime translation.
As you may be aware, AutoCAD also does not permit switching languages at runtime.
> Sorry, there is no inbuilt mechanism in the API to do such runtime translation.
Your statement is very general. Do you mean that there is
I have attached a test project. If you want to try it:
Build the project, netload the RibbonTranslate.dll in AutoCAD.
Enter command “TRANSRIB”
Press RETURN at the „Messagefile:“ prompt.
Enter “ID” at the “Language:” prompt.
The function will translate the ribbon menu items and tooltips with the approach pointed out in my first posting.
There may be workarounds to do this but I am not aware of it.
What I meant in my previous reply was that there is no direct way designed right into the API to do such translation.
What you are using is a workaround and can stop working / behave differently in any of the AutoCAD releases as that event handler was not specifically meant for such runtime translation.