GeoMX
September 2nd, 2010, 07:11 PM
Has someone tried marking translatable strings for existing code using emacs and PO mode?
I'm willing to translate a C program, it has lots of source files. I'm thinking of writting a script that would export character strings in the sources, I'd translate them and later replace them into the original files.
Before writting such a script, I found that gettext could be of some help here, there is an Emacs PO mode that would allow me to search for candidate strings for translation: http://www.gnu.org/software/gettext/manual/gettext.html#Marking
The problem is, I've never used emacs before, I've just installed and read the tutorial, but don't know how to make the commands work for my source file:
,
Search through program sources for a string which looks like a candidate for translation (po-tags-search).
M-,
Mark the last string found with ‘_()’ (po-mark-translatable).
M-.
Mark the last string found with a keyword taken from a set of possible keywords. This command with a prefix allows some management of these keywords (po-select-mark-and-mark).
I just can't figure out how to make these commands work, I open one file and enter PO mode, but typing [,] does not search strings but opens a buffer window for entering notes.
Any help is appreciated, thanks.
I'm willing to translate a C program, it has lots of source files. I'm thinking of writting a script that would export character strings in the sources, I'd translate them and later replace them into the original files.
Before writting such a script, I found that gettext could be of some help here, there is an Emacs PO mode that would allow me to search for candidate strings for translation: http://www.gnu.org/software/gettext/manual/gettext.html#Marking
The problem is, I've never used emacs before, I've just installed and read the tutorial, but don't know how to make the commands work for my source file:
,
Search through program sources for a string which looks like a candidate for translation (po-tags-search).
M-,
Mark the last string found with ‘_()’ (po-mark-translatable).
M-.
Mark the last string found with a keyword taken from a set of possible keywords. This command with a prefix allows some management of these keywords (po-select-mark-and-mark).
I just can't figure out how to make these commands work, I open one file and enter PO mode, but typing [,] does not search strings but opens a buffer window for entering notes.
Any help is appreciated, thanks.