top: adapted/generalized comments for Makevars --add-comments=

This commit is contained in:
Jim Warner 2011-11-06 17:08:43 -06:00 committed by Craig Small
parent 67034a9a4a
commit de3ed5bff8

View File

@ -37,11 +37,13 @@
// XGETTEXT_OPTION in po/Makevars, *any* preceeding c style // XGETTEXT_OPTION in po/Makevars, *any* preceeding c style
// comment will be propagated to the .pot file, providing // comment will be propagated to the .pot file, providing
// that the gettext macro isn't empty as discussed above. // that the gettext macro isn't empty as discussed above.
// However, this is far too aggressive so we have chosen
// the word 'Translation' to denote xgettext comments.
// //
// /* Need Not Say 'TRANSLATORS': ... // /* Need Not Say 'TRANSLATORS': ...
// snprintf(buf, sizeof(buf), "%s", _( // unseen comment // snprintf(buf, sizeof(buf), "%s", _( // unseen comment
// //
// /* Translator Hint: ... // /* Translation Hint: ...
// snprintf(buf, sizeof(buf), "%s", _("" // now it's seen! // snprintf(buf, sizeof(buf), "%s", _("" // now it's seen!
// //
// Translation, from po/ directory after make -------------- // Translation, from po/ directory after make --------------
@ -89,17 +91,16 @@ const char *Uniq_nlstab[uniq_MAX];
static void build_desc_nlstab (void) { static void build_desc_nlstab (void) {
char buf[SMLBUFSIZ]; char buf[SMLBUFSIZ];
/* ----------------------------------------------------------------------- /* Translation Notes ------------------------------------------------
. Note #1 for Translators: . It is strongly recommend that the --no-wrap command line option
. It is strongly recommend that the --no-wrap command line option . be used with all supporting translation tools, when available.
. be used with all supporting translation tools, when available. .
. . The following single lines contain only plain text used as the
. The following single lines contain only plain text used as . descriptions under Field Management when the 'f' key is typed.
. the descriptions under Field Management when the 'f' key is typed. .
. . To avoid truncation, each translated line MUST be kept to a
. To avoid truncation, each translated line MUST be kept to a length . length of 20 characters or less.
. of 20 characters or less.\n" . */
. */
snprintf(buf, sizeof(buf), "%s", _("Process Id")); snprintf(buf, sizeof(buf), "%s", _("Process Id"));
Desc_nlstab[P_PID] = strdup(buf); Desc_nlstab[P_PID] = strdup(buf);
@ -194,17 +195,16 @@ static void build_desc_nlstab (void) {
static void build_norm_nlstab (void) { static void build_norm_nlstab (void) {
char buf[MEDBUFSIZ]; char buf[MEDBUFSIZ];
/* ----------------------------------------------------------------------- /* Translation Notes ------------------------------------------------
. Note #2 for Translators: . It is strongly recommend that the --no-wrap command line option
. It is strongly recommend that the --no-wrap command line option . be used with all supporting translation tools, when available.
. be used with all supporting translation tools, when available. .
. . This group of lines contains both plain text and c-format strings.
. This group of lines contains both plain text and c-format strings. .
. . Some strings reflect switches used to affect the running program
. Some strings reflect switches used to affect the running program . and should not be translated without also making corresponding
. and should not be translated without also making corresponding . c-code logic changes.
. c-code logic changes. . */
. */
snprintf(buf, sizeof(buf), "%s", _("" snprintf(buf, sizeof(buf), "%s", _(""
"\tsignal %d (%s) was caught by %s, please\n" "\tsignal %d (%s) was caught by %s, please\n"
@ -266,8 +266,8 @@ static void build_norm_nlstab (void) {
snprintf(buf, sizeof(buf), "%s", _("Off")); snprintf(buf, sizeof(buf), "%s", _("Off"));
Norm_nlstab[OFF_one_word_txt] = strdup(buf); Norm_nlstab[OFF_one_word_txt] = strdup(buf);
/* Translation Hint #1: Only the following words should be translated /* Translation Hint: Only the following words should be translated
. delay, limit, user, cols */ . delay, limit, user, cols */
snprintf(buf, sizeof(buf), "%s", _(" -hv | -bcHiSs -d delay -n limit -u|U user | -p pid[,pid] -w [cols]")); snprintf(buf, sizeof(buf), "%s", _(" -hv | -bcHiSs -d delay -n limit -u|U user | -p pid[,pid] -w [cols]"));
Norm_nlstab[USAGE_abbrev_txt] = strdup(buf); Norm_nlstab[USAGE_abbrev_txt] = strdup(buf);
@ -426,31 +426,30 @@ static void build_norm_nlstab (void) {
static void build_uniq_nsltab (void) { static void build_uniq_nsltab (void) {
char buf[BIGBUFSIZ]; char buf[BIGBUFSIZ];
/* ----------------------------------------------------------------------- /* Translation Notes ------------------------------------------------
. Note #3 for Translators: . It is strongly recommend that the --no-wrap command line option
. It is strongly recommend that the --no-wrap command line option . be used with all supporting translation tools, when available.
. be used with all supporting translation tools, when available. .
. . The next several text groups contain special escape sequences
. The next several text groups contain special escape sequences . representing values used to index a table at run-time.
. representing values used to index a table at run-time. .
. . Each such sequence consists of a tilde (~) followed by an ascii
. Each such sequence consists of a tilde (~) followed by an ascii . number in the rage of '1' - '8'. Examples are '~2', '~8', etc.
. number in the rage of '1' - '8'. Examples are '~2', '~8', etc. . These escape sequences must never themselves be translated but
. These escape sequences must never themselves be translated but . could be deleted.
. could be deleted. .
. . If you remove these escape sequences (both tilde and number) it
. If you remove these escape sequences (both tilde and number) it . would make translation easier. However, the ability to display
. would make translation easier. However, the ability to display . colors and bold text at run-time will have been lost.
. colors and bold text at run-time will have been lost. .
. . Additionally, each of these text groups was designed to display
. Additionally, each of these text groups was designed to display . in a 80x24 terminal window. Hopefully, any translations will
. in a 80x24 terminal window. Hopefully, any translations will . adhere to that goal lest the translated text be truncated.
. adhere to that goal lest the translated text be truncated. .
. . If you would like additional information regarding these strings,
. If you would like additional information regarding these strings, . please see the prolog to the show_special function in the top.c
. please see the prolog to the show_special function in the top.c . source file.
. source file. . */
. */
snprintf(buf, sizeof(buf), "%s", _("" snprintf(buf, sizeof(buf), "%s", _(""
"Help for Interactive Commands~2 - %s\n" "Help for Interactive Commands~2 - %s\n"
@ -479,9 +478,9 @@ static void build_uniq_nsltab (void) {
"")); ""));
Uniq_nlstab[KEYS_helpbas_fmt] = strdup(buf); Uniq_nlstab[KEYS_helpbas_fmt] = strdup(buf);
/* Translation Hint #2: As is true for the text above, the "keys" shown to the left and /* Translation Hint: As is true for the text above, the "keys" shown to the left and
. also imbedded in the translatable text (along with escape seqs) . also imbedded in the translatable text (along with escape seqs)
. should never themselves be translated. */ . should never themselves be translated. */
snprintf(buf, sizeof(buf), "%s", _("" snprintf(buf, sizeof(buf), "%s", _(""
" k,r Manipulate tasks: '~1k~2' kill; '~1r~2' renice\n" " k,r Manipulate tasks: '~1k~2' kill; '~1r~2' renice\n"
" d or s Set update interval\n" " d or s Set update interval\n"
@ -516,30 +515,28 @@ static void build_uniq_nsltab (void) {
"")); ""));
Uniq_nlstab[WINDOWS_help_fmt] = strdup(buf); Uniq_nlstab[WINDOWS_help_fmt] = strdup(buf);
/* ----------------------------------------------------------------------- /* Translation Notes ------------------------------------------------
. Note #4 for Translators: . The following 'Help for color mapping' simulated screen should
. The following 'Help for color mapping' simulated screen should . probably NOT be translated. It is terribly hard to follow in
. probably NOT be translated. It is terribly hard to follow in this . this form and any translation could produce unpleasing results
. form and any translation could produce unpleasing results that are . that are unlikely to parallel the running top program.
. unlikely to parallel the running top program. .
. . If you decide to proceed with translation, do the following
. If you decide to proceed with translation, do the following lines . line only, taking care not to disturbe the '~' + number.
. only taking care not to disturbe the '~' + number sequence. .
. . --> " Tasks:~3 64 ~2total,~3 2 ~3running,~3 62
. --> " Tasks:~3 64 ~2total,~3 2 ~3running,~3 62 . --> " %%Cpu(s):~3 76.5 ~2user,~3 11.2 ~2system,~
. --> " %%Cpu(s):~3 76.5 ~2user,~3 11.2 ~2system,~ .
. . --> " available toggles: ~1B~2 =disable bold globa
. --> " available toggles: ~1B~2 =disable bold globa . --> " ~1z~2 =color/mono (~1%s~2), ~1b~2 =tasks
. --> " ~1z~2 =color/mono (~1%s~2), ~1b~2 =tasks .
. . --> "Select ~1target~2 as upper case letter:\n"
. --> "Select ~1target~2 as upper case letter:\n" . --> " S~2 = Summary Data,~1 M~2 = Messages/Prompt
. --> " S~2 = Summary Data,~1 M~2 = Messages/Prompt . --> " H~2 = Column Heads,~1 T~2 = Task Informatio
. --> " H~2 = Column Heads,~1 T~2 = Task Informatio . --> "Select ~1color~2 as number:\n"
. --> "Select ~1color~2 as number:\n" . --> " 0~2 = black,~1 1~2 = red, ~1 2~2 = gree
. --> " 0~2 = black,~1 1~2 = red, ~1 2~2 = gree . --> " 4~2 = blue, ~1 5~2 = magenta,~1 6~2 = cyan
. --> " 4~2 = blue, ~1 5~2 = magenta,~1 6~2 = cyan . */
.
. */
snprintf(buf, sizeof(buf), "%s", _("" snprintf(buf, sizeof(buf), "%s", _(""
"Help for color mapping~2 - %s\n" "Help for color mapping~2 - %s\n"
"current window: ~1%s~6\n" "current window: ~1%s~6\n"
@ -590,25 +587,25 @@ static void build_uniq_nsltab (void) {
"")); ""));
Uniq_nlstab[STATE_lin2x5_fmt] = strdup(buf); Uniq_nlstab[STATE_lin2x5_fmt] = strdup(buf);
/* Translation Hint #3: Only the following abbreviations need be translated /* Translation Hint: Only the following abbreviations need be translated
. us = user, sy = system, ni = nice, id = idle, wa = wait, . us = user, sy = system, ni = nice, id = idle, wa = wait,
. hi hardware interrupt, si = software interrupt */ . hi hardware interrupt, si = software interrupt */
snprintf(buf, sizeof(buf), "%s", _("%%%s~3" snprintf(buf, sizeof(buf), "%s", _("%%%s~3"
" %#5.1f ~2us,~3 %#5.1f ~2sy,~3 %#5.1f ~2ni,~3 %#5.1f ~2id,~3 %#5.1f ~2wa,~3 %#5.1f ~2hi,~3 %#5.1f ~2si~3\n" " %#5.1f ~2us,~3 %#5.1f ~2sy,~3 %#5.1f ~2ni,~3 %#5.1f ~2id,~3 %#5.1f ~2wa,~3 %#5.1f ~2hi,~3 %#5.1f ~2si~3\n"
"")); ""));
Uniq_nlstab[STATE_lin2x6_fmt] = strdup(buf); Uniq_nlstab[STATE_lin2x6_fmt] = strdup(buf);
/* Translation Hint #4: Only the following abbreviations need be translated /* Translation Hint: Only the following abbreviations need be translated
. us = user, sy = system, ni = nice, id = idle, wa = wait, . us = user, sy = system, ni = nice, id = idle, wa = wait,
. hi hardware interrupt, si = software interrupt, st = steal time */ . hi hardware interrupt, si = software interrupt, st = steal time */
snprintf(buf, sizeof(buf), "%s", _("%%%s~3" snprintf(buf, sizeof(buf), "%s", _("%%%s~3"
"%#5.1f ~2us,~3%#5.1f ~2sy,~3%#5.1f ~2ni,~3%#5.1f ~2id,~3%#5.1f ~2wa,~3%#5.1f ~2hi,~3%#5.1f ~2si,~3%#5.1f ~2st~3\n" "%#5.1f ~2us,~3%#5.1f ~2sy,~3%#5.1f ~2ni,~3%#5.1f ~2id,~3%#5.1f ~2wa,~3%#5.1f ~2hi,~3%#5.1f ~2si,~3%#5.1f ~2st~3\n"
"")); ""));
Uniq_nlstab[STATE_lin2x7_fmt] = strdup(buf); Uniq_nlstab[STATE_lin2x7_fmt] = strdup(buf);
/* Translation Hint #5: Only the following need be translated /* Translation Hint: Only the following need be translated
. abbreviations: Mem = physical memory/ram, Swap = the linux swap file . abbreviations: Mem = physical memory/ram, Swap = the linux swap file
. words: total, used, free, buffers, cached */ . words: total, used, free, buffers, cached */
snprintf(buf, sizeof(buf), "%s", _("" snprintf(buf, sizeof(buf), "%s", _(""
"%s Mem: ~3 %8lu ~2total,~3 %8lu ~2used,~3 %8lu ~2free,~3 %8lu ~2buffers~3\n" "%s Mem: ~3 %8lu ~2total,~3 %8lu ~2used,~3 %8lu ~2free,~3 %8lu ~2buffers~3\n"
"%s Swap:~3 %8lu ~2total,~3 %8lu ~2used,~3 %8lu ~2free,~3 %8lu ~2cached~3\n" "%s Swap:~3 %8lu ~2total,~3 %8lu ~2used,~3 %8lu ~2free,~3 %8lu ~2cached~3\n"