Archicad C++ API
About Archicad add-on development using the C++ API.

Multi language Add-On

Martin Walter
Enthusiast

Actually my Addon only supports german. I'd like to recognize the language of ArchiCAD and to adjust the Addon-menu entries to that language.

Is this possible or do I need different installers for each language?

How do I recognize the language of ArchiCAD with the API?

How can I change the menu text during runtime with the API?

AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD
1 ACCEPTED SOLUTION
4 REPLIES 4
Solution

Hi Martin,


You don't necessarily need a different installer for each language.

You can use the function ACAPI_AddOnIdentification_Application which returns the language as one of the response fields.

And to change the menu text you can use: ACAPI_MenuItem_SetMenuItemText

 

Hope that helps,

Bernd

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: bschwb.com
kolioi
Booster

You can get the language from CheckEnvironment() like this:

GS::UniString ArchicadLanguage;
API_AddonType __ACDLL_CALL CheckEnvironment(API_EnvirParams* envir)
{
	RSGetIndString(&envir->addOnInfo.name, ID_ADDON_INFO, 1, ACAPI_GetOwnResModule());
	RSGetIndString(&envir->addOnInfo.description, ID_ADDON_INFO, 2, ACAPI_GetOwnResModule());

	ArchicadLanguage = envir->serverInfo.language;

	return APIAddon_Preload;
}

Then you can have separate resource files for each language.

 

Thanks a lot, that works fine!

One thing is missing now:

When I register a menu via

ACAPI_MenuItem_RegisterMenu(ID_MENU_STRINGS_CREATE, ID_STATUS_STRINGS_CREATE, MenuCode_UserDef, MenuFlag_Default);

I like to change the text of the status string too: ID_STATUS_STRINGS_CREATE

It seems that this does not work with the ACAPI_MenuItem_SetMenuItemText command.

How can I change the text of status strings? 

AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD

I couldn't find a command to do this either. It might actually not be possible to change the status string after registering the menu item.

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: bschwb.com

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!