On Mon, 2013-05-13 at 09:15 +0200, Éloi Rivard wrote: > Well, I imagine that it would basically be a function that would split > a string (using strtok or such), translate tokens and rebuild a string > from them. I can do that when I have a bit of time.
I think there may be something trickier here: the elements of the menu path are already strings that have been used elsewhere in the program and are known to xgettext from their occurrence somewhere in the program(*). If we just stripped out the elements of the path we would need something to relate these strings to the ones that xgettext has seen. We need to store the menu path in untranslated form so that it can be used to traverse the file system, but we perhaps need to store a translated version of it when it is built out of the component strings that xgettext has seen. Richard (*) I think there are two places where menu names are introduced - once via generate_source.c where GtkActions are created for the built in menus and (I am not sure but I think) somewhere else for sub menus that are created to hold scripted commands. The somewhere else would be during the parsing of Default.commands. > > > > 2013/5/11 Richard Shann <[email protected]> > Eloi, > > I think you are the expert now on translation inside Denemo :) > I see that menu names are all translated, so it should be > possible to > write a function in C that takes a menu path > (e.g. /ObjectMenu/Directives) and generates a translated form > using the > translations that exist (somewhere in there!) for ObjectMenu > and > Directives. > (Well, I am not quite sure that the top-most level does exist > in > translation, but we can special case that). > > Do you know how to do this - can you tell me or, even better, > create > such a function? The returned path should be allocated on the > heap, the > caller will g_free() the result. > > Richard > > > > _______________________________________________ > Denemo-devel mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/denemo-devel > > > > -- > Éloi Rivard - [email protected] > > « On perd plus à être indécis qu'à se tromper. » > _______________________________________________ Denemo-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/denemo-devel
