The first step to creating a new translated document is
locating or creating a directory to hold it. FreeBSD puts
translated documents in a subdirectory named for their
language and region in the format
.
lang
_REGION
lang
is a two-character lowercase
code. It is followed by an underscore character and then the
two-character uppercase REGION
code.
語言 | 地區 | 翻譯目錄名稱 | PO 檔名稱 | 字元集 |
---|---|---|---|---|
英文 | 美國 | en_US.ISO8859-1 | en_US.po | ISO 8859-1 |
孟加拉文 | 孟加拉 | bn_BD.UTF-8 | bn_BD.po | UTF-8 |
丹麥文 | 丹麥 | da_DK.ISO8859-1 | da_DK.po | ISO 8859-1 |
德文 | 德國 | de_DE.ISO8859-1 | de_DE.po | ISO 8859-1 |
希臘文 | 希臘 | el_GR.ISO8859-7 | el_GR.po | ISO 8859-7 |
西班牙文 | 西班牙 | es_ES.ISO8859-1 | es_ES.po | ISO 8859-1 |
法文 | 法國 | fr_FR.ISO8859-1 | fr_FR.po | ISO 8859-1 |
匈牙利文 | 匈牙利 | hu_HU.ISO8859-2 | hu_HU.po | ISO 8859-2 |
義大利文 | 義大利 | it_IT.ISO8859-15 | it_IT.po | ISO 8859-15 |
日文 | 日本 | ja_JP.eucJP | ja_JP.po | EUC JP |
韓文 | 韓國 | ko_KR.UTF-8 | ko_KR.po | UTF-8 |
蒙古文 | 蒙古 | mn_MN.UTF-8 | mn_MN.po | UTF-8 |
荷蘭文 | 荷蘭 | nl_NL.ISO8859-1 | nl_NL.po | ISO 8859-1 |
挪威文 | 挪威 | no_NO.ISO8859-1 | no_NO.po | ISO 8859-1 |
波蘭文 | 波蘭 | pl_PL.ISO8859-2 | pl_PL.po | ISO 8859-2 |
葡萄牙文 | 巴西 | pt_BR.ISO8859-1 | pt_BR.po | ISO 8859-1 |
俄文 | 俄羅斯 | ru_RU.KOI8-R | ru_RU.po | KOI8-R |
賽爾維亞 | 賽爾維亞文 | sr_YU.ISO8859-2 | sr_YU.po | ISO 8859-2 |
土耳其文 | 土耳其 | tr_TR.ISO8859-9 | tr_TR.po | ISO 8859-9 |
中文 | 中國 | zh_CN.UTF-8 | zh_CN.po | UTF-8 |
中文 | 台灣 | zh_TW.UTF-8 | zh_TW.po | UTF-8 |
翻譯位於主要文件目錄的子目錄,這裡假設如 節 1.2, “快速上手” 所示,是 ~/doc/
。例如德文位於 ~/doc/de_DE.ISO8859-1/
, 法文位於 ~/doc/fr_FR.ISO8859-1/
。
每個語系目錄包含不同文件類型的子目錄,通常是 articles/
和 books/
。
將目錄名稱組合起來就是文章或書的完整路徑。例如,NanoBSD 文章的法語翻譯在 ~/doc/fr_FR.ISO8859-1/articles/nanobsd/
。而使用手冊的蒙古文翻譯在~/doc/mn_MN.UTF-8/books/handbook/
。
當翻譯到一個新語系時必須建立一個新的語系目錄。如果語系目錄已經存在,那只需要有 articles/
或 books/
的子目錄。
FreeBSD 文件的編譯是由同一個目錄的 Makefile
控制。簡單的文章可以從原始的英語目錄直接複製 Makefile
過來。書籍的翻譯流程結合多個獨立的 book.xml
和 chapter.xml
成為一個檔案, 所以書籍翻譯的 Makefile
必須複製並修改。
建立Porter 手冊的西班牙文翻譯。原文是位於 ~/doc/en_US.ISO8859-1/books/porters-handbook/
的書籍。
西班牙文 books 目錄 ~/doc/es_ES.ISO8859-1/books/
已經存在,所以只要建立 Porter 手冊的子目錄:
%
cd ~/doc/es_ES.ISO8859-1/books/
%
svn mkdir porters-handbook
A porters-handbook
從原始文件的目錄複製 Makefile
:
%
cd ~/doc/es_ES.ISO8859-1/books/porters-handbook
%
svn cp ~/doc/en_US.ISO8859-1/books/porters-handbook/Makefile .
A Makefile
修改 Makefile
內容以產生單一的 book.xml
:
# # $FreeBSD: release/11.0.0/zh_TW.UTF-8/books/fdp-primer/book.xml 48972 2016-06-21 01:19:43Z kevlo $ # # Build the FreeBSD Porter's Handbook。 # MAINTAINER=doc@FreeBSD.org DOC?= book FORMATS?= html-split INSTALL_COMPRESSED?= gz INSTALL_ONLY_COMPRESSED?= # XML content SRCS= book.xml # Images from the cross-document image library IMAGES_LIB+= callouts/1.png IMAGES_LIB+= callouts/2.png IMAGES_LIB+= callouts/3.png IMAGES_LIB+= callouts/4.png IMAGES_LIB+= callouts/5.png IMAGES_LIB+= callouts/6.png IMAGES_LIB+= callouts/7.png IMAGES_LIB+= callouts/8.png IMAGES_LIB+= callouts/9.png IMAGES_LIB+= callouts/10.png IMAGES_LIB+= callouts/11.png IMAGES_LIB+= callouts/12.png IMAGES_LIB+= callouts/13.png IMAGES_LIB+= callouts/14.png IMAGES_LIB+= callouts/15.png IMAGES_LIB+= callouts/16.png IMAGES_LIB+= callouts/17.png IMAGES_LIB+= callouts/18.png IMAGES_LIB+= callouts/19.png IMAGES_LIB+= callouts/20.png IMAGES_LIB+= callouts/21.png URL_RELPREFIX?= ../../../.. DOC_PREFIX?= ${.CURDIR}/../../.. .include "${DOC_PREFIX}/share/mk/doc.project.mk"
Now the document structure is ready for the translator
to begin translating with
make po
.
建立 PGP 金鑰文章的法文翻譯。原文是位於 ~/doc/en_US.ISO8859-1/articles/pgpkeys/
的文章。
法文 article 目錄 ~/doc/fr_FR.ISO8859-1/articles/
已經存在,所以只要建立 PGP 金鑰文章的子目錄:
%
cd ~/doc/fr_FR.ISO8859-1/articles/
%
svn mkdir pgpkeys
A pgpkeys
從原始文件的目錄複製 Makefile
:
%
cd ~/doc/fr_FR.ISO8859-1/articles/pgpkeys
%
svn cp ~/doc/en_US.ISO8859-1/articles/pgpkeys/Makefile .
A Makefile
檢查 Makefile
的內容。因為這是簡單的文章,此例的 Makefile
不用修改。第二行的 $FreeBSD...$
版本字串將會在檔案提交時被版本控制系統替換掉。
# # $FreeBSD: release/11.0.0/zh_TW.UTF-8/books/fdp-primer/book.xml 48972 2016-06-21 01:19:43Z kevlo $ # # Article:PGP Keys DOC?= article FORMATS?= html WITH_ARTICLE_TOC?= YES INSTALL_COMPRESSED?= gz INSTALL_ONLY_COMPRESSED?= SRCS= article.xml # To build with just key fingerprints, set FINGERPRINTS_ONLY。 URL_RELPREFIX?= ../../../.. DOC_PREFIX?= ${.CURDIR}/../../.. .include "${DOC_PREFIX}/share/mk/doc.project.mk"
文章結構處理好後, 可以執行建立 make po
建立 PO 檔。
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。