Al terminar la traducción puedes comprobar que el fichero "compila" usando los siguientes comandos:
msgfmt --statistics <paquete>.es.po.dis |
msgfmt -vv <fichero po> |
msgfmt -c -v -o /dev/null file.po |
msgmerge es.po paquete.pot > es.new.po |
Estos comando están incluidos en el paquete: gettext
Uso de popsell para la revisión ortográfica:
popsell -n es.po -p ispell -- -d spanish -T latin1 %f |
Para cambiar de codificación sgml a iso8859_1 existe la utilidad
recode -d iso-8859-1..ht4 fichero.sgml convierte todo, pero mete algunas secuencias de clavo recode -d ht4..iso-8859-1 fichero.sgml No me funciona |
Para que emacs reconozca ficheros de este tipo debes poner en .emacs
(setq auto-mode-alist
(cons '("\\.po[tx]?\\'\\|\\.po\\." . po-mode) auto-mode-alist))
(autoload 'po-mode "po-mode")
(autoload 'po-find-file-coding-system "po-mode")
(modify-coding-system-alist 'file "\\.po[tx]?\\'\\|\\.po\\."
'po-find-file-coding-system)
|
Modificaciones para revisar la ortografía al terminar la traducción de cada mensaje de forma automática. Para ello activaremos la función 'ke-po-ispell-buffer' M-x ke-po-toggle-ispell
fichero po-mode.el
@@ -1785,6 +1757,7 @@
(skip-chars-backward " \t\n")
(if (eq (preceding-char) ?<)
(delete-region (1- (point)) (point-max)))
+ (run-hooks 'po-subedit-exit-hook)
(let ((string (buffer-string)))
(po-subedit-abort)
(po-find-span-of-entry) |
fichero .emacs
(setq ispell-dictionary "american")
;; (set-default 'ispell-local-dictionary "american")
(defvar ke-po-dictionary "german-latin1"
"*Dictionary to use for spell checking `msgstr' entries.
For available dictionaries see `ispell-dictionary-alist'.")
(defvar ke-po-ispell-buffer nil
"*non-nil enable spell checking before exit subedit.")
(defun ke-po-toggle-ispell ()
"Toggle ispell."
(interactive)
(setq ke-po-ispell-buffer (not ke-po-ispell-buffer)))
(defun ke-ispell-buffer ()
(let ((ispell-local-dictionary ke-po-dictionary))
(if ke-po-ispell-buffer
(ispell-buffer))))
(add-hook 'po-subedit-exit-hook 'ke-ispell-buffer) |
Modificaciones para revisar un fichero po de un punto hasta el final.
(defun ke-po-ispell-msgstr (dict)
"`ispell' a `msgstr' entry."
(interactive "*")
(let ((start) (end)
(ispell-local-dictionary dict))
(setq end (re-search-forward po-any-msgstr-regexp))
(ispell-region (+ (match-beginning 0)
(length "msgstr"))
end)))
(defun ke-po-do-ispell ()
"`ispell' a PO file from point to the end of the buffer."
(interactive "*")
(while (not (eobp))
(ke-po-ispell-msgstr ke-po-dictionary))) |
Añadir rn rl fichero .vimrc
augroup PO-MODE autocmd! autocmd BufRead *.po map ^[n /msgstr "<CR>z.f"l autocmd BufRead *.po map ^[p k?msgstr "<CR>z.f"l autocmd BufRead *.po map ^[u /msgstr ""<CR>z.$ autocmd BufRead *.po map ^[f /#, fuzzy<CR>^[n autocmd BufRead *.po map ^[r ?#, fuzzy<CR>dd^[n autocmd BufRead *.po map ^[z ?#:<CR>o#, fuzzy^[^[n autocmd BufRead *.po map ^[c ?msgid<CR>f"lv^[nk$hhy^[nP autocmd BufRead *.po map ^[i :w<CR>:!pocheck %<CR>:e %<CR> autocmd BufRead *.po map ^[e /<<<<<<CR>zt autocmd BufRead *.po map ^[d ^[p^[eV/=====<CR>d/>>>>><CR>dd augroup END |
A todas las funciones se accede pulsando Alt+key: n-siguiente mensaje, p-previo, u-siguiente no traducido, f-siguiente fuzzy, r-quita la marca fuzzy, z-marca como fuzzy, c-copia el original (para derechos de autor y otros textos no traducibles), i-comprueba con pocheck, e-busca siguiente conflicto, d-borra trozo antiguo de conflicto. Por supuesto cada ^[ debe reemplazarse por el carácter de escape actual, esto es, ctrl+v <esc>.