Re: Testing help files



Am Dienstag, den 02.03.2010, 15:28 +0100 schrieb Milo Casagrande: 
> Hi Aleksander,
> 
> 2010/3/2 Aleksander Łukasiewicz <aleksander lukasiewicz net>:
> >
> > Seems to work this way, but I would like to convert multiple files (there
> > are over 40 .page files in the empathy help folder). Is there a way to do
> > it?
> 
> When I need to test translations I use a small hand-made script that
> for every .page file in C, it creates the corresponding translated
> .page file.
> Unfortunately I don't have the script here with me at the office, but
> it goes in something like this:
> 
> for i in `ls PATH_TO_FILES` do
> xml2po -p TRANSLATION_FILE.po PATH_TO_FILES/$i > PATH_TO_LOCALIZED_DIR/$i
> done
> 
> (plus some tests to check if it's a file or not)
> 
> > Additionally, I cannot open the .page file with yelp. "yelp index.page"
> > doesn't open the file. How can I open the .page files with yelp?
> 
> You don't have to provide Yelp with the file name, just do, if you are in
> the C directory:
> yelp ./
> 
> or:
> yelp `pwd`/
> 
> I just have to provide Yelp with the path to the directory containing
> the index.page.
> 
> (probably these instructions should be written down under the
> DocumentationProject on l.g.o...)
> 
> Hope it might help.

Due to that xml2po doesn't accept the -e switch yet, the German
translator Christian Kirbach has tweaked the Makefile I've got from
Shaun some weeks ago. The file is attached. You have simple to put it in
the folder with the *.po file (help/your_language_code), assuming the
original *.page files reside in ../C/. Running "make" looks for the
*.page files in the C folder, converts them using the *.po file and runs
a xslt based conversion script to get valid HTML files. Then you can
view these HTML's with the browser of your choice.

Cheers,
Mario


original_pages=$(wildcard ../C/*.page)
pages=$(patsubst ../C/%,%,$(original_pages))
htmls=$(patsubst %.page,%.html,$(pages))

po=$(wildcard *.po)

all: $(pages) $(htmls) index.cache

index.cache : $(pages)
	echo '<cache xmlns="http://projectmallard.org/1.0/";>' > $  in
	for page in $(pages); do \
	  echo "<page href='$$page'/>" >> $  in; \
	done
	echo '</cache>' >> $  in
	xsltproc `pkg-config --variable xsltdir gnome-doc-utils`/mallard/utils/mal2cache.xsl $  in | xmllint --format - > $@
	rm $  in

$(pages) : $(po)
	for o in $(pages); do \
	  echo xml2po -p $(po) -o $${o} ../C/$${o}; \
	  xml2po -p $(po) -o $${o} ../C/$${o}; \
	done

$(htmls) : index.cache
$(htmls) : %.html : %.page
	xsltproc \
	  --stringparam mal.cache.file `pwd`/index.cache \
	  --param mal.chunk.chunk_top 1 \
	  `pkg-config --variable mal2html gnome-doc-utils` $<

.PHONY: clean
clean:
	rm -f index.cache *.html *.page


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]