Ver código fonte

add fixup script for xreflabels

Xℹ Ruoyao 4 anos atrás
pai
commit
61f6852419
2 arquivos alterados com 30 adições e 1 exclusões
  1. 5 1
      Makefile
  2. 25 0
      zh_CN/fix.sh

+ 5 - 1
Makefile

@@ -23,7 +23,11 @@ KEEP_FILES = $(filter-out $(MXML_FILES), KEEP_FILES)
 
 MBOOK_FILES = $(patsubst %, $(MLANG)/book/%, $(BOOK_FILES))
 
-booksrc: $(MBOOK_FILES) $(PATCHES)
+.PHONY: booksrc
+booksrc: booksrc_unfixed
+	[ ! -e $(MLANG)/fix.sh ] || (pushd $(MLANG)/book; sh ../fix.sh; popd)
+
+booksrc_unfixed: $(MBOOK_FILES) $(PATCHES)
 
 $(MLANG)/book/%.xml: $(LFS_EN)/%.xml $(MLANG)/%.po
 	mkdir -pv "$(@D)"

+ 25 - 0
zh_CN/fix.sh

@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# fix English text in xreflabels which can not be handled by po4a
+
+# This should be handled by po4a, but if some pages are not done yet
+# we will need to do it manually.
+sed -e '/encoding=/s|ISO-8859-1|UTF-8|' -i $(find -name \*.xml)
+
+sed -e '/xreflabel/s|Chapter.nbsp.1 - Mailing Lists|第 1 章 - 邮件列表|' \
+	-e '/xreflabel/s|Chapter.nbsp.1 - Mirror sites|第 1 章 - 镜像站|'    \
+	-i chapter01/resources.xml
+
+sed -e '/xreflabel/s|Chapter.nbsp.\([0-9]\+\)|第 \1 章|' \
+	-i chapter*/chapter*.xml
+
+sed -e '/xreflabel/s|Host System Requirements|宿主系统需求|' \
+	-i chapter02/hostreqs.xml
+
+sed -e '/xreflabel/s|Appendix|附录|' -i \
+	appendices/acknowledgments.xml     \
+	appendices/acronymlist.xml          \
+	appendices/dependencies.xml         \
+	appendices/license.xml              \
+	appendices/scripts.xml              \
+	appendices/udev-rules.xml