gettext: Main PO Commands

1 
1 8.3.2 Main PO mode Commands
1 ---------------------------
1 
11    After setting up Emacs with something similar to the lines in ⇒
 Installation, PO mode is activated for a window when Emacs finds a PO
1 file in that window.  This puts the window read-only and establishes a
1 po-mode-map, which is a genuine Emacs mode, in a way that is not derived
1 from text mode in any way.  Functions found on ‘po-mode-hook’, if any,
1 will be executed.
1 
1    When PO mode is active in a window, the letters ‘PO’ appear in the
1 mode line for that window.  The mode line also displays how many entries
1 of each kind are held in the PO file.  For example, the string
1 ‘132t+3f+10u+2o’ would tell the translator that the PO mode contains 132
DONTPRINTYET 1 translated entries (⇒Translated Entries, 3 fuzzy entries (*note1DONTPRINTYET 1 translated entries (⇒Translated Entries, 3 fuzzy entries (⇒
 Fuzzy Entries), 10 untranslated entries (⇒Untranslated Entries)
1 and 2 obsolete entries (⇒Obsolete Entries).  Zero-coefficients
1 items are not shown.  So, in this example, if the fuzzy entries were
1 unfuzzied, the untranslated entries were translated and the obsolete
1 entries were deleted, the mode line would merely display ‘145t’ for the
1 counters.
1 
1    The main PO commands are those which do not fit into the other
1 categories of subsequent sections.  These allow for quitting PO mode or
1 for managing windows in special ways.
1 
1 ‘_’
1      Undo last modification to the PO file (‘po-undo’).
1 
1 ‘Q’
1      Quit processing and save the PO file (‘po-quit’).
1 
1 ‘q’
1      Quit processing, possibly after confirmation
1      (‘po-confirm-and-quit’).
1 
1 ‘0’
1      Temporary leave the PO file window (‘po-other-window’).
1 
1 ‘?’
1 ‘h’
1      Show help about PO mode (‘po-help’).
1 
1 ‘=’
1      Give some PO file statistics (‘po-statistics’).
1 
1 ‘V’
1      Batch validate the format of the whole PO file (‘po-validate’).
1 
1    The command ‘_’ (‘po-undo’) interfaces to the Emacs _undo_ facility.
1 ⇒Undoing Changes (emacs)Undo.  Each time ‘_’ is typed,
1 modifications which the translator did to the PO file are undone a
1 little more.  For the purpose of undoing, each PO mode command is
1 atomic.  This is especially true for the ‘<RET>’ command: the whole
1 edition made by using a single use of this command is undone at once,
1 even if the edition itself implied several actions.  However, while in
1 the editing window, one can undo the edition work quite parsimoniously.
1 
1    The commands ‘Q’ (‘po-quit’) and ‘q’ (‘po-confirm-and-quit’) are used
1 when the translator is done with the PO file.  The former is a bit less
1 verbose than the latter.  If the file has been modified, it is saved to
1 disk first.  In both cases, and prior to all this, the commands check if
1 any untranslated messages remain in the PO file and, if so, the
1 translator is asked if she really wants to leave off working with this
1 PO file.  This is the preferred way of getting rid of an Emacs PO file
1 buffer.  Merely killing it through the usual command ‘C-x k’
1 (‘kill-buffer’) is not the tidiest way to proceed.
1 
1    The command ‘0’ (‘po-other-window’) is another, softer way, to leave
1 PO mode, temporarily.  It just moves the cursor to some other Emacs
1 window, and pops one if necessary.  For example, if the translator just
1 got PO mode to show some source context in some other, she might
1 discover some apparent bug in the program source that needs correction.
1 This command allows the translator to change sex, become a programmer,
1 and have the cursor right into the window containing the program she (or
1 rather _he_) wants to modify.  By later getting the cursor back in the
1 PO file window, or by asking Emacs to edit this file once again, PO mode
1 is then recovered.
1 
1    The command ‘h’ (‘po-help’) displays a summary of all available PO
1 mode commands.  The translator should then type any character to resume
1 normal PO mode operations.  The command ‘?’ has the same effect as ‘h’.
1 
1    The command ‘=’ (‘po-statistics’) computes the total number of
1 entries in the PO file, the ordinal of the current entry (counted from
1 1), the number of untranslated entries, the number of obsolete entries,
1 and displays all these numbers.
1 
1    The command ‘V’ (‘po-validate’) launches ‘msgfmt’ in checking and
1 verbose mode over the current PO file.  This command first offers to
1 save the current PO file on disk.  The ‘msgfmt’ tool, from GNU
1 ‘gettext’, has the purpose of creating a MO file out of a PO file, and
1 PO mode uses the features of this program for checking the overall
1 format of a PO file, as well as all individual entries.
1 
1    The program ‘msgfmt’ runs asynchronously with Emacs, so the
1 translator regains control immediately while her PO file is being
1 studied.  Error output is collected in the Emacs ‘*compilation*’ buffer,
1 displayed in another window.  The regular Emacs command ‘C-x`’
1 (‘next-error’), as well as other usual compile commands, allow the
1 translator to reposition quickly to the offending parts of the PO file.
1 Once the cursor is on the line in error, the translator may decide on
1 any PO mode action which would help correcting the error.
1