[haiku-development] How to add file names to a catalog at build time?

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Sun, 12 May 2013 21:22:39 -0400

I am trying to internationalize the keymap names and keyboard layout
names that appear in the Keymap preflet. In order to do that I need to
add the keymap and layout file names to Keymap's catalog.

I'd prefer that the catalog entries were auto-generated from the file
names so that we don't have to maintain a separate list. That means
building a header file at compile time that contains the names and
then including it in the Keymap preflet's Jamfile.

What I'm thinking of is a header file that has a bunch of
B_TRANSLATE_MARK("<keymap_name>"); entries and then in Keymap I issue
B_TRANSLATE_NOCOLLECT("<keymap_name>") to get the localized name out
of the catalog.

I've created the list manually by just filling out the keymap names
which seems to work, but, like I said, I'd prefer to fill out the
catalog from the file names at compile time directly.

We are already looping through the list of keymaps and keyboard
layouts in HaikuImage to add the files to the image, would it be
possible to use Jam to build a header file that could be used to
included by the Keymap preflet?

We're doing something sorta kinda similar building the system default
keymap into it's own header file that we use in certain places.

Thanks,
John Scipione

Other related posts: