Explorar el Código

patch lfs-xsl for Chinese

Xℹ Ruoyao hace 3 años
padre
commit
0485246766
Se han modificado 3 ficheros con 51 adiciones y 1 borrados
  1. 11 1
      Makefile
  2. 10 0
      zh_CN/patches/Makefile.patch
  3. 30 0
      zh_CN/patches/stylesheets/lfs-xsl/lfs-l10n.xml.patch

+ 11 - 1
Makefile

@@ -18,16 +18,26 @@ KEEP_FILES = $(filter-out $(MXML_FILES), KEEP_FILES)
 
 MBOOK_FILES = $(patsubst %, $(MLANG)/book/%, $(BOOK_FILES))
 
-booksrc: $(MBOOK_FILES)
+booksrc: $(MBOOK_FILES) $(PATCHES)
 
 $(MLANG)/book/%.xml: $(LFS_EN)/%.xml $(MLANG)/%.po
 	mkdir -pv "$(@D)"
 	po4a-translate -f docbook -m $< -p $(filter-out $<, $^) -l $@
 	[ -e $@ ] || cp -v $< $@
+	relpath=$$(echo $@ | sed 's@$(MLANG)/book/@@'); \
+	patch_path=$(MLANG)/patches/$${relpath}.patch; \
+	if [ -e $${patch_path} ]; then \
+		pushd $(MLANG)/book; patch -Np1 -i ../patches/$${relpath}.patch; popd; \
+	fi
 
 $(MLANG)/book/%: $(LFS_EN)/%
 	mkdir -pv "$(@D)"
 	cp -v $< $@
+	relpath=$$(echo $@ | sed 's@$(MLANG)/book/@@'); \
+	patch_path=$(MLANG)/patches/$${relpath}.patch; \
+	if [ -e $${patch_path} ]; then \
+		pushd $(MLANG)/book; patch -Np1 -i ../patches/$${relpath}.patch; popd; \
+	fi
 
 test:
 	echo $(XML_FILES)

+ 10 - 0
zh_CN/patches/Makefile.patch

@@ -0,0 +1,10 @@
+diff -uNr book/Makefile book.new/Makefile
+--- book/Makefile	2020-06-17 14:58:22.430567779 +0800
++++ book.new/Makefile	2020-06-17 16:13:58.927092133 +0800
+@@ -40,6 +40,7 @@
+       --stringparam chunk.quietly $(CHUNK_QUIET) \
+       --stringparam rootid "$(ROOT_ID)"          \
+       --stringparam base.dir $(BASEDIR)/         \
++      --stringparam l10n.gentext.default.language "zh_cn"         \
+       stylesheets/lfs-chunked.xsl                \
+       $(RENDERTMP)/lfs-html.xml

+ 30 - 0
zh_CN/patches/stylesheets/lfs-xsl/lfs-l10n.xml.patch

@@ -0,0 +1,30 @@
+diff -uNr book/stylesheets/lfs-xsl/lfs-l10n.xml book.new/stylesheets/lfs-xsl/lfs-l10n.xml
+--- book/stylesheets/lfs-xsl/lfs-l10n.xml	2020-06-17 14:58:37.499744806 +0800
++++ book.new/stylesheets/lfs-xsl/lfs-l10n.xml	2020-06-17 16:10:48.233397825 +0800
+@@ -111,4 +111,26 @@
+ 
+   </l:l10n>
+ 
++  <!-- Simplified Chinese -->
++<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
++          language="zh_cn" english-language-name="Simplified Chinese">
++
++    <l:gentext key="description" text="描述"/>
++    <l:gentext key="Bootscripts" text="引导脚本"/>
++    <l:gentext key="Configuration Files" text="配置文件"/>
++    <l:gentext key="Kernel Configuration" text="内核配置"/>
++    <l:gentext key="Libraries" text="库"/>
++    <l:gentext key="Others" text="其他"/>
++    <l:gentext key="Packages" text="软件包"/>
++    <l:gentext key="Programs" text="程序"/>
++    <l:gentext key="Scripts" text="脚本"/>
++
++    <l:context name="title-numbered">
++      <l:template name="part" text="第 %n 部分 %t"/>
++    </l:context>
++
++    <l:gentext key="Copyright" text="版权所有"/>
++
++  </l:l10n>
++
+ </l:i18n>