2 weeks ago - last edited 2 weeks ago
Hello everyone,
I was always thinking if there's a better way to do this.. I have 2 versions of my addon, international and german. I have the two .grc files:
Resources\RINT\addon_int.grc
Resources\RGER\addon_ger.grc
You cannot set up preprocessor definitions in .grc files neither in your Resources\RFIX-win\AddOn_Main.rc2 file, it simply doesn't work. However the here included ("#include "addon_int.grc.rc2") file will be later built in your addon. So you have to open this AddOn_Main.rc2 every time and comment out/set up your desired .grc.rc2 file:
it has to be look like this:
#include "addon_int.grc.rc2"
//#include "addon_ger.grc.rc2"
#include "addon_fix.grc.rc2"
If you include both, your resources will conflict each other.
Manually change lines in your "addon.vcxproj" where your resources will compile help you neither.
Any suggestions?
Solved! Go to Solution.
2 weeks ago
Hi Carrast,
I also have most of my Add-Ons in English & German. I'm using this CMake template (but forked a few years ago and adapted since): https://github.com/GRAPHISOFT/archicad-addon-cmake
The CMakeLists.txt sets the resource path to a language specific directory "RINT" / "RGER" as you have it. But in this directories, the resource file has the same name! So it's "RINT/addon.grc" and "RGER/addon.grc" then in the "RFIX.win/AddOnMain.rc2" the file is included as "addon.grc.rc2".
Maybe adapting this to your setup could work too?
Hope that helps,
Bernd
2 weeks ago - last edited 2 weeks ago
Just a remark not about localization, but about preprocessor definitions of the resource compiler.
Actually I think rc.exe supports preprocessor definitions in a command line.
It should work, for commanf line of AddOn_Main.rc2, like
rc /dGER (+ other options)
#if defined (GER)
#include "addon_ger.grc.rc2"
#else
#include "addon_int.grc.rc2"
#endif
2 weeks ago
Hi Carrast,
I also have most of my Add-Ons in English & German. I'm using this CMake template (but forked a few years ago and adapted since): https://github.com/GRAPHISOFT/archicad-addon-cmake
The CMakeLists.txt sets the resource path to a language specific directory "RINT" / "RGER" as you have it. But in this directories, the resource file has the same name! So it's "RINT/addon.grc" and "RGER/addon.grc" then in the "RFIX.win/AddOnMain.rc2" the file is included as "addon.grc.rc2".
Maybe adapting this to your setup could work too?
Hope that helps,
Bernd
2 weeks ago - last edited 2 weeks ago
Thank you Bernd!
This was the solution!
You have to configure your .vcxproj a bit (change the ..\ComplieResources.py INT to GER) but then it's working!
Best regards!