1
0

fix.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. # fix some English and ASCII specific stuff which can not be handled by po4a
  3. # This should be handled by po4a, but if some pages are not done yet
  4. # we will need to do it manually.
  5. sed -e '/encoding=/s|ISO-8859-1|UTF-8|' -i $(find -name \*.xml)
  6. # Let tidy output UTF-8
  7. sed -e '/output-encoding:/s|latin1|utf8|' -i tidy.conf
  8. # Remove two seds causing encoding error in UTF-8
  9. sed -e '/xa9/d' -i Makefile
  10. sed -e 's|<book>|<book lang="zh_cn">|' -i index.xml
  11. sed -e '/xreflabel/s|Chapter.nbsp.1 - Mailing Lists|第 1 章 - 邮件列表|' \
  12. -e '/xreflabel/s|Chapter.nbsp.1 - Mirror sites|第 1 章 - 镜像站|' \
  13. -i chapter01/resources.xml
  14. sed -e '/xreflabel/s|Chapter.nbsp.\([0-9]\+\)|第 \1 章|' \
  15. -i chapter*/chapter*.xml
  16. sed -e '/xreflabel/s|Host System Requirements|宿主系统需求|' \
  17. -i chapter02/hostreqs.xml
  18. sed -e '/xreflabel/s|General Compilation Instructions|通用编译说明|' \
  19. -i part3intro/generalinstructions.xml
  20. sed -e '/xreflabel/s|Toolchain Technical Notes|工具链技术说明|' \
  21. -i part3intro/toolchaintechnotes.xml
  22. sed -e '/xreflabel/s|Package build instructions|软件包构建说明|' \
  23. -i part3intro/generalinstructions.xml
  24. sed -e '/xreflabel/s|"gcc-pass1"|"第一遍的 GCC"|' \
  25. -i chapter05/gcc-pass1.xml
  26. sed -e '/xreflabel/s|Appendix|附录|' -i \
  27. appendices/acknowledgments.xml \
  28. appendices/acronymlist.xml \
  29. appendices/dependencies.xml \
  30. appendices/license.xml \
  31. appendices/scripts.xml \
  32. appendices/udev-rules.xml
  33. # Apply lfs-l10n.xml patch, if it's not applied
  34. grep "Simplified Chinese" stylesheets/lfs-xsl/lfs-l10n.xml ||
  35. patch -N -p1 -i ../patches/lfs-l10n.xml.patch