poe

Уређивач .po фајлова
git clone https://git.sr.ht/~strahinja/poe
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување 06d5a2d30ec1fcb812c785452ef4486cb1cf868a
родитељ 5e0c86aee703a3c163044516a03a8be87e51d9ae
Аутор: Страхиња Радић <sr@strahinja.org>
Датум:   Fri, 20 Feb 2026 15:08:16 +0100

Update manpage; document exit codes; reflect changes to config.def.h

Diffstat:
MTODO | 2+-
Mpoe.1.in | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------
измењених датотека: 2, додавања: 105(+), брисања: 26(-)

diff --git a/TODO b/TODO @@ -18,7 +18,7 @@ TODO [x] util.c: u32_match_msgid_ending [x] Check L"" literals -[ ] Document exit statuses in poe.1.in +[x] Document exit statuses in poe.1.in [ ] Support Yudit's nonstandard PO format (no empty lines between individual entries) diff --git a/poe.1.in b/poe.1.in @@ -40,8 +40,11 @@ if the length of the text msgid: \(dq .Ed .Pp -(or msgid_plural:, msgstr:, etc) plus the length of the literal, plus one (for -the closing quote) is greater than +(or +.Ic "msgid_plural:" , +.Ic "msgstr:" , +etc) plus the length of the literal, plus one (for the closing quote) is greater +than .Va literal_break_threshold , a line of the form .Bd -literal -offset indent @@ -110,14 +113,14 @@ Edit dialog key bindings are as follows: .It \f[CR]C-S\fR Ta Update entry and close dialog .It \f[CR]C-B\fR or \f[CR]PgUp\fR Ta Update entry and edit previous entry .It \f[CR]C-F\fR or \f[CR]PgDn\fR Ta Update entry and edit next entry -.It \f[CR]C-P\fR Ta Show previous plural form of msgstr -.It \f[CR]C-N\fR Ta Show next plural form of msgstr +.It \f[CR]C-P\fR Ta Show previous plural form of Ic msgstr +.It \f[CR]C-N\fR Ta Show next plural form of Ic msgstr .It \f[CR]Escape\fR Ta Cancel changes and close dialog -.It \f[CR]C-C\fR Ta Yank (copy) current msgstr to paste buffer -.It \f[CR]C-V\fR Ta Paste the contents of paste buffer into current msgstr +.It \f[CR]C-C\fR Ta Yank (copy) current Ic msgstr No to paste buffer +.It \f[CR]C-V\fR Ta Paste the contents of paste buffer into current Ic msgstr .It \f[CR]F8\fR Ta Go to next untranslated entry .It \f[CR]F9\fR Ta Go to next fuzzy entry -.It \f[CR]F5\fR Ta Copy msgid to edit box as current msgstr +.It \f[CR]F5\fR Ta Copy Ic msgid No to edit box as current Ic msgstr .It \f[CR]F6\fR Ta Toggle focus between info box and edit box .It \f[CR]C-Z\fR Ta Toggle fuzzy flag .It \f[CR]C-A\fR or \f[CR]Home\fR Ta Go to start of line @@ -134,9 +137,10 @@ Edit dialog key bindings are as follows: .El .Pp In the table above, -.Dq current msgstr -refers to the situation when there are multiple msgstrs, representing different -plural forms. +.Dq current Ic msgstr +refers to the situation when there are multiple +.Ic msgstr Ns s, +representing different plural forms. Only the currently shown plural form is affected. .Pp When the info box is focused, arrow keys, \f[CR]C-B\fR/\f[CR]C-F\fR @@ -153,13 +157,17 @@ Status line is comprised of a number of segments, by default three. The central segment displays the current message number, the total messages count, then in parentheses: number of untranslated messages, number of fuzzy messages and the number of obsolete messages. -Obsolete messages are messages whose msgid doesn't match any msgid in the -message catalog anymore, and are commented out in the .po file using \f[CR]#~\fR -comments. +Obsolete messages are messages whose +.Ic msgid +doesn't match any +.Ic msgid +in the message catalog anymore, and are commented out in the .po file using +the \f[CR]#~\fR comments. . .Ss Message flags -Message flags are shown to the left of the msgid in the main window and the -statusbar of the edit box. +Message flags are shown to the left of the +.Ic msgid +in the main window and the statusbar of the edit box. They mean the following: .Bl -column -offset Ds "Character" .It Sy Character Ta Sy Meaning @@ -172,25 +180,96 @@ They mean the following: .Ss Error checking .Nm has some rudimentary checks of the translated messages built in. -First, when saving changes in the edit box, if the msgid has a newline character -(\f[CR]\en\fR), a dot (\f[CR].\fR) or a space (\f[CR]\~\fR) at the end, and the -corresponding msgstr doesn't, msgstr being saved will have its ending character -made to match the one from the msgid. -This feature can be disabled by commenting out the -.Dv MATCH_MSGSTR_ENDING -feature flag. +First, when saving changes in the edit box, if the +.Ic msgid +has a newline character (\f[CR]\en\fR), a dot (\f[CR].\fR) or a space +(\f[CR]\~\fR) at the end, and the corresponding +.Ic msgstr +doesn't, +.Ic msgstr +being saved will have its ending character made to match the one from the +.Ic msgid Ns . +This feature can be disabled by setting the +.Va match_msgstr_ending +configuration variable to 0. .Pp Second, if the numbers of newline characters (\f[CR]\en\fR), or, additionally, dots when -.Dv WARN_COUNT_DOTS -is set, in msgid and msgstr don't match, msgstr will be shown in a different -color on the main screen. +.Va warn_count_dots +is set, in +.Ic msgid +and +.Ic msgstr +don't match, +.Ic msgstr +will be shown in a different color on the main screen. If the number of newlines was intended, you can simply ignore this warning. Otherwise, it can be useful to detect unwanted discrepancies in formatting between the original message and the translation. . .Sh EXIT STATUS .Ex -std +.Pp +For errors caused by the unsuccessful calls to libc functions setting +.Va errno , +that value is returned as the exit status. +Otherwise, the exit status is one of the following: +.Bl -tag -width Ds -offset indent -compact +.It Li 201 +No filename was given on the command line. +.It Li 202 +Command line option is missing a required argument. +.It Li 203 +Command line argument is invalid/unsupported. +.It Li 204 +File is not a valid PO (Portable Object) file. +.It Li 205 +File is not a regular file. +.It Li 206 +There has been a termbox error. +.It Li 215 +Syntax error. +.It Li 216 +PO file doesn't have +.Ic "Plural\-Forms:" +in the first +.Ic msgid . +.It Li 217 +The +.Ic nplurals +field in the first +.Ic msgstr +does not contain a valid integer. +.El +. +.Sh DIAGNOSTICS +Most error messages output by +.Nm +are in the format +.Bd -ragged -offset Ds +.Nm : Ar msg +.Ed +.Pp +In the case of a syntax error, output is in the format: +.Bd -ragged -offset Ds +.Nm : +.Ar filename : Ns Ar lineno : Ns Ar colno : Ar msg +.Ed +.Pp +where +.Ar filename +is the name of the input file, +.Ar lineno +and +.Ar colno +are the line and column numbers in the input file where the error occured. +.Pp +When the error is caused by an error in the libc function which sets +.Va errno , +.Nm +calls +.Xr perror 3 +prior to outputting an error message in the above format. . .Sh AUTHORS .An Strahinya Radich Aq Mt sr@strahinja.org ,