TÊN

debconf-gettextize — trích ra tập tin PO bản dịch của mẫu debconf


TÓM TẮT

debconf-gettextize [-v] [-h] [--podir=THƯ_MỤC] [--choices] [--merge] chủ [chủ ...]


MÔ TẢ

Các tập tin /var/lib/dpkg/info/*.templates được debconf đọc thì chứa cả văn bản tiếng Anh lẫn bản dịch đều trong cùng tập tin. Tuy nhiên, trong gói mã nguồn các bản dịch được quản lý trong tập tin riêng để giúp người dịch. Trong bản thực hiện đầu tiên, một tập tin templates chủ chỉ chứa văn bản tiếng Anh, còn tập tin templates.xx chứa các chuỗi cả hai gốc và được dịch cho ngôn ngữ xx. Chương trình debconf-mergetemplate đã trộn các tập tin mẫu chủ và được dịch.

Bản thực hiện mới với po-debconf dựa vào gettext. Nhà duy trì đánh dấu mỗi trường có thể dịch được bằng cách thêm dấu gạch dưới vào trước; các chuỗi tiếng Anh được trích tự động ra một tập tin POT; người dịch làm việc với tập tin PO chuẩn; và po2debconf tạo ra một tập tin mẫu đã trộn có cùng cấu trúc.

Chương trình debconf-gettextize đã được thiết kế ban đầu để giúp nâng cấp lên bản thức hiện mới.

Nó đọc một danh sách các tập tin chủ và các bản dịch tương ứng, rồi tạo ra các tập tin po/*.po cho mỗi ngôn ngữ sang đó chuỗi đã được dịch.

Each input file receives an .old suffix, and a new master file overwrites the old one; it is identical to the previous master file except that an underscore is prepended to translatable fields. Developers can then choose which fields translators have to work on and which ones are skipped because their values are not locale-dependent.

Tập tin po/POTFILES.in cũng được tạo. Nó chứa danh sách các tập tin templates nên được debconf-updatepo xử lý.

Typically the debconf-gettextize program must be run only once when transforming from the first implementation to the po-debconf format, but it can also be used afterwards to transform a _Choices field into __Choices (or vice-versa) without losing translations, when using the --merge flag (alongside with --choices or not). The desired template containing the _Choices or __Choices fields to modify has to be copied into a temporary template file, which is passed to debconf-gettextize as an argument. Then the following steps are performed:

  1. po2debconf được chạy trên tập tin mẫu này để tạo ra một tập tin mẫu đã dịch.

  2. Tập tin mẫu đã dịch thì được xử lý như nói trên, và các tập tin PO được tạo ra.

  3. Tập tin PO mới tạo được trộn với tập tin PO đã tồn tại.

Trộn các tập tin PO thì mỗi trường kiểu _Choices phải bị thay thế bằng kiểu__Choices (hay ngược lại) trong tập tin mẫu gốc trước khi chạy debconf-updatepo, không thì các bản dịch mới bị đánh dấu « dịch mờ ».


TÙY CHỌN

-h, --help

Display a usage summary for the program and exit.

-v, --verbose

Xử lý ở chế độ chi tiết (xuất nhiều dữ liệu diễn tả tiến trình, hữu ích để gỡ lỗi).

--podir=THƯ_MỤC

Set directory for PO files. Default is to search for PO files in the po subdirectory below the location of the first master file.

--choices

Mặc định là debconf-gettextize thay thế các trường kiểu Choices bằng kiểu _Choices. Bật cờ này thì ghi trường kiểu __Choices thay vào đó.

--merge

When this flag is set, the strings are merged with existing PO files. The templates files and po/POTFILES.in are not modified.


CẨN THẬN

The Default field is special when template type is Select or Multiselect, because a value has to be chosen amongst the English list of choices, even for localized values. Normally this field must not be changed, but in rare circumstances localized values are meaningful (e.g. to choose the default language of an application). In order to let translators know that this localized Default field is special, you must by convention call it _DefaultChoice instead of _Default.


XEM CŨNG

debconf-updatepo(1), po2debconf(1), debconf-devel(7), po-debconf(7).


TÁC GIẢ

  Denis Barbier <barbier@linuxfr.org>
  Martin Quinson <martin.quinson@ens-lyon.fr>