From 00e0b5b64c4dd3e8d038cc8fbdcd31314039422a Mon Sep 17 00:00:00 2001 From: Dmitry Azhichakov Date: Fri, 16 Jul 2010 12:55:32 +0400 Subject: [PATCH] Assignment of "preface" and "appendix" templates to chapters in Russian translation is fixed. The regression of the change is that older versions of AsciiDoc are not directly supported now, manual intervention in lang-$(LANG).conf is required for that. --- Makefile | 7 ++----- conf | 2 -- lang-en.conf | 0 lang-ru.conf | 4 ++++ ru/drawbacks.txt | 2 +- ru/translate.txt | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 conf create mode 100644 lang-en.conf create mode 100644 lang-ru.conf diff --git a/Makefile b/Makefile index 3fade508..9b0a080a 100644 --- a/Makefile +++ b/Makefile @@ -18,13 +18,10 @@ book.xml: $(addprefix $(LANG)/,$(TXTFILES)) # then substitute the English version. # Kludge to make preface sections work for languages besides English # for older AsciiDoc versions. - if [[ `asciidoc --version | cut -f 2 -d ' '` < "8.4.5" ]]; then \ - echo '[specialsections]' > conf ; \ - sed -n '/^== .* ==$$/p' $(LANG)/preface.txt | sed 's/^== \(.*\) ==$$/^\1$$=sect-preface/' >> conf ; \ - else echo "" > conf ; fi; \ + CONF=lang-$(LANG).conf; [ -f $$CONF ] || CONF=lang-en.conf; \ ( for FILE in $^ ; do if [ -f $$FILE ]; then cat $$FILE; else \ cat en/$$(basename $$FILE); fi; echo ; done ) | \ - asciidoc -a lang=$(LANG) -d book -b docbook -f conf - > $@ + asciidoc -a lang=$(LANG) -d book -b docbook -f $$CONF - > $@ # This rule allows unfinished translations to build. # Report an error if the English version of the text file is missing. diff --git a/conf b/conf deleted file mode 100644 index e82a0a0e..00000000 --- a/conf +++ /dev/null @@ -1,2 +0,0 @@ -[specialsections] -^Предисловие $=sect-preface diff --git a/lang-en.conf b/lang-en.conf new file mode 100644 index 00000000..e69de29b diff --git a/lang-ru.conf b/lang-ru.conf new file mode 100644 index 00000000..f04d17a7 --- /dev/null +++ b/lang-ru.conf @@ -0,0 +1,4 @@ +[specialsections] +^От редактора перевода$=preface +^Предисловие$=preface +^Введение.*$=sect1 diff --git a/ru/drawbacks.txt b/ru/drawbacks.txt index a90a08b8..992c07bd 100644 --- a/ru/drawbacks.txt +++ b/ru/drawbacks.txt @@ -1,4 +1,4 @@ -== Приложение А: Недостатки Git == +== Приложение A: Недостатки Git == Есть некоторые проблемы Git, которые я спрятал под сукно. Некоторые из них можно легко решить с помощью скриптов и хуков, некоторые требуют реорганизации или пересмотра проекта, а несколько оставшихся неприятностей придется потерпеть. А еще лучше — взяться за них и решить! diff --git a/ru/translate.txt b/ru/translate.txt index f9f7da25..c5b09168 100644 --- a/ru/translate.txt +++ b/ru/translate.txt @@ -1,4 +1,4 @@ -== Приложение Б: Перевод этого руководства == +== Приложение B: Перевод этого руководства == Клонируйте исходные тексты, затем создайте каталог, отвечающий http://www.iana.org/assignments/language-subtag-registry[тегу IETF] целевого языка: см. http://www.w3.org/International/articles/language-tags/Overview.en.php[статью W3C по интернационализации]. К примеру, английский язык это «en», японский — «ja», традиционный китайский — «zh-Hant». Скопируйте в каталог файлы +txt+ из "en" каталога и переведите их.