Menus and Internationalization

A discussion about internationalization of custom menus Last Updated: 2006-10-09

=John Fazzie=

The Epic environment I am configuring is being deployed to eleven different countries with around five or so different languages. Part of the configuration is modifying the default menus that are displayed. Some sample code to do this...

menu_delete ".File.New"; menu_delete ".File.Open"; menu_delete ".File.Save_As"; menu_delete ".File.Page_Setup";
 * 1) Remove existing menus
 * 2) File

However, since Epic upon discovering a system has a locale other than ENU changes all of its menus, all of these commands break and do not work since they use English values.

One possible solution to getting around this problem would be to interrogate the system locale myself and write conditional logic to determine which menus I´m deleting... using translated values for each different locale.

However, as time is of the essence I was wondering if there is a cleaner or faster way of doing this such as index based menu deletion and insertion that I could just apply to all systems regardless of country.

Does anyone have any answers or suggestions for this problem?

=Frank Marent=

we've similar problems here. i'm withdrawing menus in the instance.acl the same way like you, but checking language variable before.

if ($ENV["LC_MESSAGES"] == "en"){ menu_delete .File.New .. } else if ($ENV["LC_MESSAGES"] == "de"){ menu_delete .Datei.Neu .. }

like this we can handle all languages in one acl file. strange is here, that the { sign has to be on the same line like the if statement. couldn't find out why. and it's annoying you have to set all foreign language menu withdrawings in the appropriate language...

=Brandon Ibach=

Ed's message got me thinking, so I did a little research. It appears that Epic may have a solution in the form of the message localization functions. Searching through the lib/messages.ams file will yield numerous messages whose text is the name, in various (somewhat inconsistent) forms, of standard menus and menu items. You can then use the "agettext" function on the "msgid" for that message to get the localized version, from which you should be able to derive the correct value to withdraw.

So, for instance, calling agettext(".File.Save As") will yield the localized version of the name of this menu item (though without the dots on the end).

This might provide a mechanism to avoid having separate logic for each language when withdrawing items. For that matter, custom menu items and such that you create might even be able to leverage some of these messages to provide their text in various languages.

=Dugald Topshee=

The way that I set up one of my clients that needed support for English and French versions of Epic was to actually alter the menu file that Epic uses. If you have access to the environment variables on the target system, then you can set the APTMENUFILE environment variable to point to a menu file that you create by modifying the standard Epic version. Some of the foreign language localisations - including the ones for German (de), French (fr) and Spanish (es) - include a custom editmenu.cf which you can modify as needed in your environment. The files are located within a subfolder of the locale folder in the Epic install path.

What I did was to take the editemnu.cf file for the French locale and also the standard English editmenu.cf file and then modify the menu elements that had been altered for my client's environment. I made the necessary changes directly to each menufile (the syntax is fairly clear and supports comments). Then I just put the two modified files (editmenu_en.cf and editmenu_fr.cf in my case) on the network and pointed every user's APTMENUFILE environment variable to the appopriate file. The edit menu specified by APTMENUFILE is loaded every time a new edit window is created in Epic. That way the English users get our customized English menu and the French users get our customized French menu; and you can easily switch any PC back and forth by changing the value of the variable and then restarting Epic.

One nice feature of this approach is that you can take advantage of the conditionals in the editmenu.cf file. For instance you can decide which menu items are always visible and which ones are only visible when the user selects "Full Menus" under "Options". Items inside a ...


 * 1) ifndef le
 * 2) endif

... block will be hidden unless the user selects "Full Menus".