I have a project developed on a Mac using Clion and cmake and it uses the ‘useHaiku’ module from Chris Roberts.
However I am not able to make use of translations. What I know to far that a build traget should run ‘make catkeys?’ but it won’t.
I am totally lost and don’t know how to proceed, at last how to let compile the desired target.
Can anybody visit my current work (PR) and give me a hand?
I’m not that familiar with translations in the source (@humdinger should know more about that), from a quick check I don’t see any locales in the source? (files like en.catkeys or the likes).
There are a few notes about using translation in the Beezer Wiki since it also uses my cmake module. Hopefully I will be able to check out your project and see if there is some problem soon, but I haven’t been feeling well for a few days so I’m not sure when that will be.
Unfortunately, I cannot help with cmake, as I only learned on make, kinda like stick & automatic.
The catkeys only have to be generated once, not for every build. Or when you change GUI strings, ofc. But, as I said, no experience with using cmake…
I did leave a few comments on your PR.
The catkeys generation needs the collectcatkeys tool, which is available on Haiku but usually not elsewhere. So, this would not work if you are cross-compiling, maybe? Unless it is somehow able to find that tool in an existing Haiku build or so? Likewise to compile the catkeys files to catalog files you will need the linkcatkeys executable.
Looking at UseHaiku, you also need to set HAIKU_ENABLE_I18N in your cmake configuration and probably call haiku_add_i18n() to enable it for your executable.
I am absolute fine to compile on the real Haiku box. But to compile on that box to let generate the catkeys already failed / I don’t know how to to this.
There is something odd with the file paths for the two generated cpp files. When I change their paths and prefix them with the build directory then make catkeys is successful. Hopefully I’ll be able to look at this more closely soon.
Now I can run cmake - it builds the API keys into the source files, then in ./build folder, the $: make catkeys command runs.
It seems also that $: make bindcatalog runs, but then the app crashes when it runs.
The only crash I get is when I don’t have an API key set during the build, which seems to be unrelated to translations. If I cheat and use some random value for the key then the application loads fine(although it can’t retrieve data with an invalid key).
Hm, interestingly.
Now I am sick (since the beginning of the week and it gets slowly better. But I’ll check when I am feeling better.
Do you think than the ‘translation’ PR is ready to merge? It prepares for translations and builds and works?
I can make it work by adding a build/ prefix to the two generated cpp files. There is an issue with my cmake module that I’ll need to fix in order to avoid having to do that. I’ll leave some notes on the pull request.
In my case, I run cmake and then switched to the build-directory. The files there are the prepaired files (with infected API keys)
In this dir I am able to run $: make catkeys.
Can you just try to set an environment variable with the (any) API key before running cmake?