#------------------------------------------------------
# Set this variable in according with your language

# Used for folder name and source .po file name.
KDE_LANG = de
# Used for to change the current Language in the target handbook.
LANGUAGE_NAME = German

#------------------------------------------------------

KDE_DOCS = digikam
DOCDIR = $(DESTDIR)${kde_htmldir}
EXTRA_DIST = index.docbook addcamera.png cameraclient.png imageviewer.png mainwindow.png setupalbum.png

docbook_DATA = index.docbook
docbookdir = $(kde_htmldir)/$(KDE_LANG)/digikam
noinst_HEADERS = index_$(KDE_LANG).po


index_$(KDE_LANG).po: ../en/index_en.pot
	msgmerge -o index_$(KDE_LANG).po $(srcdir)/index_$(KDE_LANG).po ../en/index_en.pot

index.docbook: ../en/index.docbook ../en/index_en.pot index_$(KDE_LANG).po
	${MAKE} index_$(KDE_LANG).po ../en/index-shifted.docbook
	@echo "converting $(LANGUAGE_NAME) help"
	@echo "(this takes very very long, please be patient...)"
	po2xml ../en/index-shifted.docbook index_$(KDE_LANG).po | \
	sed s/^\<\!ENTITY\ %\ English\ /\<\!ENTITY\ %\ $(LANGUAGE_NAME)\ /g > $@

# --- Translated html help, not needed in distribution. Just for the Web site ---

index.html: index.docbook
	cd ../en;${MAKE} index.html;cd ../$(KDE_LANG)
	@MEINPROC@ --check index.docbook
	mkdir -p ../html
	mkdir -p ../html/$(KDE_LANG)
	mv *.html ../html/$(KDE_LANG)/
	cp -R *.png ../html/$(KDE_LANG)/
	rm -Rf ./common
	mkdir -p ../html/$(KDE_LANG)/common
	cp -R ${DOCDIR}/$(KDE_LANG)/common/* ../html/$(KDE_LANG)/common
	for file in ../html/$(KDE_LANG)/*.html; do { \
		echo $$file; \
		cat $$file | sed s+help:/common+./common+g > $$file.new; \
		mv $$file.new $$file; \
	} done
