man-to-po
Получилось :-))) наконец-то сделать из man в po (осмысленно, то есть
когда понимаешь, что происходит).
(Те варианты, что рекомендовали, не получились - пишет ошибки, надо
долго разбираться, проще сначала понять принцип форматирования текста и
тогда будет проще, возможно, разобраться в тех ошибках)
Это 2-ой вариант - иду медленно, построчно -
В результате получается файл *.po и poedit соглашается с ним работать
(приложила acheck.1 - файл po, получен из man, в конце файла указан
источник информации и порядок действий, как он был сформирован, ну и
ls_man_1.po для комплекта). Но это медленно...
Далее описала, как пробовала ввести всё в одну строку - это 1-ый
вариант - не получилось. Что посоветуете в 1-ом варианте?
И 2-ой вариант подойдёт для перекидки man в po?
2-ой вариант
cp /usr/share/man/man1/ls.1.gz /home/tamrik/
tamrik@localhost:~$ gzip -d ls.1.gz
tamrik@localhost:~$ roff2text -i ls.1 -o ls.1.txt
troff: bad output page list
LS(1) User
Commands LS(1)
NAME
ls - list directory contents
........................................
GNU coreutils 8.28 October
2017 LS(1)
Скопировали с терминала в файл ручками и записали его как ls.1.txt
tamrik@localhost:~$ txt2po -i ls.1.txt -o ls_1.ro
processing 1 files...
[###########################################] 100%
1-ый вариант
cp /usr/share/man/man1/ls.1.gz /home/tamrik/ | gzip -d ls.1.gz |
roff2text -i ls.1 -o - | txt2po -i - -o ls_1.ro
Не получилась :-)))
#. extracted from ls.1.txt
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-22 15:53+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Translate Toolkit 2.2.5\n"
#: ls.1.txt:2
msgid ""
"LS(1) User Commands "
"LS(1)"
msgstr ""
#: ls.1.txt:7
msgid ""
"NAME\n"
" ls - list directory contents"
msgstr ""
#: ls.1.txt:10
msgid ""
"SYNOPSIS\n"
" ls [OPTION]... [FILE]..."
msgstr ""
#: ls.1.txt:15
msgid ""
"DESCRIPTION\n"
" List information about the FILEs (the current directory by "
"default).\n"
" Sort entries alphabetically if none of -cftuvSUX nor --sort is "
"speci‐\n"
" fied."
msgstr ""
#: ls.1.txt:18
msgid ""
" Mandatory arguments to long options are mandatory for short "
"options\n"
" too."
msgstr ""
#: ls.1.txt:21
msgid ""
" -a, --all\n"
" do not ignore entries starting with ."
msgstr ""
#: ls.1.txt:24
msgid ""
" -A, --almost-all\n"
" do not list implied . and .."
msgstr ""
#: ls.1.txt:27
msgid ""
" --author\n"
" with -l, print the author of each file"
msgstr ""
#: ls.1.txt:30
msgid ""
" -b, --escape\n"
" print C-style escapes for nongraphic characters"
msgstr ""
#: ls.1.txt:34
msgid ""
" --block-size=SIZE\n"
" scale sizes by SIZE before printing them; e.g., '--block-"
"size=M'\n"
" prints sizes in units of 1,048,576 bytes; see SIZE format below"
msgstr ""
#: ls.1.txt:37
msgid ""
" -B, --ignore-backups\n"
" do not list implied entries ending with ~"
msgstr ""
#: ls.1.txt:41
msgid ""
" -c with -lt: sort by, and show, ctime (time of last modification "
"of\n"
" file status information); with -l: show ctime and sort by "
"name;\n"
" otherwise: sort by ctime, newest first"
msgstr ""
#: ls.1.txt:43
msgid " -C list entries by columns"
msgstr ""
#: ls.1.txt:47
msgid ""
" --color[=WHEN]\n"
" colorize the output; WHEN can be 'always' (default if "
"omitted),\n"
" 'auto', or 'never'; more info below"
msgstr ""
#: ls.1.txt:50
msgid ""
" -d, --directory\n"
" list directories themselves, not their contents"
msgstr ""
#: ls.1.txt:53
msgid ""
" -D, --dired\n"
" generate output designed for Emacs' dired mode"
msgstr ""
#: ls.1.txt:55
msgid " -f do not sort, enable -aU, disable -ls --color"
msgstr ""
#: ls.1.txt:58
msgid ""
" -F, --classify\n"
" append indicator (one of */=>@|) to entries"
msgstr ""
#: ls.1.txt:61
msgid ""
" --file-type\n"
" likewise, except do not append '*'"
msgstr ""
#: ls.1.txt:65
msgid ""
" --format=WORD\n"
" across -x, commas -m, horizontal -x, long -l, single-column "
"-1,\n"
" verbose -l, vertical -C"
msgstr ""
#: ls.1.txt:68
msgid ""
" --full-time\n"
" like -l --time-style=full-iso"
msgstr ""
#: ls.1.txt:70
msgid " -g like -l, but do not list owner"
msgstr ""
#: ls.1.txt:73
msgid ""
" --group-directories-first\n"
" group directories before files;"
msgstr ""
#: ls.1.txt:76
msgid ""
" can be augmented with a --sort option, but any use "
"of\n"
" --sort=none (-U) disables grouping"
msgstr ""
#: ls.1.txt:79
msgid ""
" -G, --no-group\n"
" in a long listing, don't print group names"
msgstr ""
#: ls.1.txt:82
msgid ""
" -h, --human-readable\n"
" with -l and/or -s, print human readable sizes (e.g., 1K 234M "
"2G)"
msgstr ""
#: ls.1.txt:84
msgid " --si likewise, but use powers of 1000 not 1024"
msgstr ""
#: ls.1.txt:87
msgid ""
" -H, --dereference-command-line\n"
" follow symbolic links listed on the command line"
msgstr ""
#: ls.1.txt:90
msgid ""
" --dereference-command-line-symlink-to-dir\n"
" follow each command line symbolic link"
msgstr ""
#: ls.1.txt:92
msgid " that points to a directory"
msgstr ""
#: ls.1.txt:96
msgid ""
" --hide=PATTERN\n"
" do not list implied entries matching shell PATTERN ("
"overridden\n"
" by -a or -A)"
msgstr ""
#: ls.1.txt:100
msgid ""
" --hyperlink[=WHEN]\n"
" hyperlink file names; WHEN can be 'always' (default if "
"omitted),\n"
" 'auto', or 'never'"
msgstr ""
#: ls.1.txt:104
msgid ""
" --indicator-style=WORD\n"
" append indicator with style WORD to entry names: none "
"(default),\n"
" slash (-p), file-type (--file-type), classify (-F)"
msgstr ""
#: ls.1.txt:107
msgid ""
" -i, --inode\n"
" print the index number of each file"
msgstr ""
#: ls.1.txt:110
msgid ""
" -I, --ignore=PATTERN\n"
" do not list implied entries matching shell PATTERN"
msgstr ""
#: ls.1.txt:113
msgid ""
" -k, --kibibytes\n"
" default to 1024-byte blocks for disk usage"
msgstr ""
#: ls.1.txt:115
msgid " -l use a long listing format"
msgstr ""
#: ls.1.txt:120
msgid ""
" -L, --dereference\n"
" when showing file information for a symbolic link, show "
"informa‐\n"
" tion for the file the link references rather than for the "
"link\n"
" itself"
msgstr ""
#: ls.1.txt:122
msgid " -m fill width with a comma separated list of entries"
msgstr ""
#: ls.1.txt:125
msgid ""
" -n, --numeric-uid-gid\n"
" like -l, but list numeric user and group IDs"
msgstr ""
#: ls.1.txt:128
msgid ""
" -N, --literal\n"
" print entry names without quoting"
msgstr ""
#: ls.1.txt:130
msgid " -o like -l, but do not list group information"
msgstr ""
#: ls.1.txt:133
msgid ""
" -p, --indicator-style=slash\n"
" append / indicator to directories"
msgstr ""
#: ls.1.txt:136
msgid ""
" -q, --hide-control-chars\n"
" print ? instead of nongraphic characters"
msgstr ""
#: ls.1.txt:140
msgid ""
" --show-control-chars\n"
" show nongraphic characters as-is (the default, unless program "
"is\n"
" 'ls' and output is a terminal)"
msgstr ""
#: ls.1.txt:143
msgid ""
" -Q, --quote-name\n"
" enclose entry names in double quotes"
msgstr ""
#: ls.1.txt:147
msgid ""
" --quoting-style=WORD\n"
" use quoting style WORD for entry names: literal, locale, "
"shell,\n"
" shell-always, shell-escape, shell-escape-always, c, escape"
msgstr ""
#: ls.1.txt:150
msgid ""
" -r, --reverse\n"
" reverse order while sorting"
msgstr ""
#: ls.1.txt:153
msgid ""
" -R, --recursive\n"
" list subdirectories recursively"
msgstr ""
#: ls.1.txt:156
msgid ""
" -s, --size\n"
" print the allocated size of each file, in blocks"
msgstr ""
#: ls.1.txt:158
msgid " -S sort by file size, largest first"
msgstr ""
#: ls.1.txt:162
msgid ""
" --sort=WORD\n"
" sort by WORD instead of name: none (-U), size (-S), time "
"(-t),\n"
" version (-v), extension (-X)"
msgstr ""
#: ls.1.txt:167
msgid ""
" --time=WORD\n"
" with -l, show time as WORD instead of default modification "
"time:\n"
" atime or access or use (-u); ctime or status (-c); also "
"use\n"
" specified time as sort key if --sort=time (newest first)"
msgstr ""
#: ls.1.txt:175
msgid ""
" --time-style=STYLE\n"
" with -l, show times using style STYLE: full-iso, long-iso, "
"iso,\n"
" locale, or +FORMAT; FORMAT is interpreted like in 'date'; "
"if\n"
" FORMAT is FORMAT1<newline>FORMAT2, then FORMAT1 applies "
"to\n"
" non-recent files and FORMAT2 to recent files; if STYLE is "
"pre‐\n"
" fixed with 'posix-', STYLE takes effect only outside the "
"POSIX\n"
" locale"
msgstr ""
#: ls.1.txt:177
msgid " -t sort by modification time, newest first"
msgstr ""
#: ls.1.txt:180
msgid ""
" -T, --tabsize=COLS\n"
" assume tab stops at each COLS instead of 8"
msgstr ""
#: ls.1.txt:184
msgid ""
" -u with -lt: sort by, and show, access time; with -l: show "
"access\n"
" time and sort by name; otherwise: sort by access time, "
"newest\n"
" first"
msgstr ""
#: ls.1.txt:186
msgid " -U do not sort; list entries in directory order"
msgstr ""
#: ls.1.txt:188
msgid " -v natural sort of (version) numbers within text"
msgstr ""
#: ls.1.txt:191
msgid ""
" -w, --width=COLS\n"
" set output width to COLS. 0 means no limit"
msgstr ""
#: ls.1.txt:193
msgid " -x list entries by lines instead of by columns"
msgstr ""
#: ls.1.txt:195
msgid " -X sort alphabetically by entry extension"
msgstr ""
#: ls.1.txt:198
msgid ""
" -Z, --context\n"
" print any security context of each file"
msgstr ""
#: ls.1.txt:200
msgid ""
" -1 list one file per line. Avoid '\\n"
"' with -q or -b"
msgstr ""
#: ls.1.txt:202
msgid " --help display this help and exit"
msgstr ""
#: ls.1.txt:205
msgid ""
" --version\n"
" output version information and exit"
msgstr ""
#: ls.1.txt:209
msgid ""
" The SIZE argument is an integer and optional unit (example: 10K "
"is\n"
" 10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or "
"KB,MB,...\n"
" (powers of 1000)."
msgstr ""
#: ls.1.txt:214
msgid ""
" Using color to distinguish file types is disabled both by default "
"and\n"
" with --color=never. With --color=auto, ls emits color codes only "
"when\n"
" standard output is connected to a terminal. The LS_COLORS "
"environment\n"
" variable can change the settings. Use the dircolors command to set "
"it."
msgstr ""
#: ls.1.txt:217
msgid ""
" Exit status:\n"
" 0 if OK,"
msgstr ""
#: ls.1.txt:219
msgid " 1 if minor problems (e.g., cannot access subdirectory),"
msgstr ""
#: ls.1.txt:221
msgid ""
" 2 if serious trouble (e.g., cannot access command-line argument)."
msgstr ""
#: ls.1.txt:224
msgid ""
"AUTHOR\n"
" Written by Richard M. Stallman and David MacKenzie."
msgstr ""
#: ls.1.txt:228
msgid ""
"REPORTING BUGS\n"
" GNU coreutils online help: <http://www.gnu.org/software/coreutils/>\n"
" Report ls translation bugs to <http://translationproject.org/team/>"
msgstr ""
#: ls.1.txt:234
msgid ""
"COPYRIGHT\n"
" Copyright © 2017 Free Software Foundation, Inc. License GPLv3+: "
"GNU\n"
" GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n"
" This is free software: you are free to change and redistribute "
"it.\n"
" There is NO WARRANTY, to the extent permitted by law."
msgstr ""
#: ls.1.txt:238
msgid ""
"SEE ALSO\n"
" Full documentation at: <http://www.gnu.org/software/coreutils/ls>\n"
" or available locally via: info '(coreutils) ls invocation'"
msgstr ""
#: ls.1.txt:242
msgid ""
"GNU coreutils 8.28 October 2017 "
"LS(1)"
msgstr ""
#. extracted from acheck_1_txt
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-22 19:07+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Translate Toolkit 2.2.5\n"
#: acheck_1_txt:2
msgid ""
"ACHECK.1(1) User Contributed Perl Documentation "
"ACHECK.1(1)"
msgstr ""
#: acheck_1_txt:7
msgid ""
"NAME\n"
" acheck - Check common localization mistakes"
msgstr ""
#: acheck_1_txt:10
msgid ""
"SYNOPSIS\n"
" acheck [OPTIONS] [INPUT_FILE]"
msgstr ""
#: acheck_1_txt:16
msgid ""
"DESCRIPTION\n"
" This program parses a file checking for syntax rules and optionally\n"
" asking Aspell for checking word spelling. It makes fix suggestions "
"and\n"
" outputs a corrected file accordingly adding review comments if\n"
" requested."
msgstr ""
#: acheck_1_txt:19
msgid ""
" It tries to find the file type according to the extension or the "
"first\n"
" lines and loads rules accordingly."
msgstr ""
#: acheck_1_txt:21
msgid " It displays lines when they are parse."
msgstr ""
#: acheck_1_txt:28
msgid ""
" When an error is found, a menu is displayed. Just press Enter if you\n"
" don't want to change anything. If a choice suits you, enter the\n"
" corresponding number. If you want to fix it but no choice is correct,"
"\n"
" enter a space, then you will be asked for a string to replace the\n"
" highlighted text. The script will replace the highlighted text with\n"
" your choice and parse it again for new errors."
msgstr ""
#: acheck_1_txt:30
msgid " Here are all the available commands:"
msgstr ""
#: acheck_1_txt:33
msgid ""
" Enter, ignore.\n"
" Ignore."
msgstr ""
#: acheck_1_txt:36
msgid ""
" Ctrl+L, redraw.\n"
" Rewrite the last line, suggestions and hints."
msgstr ""
#: acheck_1_txt:39
msgid ""
" Space, edit.\n"
" Edit the highlighted text."
msgstr ""
#: acheck_1_txt:42
msgid ""
" E, edit line.\n"
" Edit the whole line."
msgstr ""
#: acheck_1_txt:47
msgid ""
" H, add hint.\n"
" Add the displayed hint as review comment. Use this if you want "
"the\n"
" translator to see the corresponding warning or error but you "
"have\n"
" no correction."
msgstr ""
#: acheck_1_txt:50
msgid ""
" N, next line.\n"
" Skip the rest of this line."
msgstr ""
#: acheck_1_txt:55
msgid ""
" X, exit and discard all changes.\n"
" Quit without saving modifications, the script ask you for\n"
" confirmation, you have to enter `yes' to exit otherwise parsing\n"
" starts again at the current mistake."
msgstr ""
#: acheck_1_txt:59
msgid ""
" a, add in dictionary.\n"
" Add the highlighted word to you personal dictionary, capitalized "
"as\n"
" it is."
msgstr ""
#: acheck_1_txt:63
msgid ""
" l, add lowercase in dictionary.\n"
" Lowercase the highlighted word to add it to your personal\n"
" dictionary."
msgstr ""
#: acheck_1_txt:66
msgid ""
" i, ignore word.\n"
" Ignore the highlighted word, same as Enter."
msgstr ""
#: acheck_1_txt:69
msgid ""
" I, ignore all.\n"
" Ignore the highlighted word and add it to your session dictionary."
msgstr ""
#: acheck_1_txt:72
msgid ""
"OPTIONS\n"
" Verbosity level:"
msgstr ""
#: acheck_1_txt:75
msgid ""
" -q, --quiet\n"
" quiet mode."
msgstr ""
#: acheck_1_txt:78
msgid ""
" -v verbose, start at level $Debug + 1, add more for more verbosity\n"
" (see below)."
msgstr ""
#: acheck_1_txt:81
msgid ""
" --verbose n\n"
" set verbosity level to n (see below)."
msgstr ""
#: acheck_1_txt:83
msgid " Files:"
msgstr ""
#: acheck_1_txt:86
msgid ""
" -i, --input\n"
" input filename, can be '-' to read data from standard input."
msgstr ""
#: acheck_1_txt:91
msgid ""
" -o, --output\n"
" output filename, can be '-' to write data to standard output. If "
"no\n"
" output filename is provided, input file is backed up with "
"`bak_ext'\n"
" extension and input filename is used."
msgstr ""
#: acheck_1_txt:93
msgid " Spell check:"
msgstr ""
#: acheck_1_txt:96
msgid ""
" -s, --spell\n"
" check spelling with Aspell."
msgstr ""
#: acheck_1_txt:99
msgid ""
" -d language, --dict language\n"
" use language dictionary for Aspell."
msgstr ""
#: acheck_1_txt:102
msgid ""
" -n, --nospell\n"
" don't check spelling."
msgstr ""
#: acheck_1_txt:104
msgid " Mode:"
msgstr ""
#: acheck_1_txt:108
msgid ""
" -r, --review\n"
" review mode, add comments on lines beginning with $Comment after\n"
" parsed line."
msgstr ""
#: acheck_1_txt:111
msgid ""
" -t, --trans\n"
" translator mode, don't add comments, just fix errors."
msgstr ""
#: acheck_1_txt:113
msgid " others:"
msgstr ""
#: acheck_1_txt:116
msgid ""
" --rules ruleset\n"
" use ruleset rules set."
msgstr ""
#: acheck_1_txt:119
msgid ""
" --type filetype\n"
" use filetype whatever the file type is."
msgstr ""
#: acheck_1_txt:122
msgid ""
" --dump\n"
" Dump the rules to check and exit, use this for debugging purposes."
msgstr ""
#: acheck_1_txt:125
msgid ""
" -V, --version\n"
" print version and exit."
msgstr ""
#: acheck_1_txt:128
msgid ""
" -h, --help\n"
" print a short usage message and exit."
msgstr ""
#: acheck_1_txt:132
msgid ""
" Verbosity Level\n"
" 0 quiet, normal\n"
" only warnings and errors"
msgstr ""
#: acheck_1_txt:135
msgid ""
" 1 debug\n"
" names of subroutines"
msgstr ""
#: acheck_1_txt:138
msgid ""
" 2 debug verbose\n"
" names and arguments of subroutines"
msgstr ""
#: acheck_1_txt:141
msgid ""
" 3 .. 5 debug very verbose\n"
" output parsing and checking details"
msgstr ""
#: acheck_1_txt:144
msgid ""
"SEE ALSO\n"
" acheck(5), acheck-rules(5)"
msgstr ""
#: acheck_1_txt:147
msgid ""
"AUTHOR\n"
" Nicolas Bertolissio <bertol@debian.org>"
msgstr ""
#: acheck_1_txt:151
msgid ""
"perl v5.24.1 2017-01-03 "
"ACHECK.1(1)"
msgstr ""
#
# $ apt show acheck
# Package: acheck
# Version: 0.5.5
#
# $ cp /usr/share/man/man1/acheck.1.gz /home/user/
#
# $ gzip -d acheck.1.gz
#
# $ roff2text -i acheck.1 -o acheck_1_txt
# troff: bad output page list
# ACHECK.1(1) User Contributed Perl Documentation ACHECK.1(1)
# ..................
# perl v5.24.1 2017-01-03 ACHECK.1(1)
#
# $ txt2po -i acheck_1_txt -o acheck_1.ro
# processing 1 files...
# [###########################################] 100%
#
#
Reply to: