An Internationalized Software Project With Auto Tools | ||
---|---|---|
Prev | Internationalization of the Documentation | Next |
configure.ac |
... AC_CHECK_FILE([doc/docbook/htmlhelp/htmlhelp.xsl], , [AC_MSG_WARN([htmlhelp sytle sheet was not found. \ If you want to change and compile the documentation, please install docbook-xsl \ (http://docbook.sourceforge.net/) and create a symlink in doc]) ; can_build_documentation=no]) AC_PATH_PROG([po4a_gettextize],[po4a-gettextize]) AC_PATH_PROG([po4a_updatepo],[po4a-updatepo]) AC_PATH_PROG([po4a_translate],[po4a-translate]) if test -z "$po4a_gettextize" -o -z "$po4a_updatepo" -o -z "$po4a_translate" ; then AC_MSG_WARN([po4a was not found. If you want to change and compile the documentation, \ please install po4a (packages.debian.org/unstable/text/po4a)]) can_build_documentation=no fi AC_PATH_PROG([nsgmls],[nsgmls]) if test -z "$nsgmls" ; then AC_MSG_WARN([nsgmls was not found. If you want to change and compile the documentation, \ please install sp (www.jclark.com/sp/ or jade (www.jclark.com/jade/))]) can_build_documentation=no fi AC_MSG_CHECKING([whether documentation can be changed and compiled]) ... |
Makefile.am |
... force-update-doc: cd doc && $(MAKE) $(AM_MAKEFLAGS) force-update-doc force-update-docs: cd doc && $(MAKE) $(AM_MAKEFLAGS) force-update-docs force-update-docs-%: dummy cd doc && $(MAKE) $(AM_MAKEFLAGS) $@ dummy: .PHONY: check-gettext update-po update-gmo force-update-gmo force-update-doc .PHONY: force-update-docs dummy |
doc/Makefile.am |
SUBDIRS = @AMDEP_TRUE@@am__include@ @am__quote@generated_files.mk@am__quote@ |
# touch doc/Makefile.lang.am # touch doc/Makefile.pictures.am |
doc/Makefile.pictures.am |
pictures = apicture.png |
doc/Makefile.lang.am |
SUBDIRS = @AMDEP_TRUE@@am__include@ @am__quote@../generated_files.mk@am__quote@ include $(srcdir)/../Makefile.pictures.am source_tarball_files = doc-$(language).po $(PACKAGE).xml htmlhelpdir = $(helpdir)/$(language) htmlhelp_created_files = $(PACKAGE).hhc $(PACKAGE).hhk $(PACKAGE).hhp $(TESTPROJ_DOCFILES) htmlhelp_DATA = $(pictures) $(TESTPROJ_DOCFILES) EXTRA_DIST = $(source_tarball_files) $(pictures) $(htmlhelp_created_files) GMSGFMT = @GMSGFMT@ DISTCLEANFILES = Makefile MAINTAINERCLEANFILES = $(PACKAGE).xml |
doc/Makefile.lang.am |
... all: $(htmlhelp_created_files) force-update-docs: @if test -f $(srcdir)/doc-$(language).po ; then \ touch $(srcdir)/doc-$(language).po ; \ fi $(MAKE) all $(htmlhelp_created_files): $(PACKAGE).xml @cd .. ; $(MAKE) check_can_build_documentation $(MAKE) doc-clean $(xsltproc) $(srcdir)/../$(PACKAGE).xsl $(srcdir)/$(PACKAGE).xml $(PACKAGE).xml: doc-$(language).po @cd .. ; $(MAKE) check_can_build_documentation $(GMSGFMT) -c --statistics doc-$(language).po || exit 0 @rm -f messages.mo $(po4a_translate) -f sgml -m $(srcdir)/../$(PACKAGE).xml -p doc-$(language).po -l $(srcdir)/$(PACKAGE).xml -k 0 |
doc/Makefile.lang.am |
... doc-$(language).po: ../$(PACKAGE).pot @cd .. ; $(MAKE) check_can_build_documentation @if test -f "$@" ; then \ echo "$(po4a_updatepo) -f sgml -m $(srcdir)/../$(PACKAGE).xml -p $@" ; \ $(po4a_updatepo) -f sgml -m $(srcdir)/../$(PACKAGE).xml -p $@ ; \ else \ echo "Creating $@" ; \ cp $(srcdir)/../$(PACKAGE).pot $@ ; \ fi ../$(PACKAGE).pot: dummy cd .. ; $(MAKE) $(AM_MAKEFLAGS) $(PACKAGE).pot dummy: maintainer-clean: doc-clean maintainer-clean-recursive doc-clean: -rm -f *.hhp -rm -f *.html -rm -f *.hhk -rm -f *.hhc .PHONY: force-update-docs dummy doc-clean |
# mkdir doc/de # touch doc/de/Makefile.am # cp doc/*.png doc/de |
configure.ac |
... # Checks for library functions. AC_CONFIG_FILES([Makefile src/Makefile src/testmodule/Makefile po/Makefile.in m4/Makefile \ doc/Makefile doc/de/Makefile]) AC_OUTPUT |
doc/Makefile.am |
SUBDIRS = de ... |
doc/de/Makefile.am |
language = de include $(srcdir)/../Makefile.lang.am |
src/i18n.h |
... int strcntchar(const char * s, char c); const char * get_gettext_language(); const char * get_help_dir(); |
src/i18n.cpp |
#include "i18n.h" #include <string.h> #include <stdlib.h> #include <dirent.h> #include <limits.h> ... const char * get_gettext_language() { char * c; if (c = getenv("LANGUAGE")) return c; if (c = getenv("LC_ALL")) return c; if (c = getenv("LC_MESSAGES")) return c; return getenv("LC_LANG"); } char get_help_dir_result[NAME_MAX+1]; const char * get_help_dir() { char lang[NAME_MAX+1]; const char * helpdir = HELPDIR; const char * l = get_gettext_language(); if (!l) return helpdir; strcpy(lang, l); DIR * dir = NULL; for (int i = 0; i < 3; ++i) { strcpy(get_help_dir_result, helpdir); strcat(get_help_dir_result, "/"); strcat(get_help_dir_result, lang); dir = opendir(get_help_dir_result); if (dir) { struct dirent * dirEntry; while ((dirEntry = readdir(dir)) != NULL) { if (!strcmp(dirEntry->d_name, ".") || !strcmp(dirEntry->d_name, "..")) continue; closedir(dir); return get_help_dir_result; } } char * c = strchr(lang, '.'); if (c) *c = 0; else { c = strchr(lang, '_'); if (c) *c = 0; else break; } } if (dir) closedir(dir); return helpdir; } |
src/main.cpp |
... // reference to |
# gmake ... Making all in doc gmake[2]: Entering directory `/usr/home/he/develop/testproj/doc' Making all in de ... gmake[3]: Entering directory `/usr/home/he/develop/testproj/doc' /usr/local/bin/po4a-gettextize -f sgml -m ./testproj.xml -p ./testproj.pot Use of uninitialized value in hash element at /usr/local/lib/perl5/site_perl/5.8.8/Locale/Po4a/Sgml.pm line 668. po4a::sgml: Warning: nsgmls is missing or non-functional. Please make sure that nsgmls is present and does not produce any error (with the -wno-valid option), and report a bug otherwise. Continuing... ... gmake[2]: Entering directory `/usr/home/he/develop/testproj/doc/de' cd .. ; gmake testproj.pot gmake[3]: Entering directory `/usr/home/he/develop/testproj/doc' gmake[3]: `testproj.pot' is up to date. gmake[3]: Leaving directory `/usr/home/he/develop/testproj/doc' gmake[3]: Entering directory `/usr/home/he/develop/testproj/doc' gmake[3]: Leaving directory `/usr/home/he/develop/testproj/doc' Creating doc-de.po gmake[3]: Entering directory `/usr/home/he/develop/testproj/doc' gmake[3]: Leaving directory `/usr/home/he/develop/testproj/doc' /usr/local/bin/msgfmt -c --statistics doc-de.po || exit 0 /usr/local/bin/msgfmt: doc-de.po: warning: Charset "CHARSET" is not a portable encoding name. Message conversion to user's charset might not work. /usr/local/bin/msgfmt: doc-de.po: some header fields still have the initial default value /usr/local/bin/msgfmt: doc-de.po: warning: PO file header fuzzy warning: older versions of msgfmt will give an error on this /usr/local/bin/msgfmt: found 1 fatal error /usr/local/bin/po4a-translate -f sgml -m ./../testproj.xml -p doc-de.po -l ./testproj.xml -k 0 Use of uninitialized value in hash element at /usr/local/lib/perl5/site_perl/5.8.8/Locale/Po4a/Sgml.pm line 652. po4a::sgml: Warning: nsgmls is missing or non-functional. Please make sure that nsgmls is present and does not produce any error (with the -wno-valid option), and report a bug otherwise. Continuing... gmake[3]: Entering directory `/usr/home/he/develop/testproj/doc' gmake[3]: Leaving directory `/usr/home/he/develop/testproj/doc' gmake doc-clean gmake[3]: Entering directory `/usr/home/he/develop/testproj/doc/de' rm -f *.hhp rm -f *.html rm -f *.hhk rm -f *.hhc gmake[3]: Leaving directory `/usr/home/he/develop/testproj/doc/de' /usr/local/bin/xsltproc ./../testproj.xsl ./testproj.xml ./testproj.xml:74: parser error : Opening and ending tag mismatch: imagedata line 73 and imageobject <>/imageobject> ^ ./testproj.xml:75: parser error : Opening and ending tag mismatch: imageobject line 72 and mediaobject ... unable to parse ./testproj.xml gmake[2]: *** [testproj.hhc] Error 6 gmake[2]: Leaving directory `/usr/home/he/develop/testproj/doc/de' gmake[1]: *** [update-docs] Error 2 gmake[1]: Leaving directory `/usr/home/he/develop/testproj/doc' gmake: *** [update-docs] Error 2 |
doc/de/doc-de.po |
... # type: <imageobject></imageobject> #: ./testproj.xml:64 msgid "<imagedata format=\"png\" fileref=\"apicture.png\">>" |
# gmake ... gmake[4]: Leaving directory `/usr/home/he/develop/testproj/doc/de' /usr/local/bin/xsltproc ./../testproj.xsl ./testproj.xml Writing overview.html for preface(overview) Writing test_chapter.html for chapter(test_chapter) Writing index.html for book Writing testproj.hhp Writing testproj.hhc Writing testproj.hhk ... |
doc/de/doc-de.po |
# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # msgid "" msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: j.t.kirk@ncc-1701.ufp\n" "POT-Creation-Date: 2006-10-11 2:46+0000\n" "PO-Revision-Date: 2006-10-15 2:46+0000\n" "Last-Translator: p.chekov@ncc-1701.ufp\n" "Language-Team: german\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" # type: definition of entity &directions_right; #, no-wrap msgid "right" msgstr "rechts" # type: definition of entity &results_right; #, no-wrap msgid "right " msgstr "richtig" # type: attribute <book>lang #: ./testproj.xml:8 #, no-wrap msgid "en" msgstr "de" # type: <para></para> #: ./testproj.xml:12 msgid "Legal notice ..." msgstr "Rechtlicher Hinweis" # type: <author></author> #: ./testproj.xml:16 msgid "<firstname>J.T.</firstname><surname>Kirk</surname>" msgstr "<firstname>J.T.</firstname><surname>Kirk</surname>" # type: <copyright><holder> #: ./testproj.xml:20 msgid "<year>2005</year><year>2006</year>" msgstr "<year>2005</year><year>2006</year>" # type: <holder></holder> #: ./testproj.xml:20 #, no-wrap msgid "J.T. Kirk" msgstr "J.T. Kirk" # type: <primary></primary> #: ./testproj.xml:20 ./testproj.xml:28 #, no-wrap msgid "testproj" msgstr "testproj" # type: <title></title> #: ./testproj.xml:20 #, no-wrap msgid "Preface to testproj" msgstr "Vorwort zu testproj" # type: <primary></primary> #: ./testproj.xml:28 msgid "Preface" msgstr "Vorwort" # type: </indexterm></para> #: ./testproj.xml:28 msgid "" "This is the preface. It contains of a paragrapgh, a list and a link. This " "paragraph contains useless words only. Its mere purpose is to have some text " "in order to see the paragraphs end." msgstr "" "Dies ist das Vorwort. Es besteht aus einem Absatz, einer Liste und einem " "Link. Dieser Absatz enthält nur Unsinniges. Der einzige Zweck ist, einigen " "Text zusammenzubekommen, um das Absatzende erkennen zu können." # type: <para><variablelist> #: ./testproj.xml:35 msgid "A small list:" msgstr "Eine kleine Liste" # type: <listitem></listitem> #: ./testproj.xml:37 msgid "list item 1" msgstr "Listen Eintrag 1" # type: <listitem></listitem> #: ./testproj.xml:37 msgid "list item 2" msgstr "Listen Eintrag 2" # type: <para><informaltable> #: ./testproj.xml:42 msgid "Demonstration of amigous translations:" msgstr "Demonstration von mehrdeutigen Übersetzungen" # type: <entry></entry> #: ./testproj.xml:47 msgid "Possible directions" msgstr "Mögliche Richtungen" # type: <entry></entry> #: ./testproj.xml:47 msgid "Possible results" msgstr "Mögliche Ergebnisse" # type: <entry></entry> #: ./testproj.xml:55 msgid "left" msgstr "links" # type: <entry></entry> #: ./testproj.xml:55 msgid "wrong" msgstr "falsch" # type: <para></para> #: ./testproj.xml:64 msgid "Link: <link linkend=\"test_chapter\"> Jump to test chapter. </link>" msgstr "Link: <link linkend=\"test_chapter\"> Springe zum Test Kapitel. </link>" # type: <title></title> #: ./testproj.xml:64 #, no-wrap msgid "Test Chapter" msgstr "Test Kapitel" # type: <primary></primary> #: ./testproj.xml:64 msgid "Test chapter" msgstr "Test Kapitel" # type: </indexterm></para> #: ./testproj.xml:64 msgid "" "This is the first and only chapter. It contains a note, a picture and a " "table." msgstr "" "Dies ist das erste und einzige Kapitel. Es enthält einen Hinweis, ein Bild " "und eine Tabelle." # type: <para><mediaobject> #: ./testproj.xml:64 msgid "This paragraph contains a picture" msgstr "Dieser Absatz enthält ein Bild" # type: <imageobject></imageobject> #: ./testproj.xml:64 msgid "<imagedata fileref=\"apicture.png\" format=\"png\">>" msgstr "<imagedata fileref=\"apicture.png\" format=\"png\"/>" # type: </mediaobject><note> #: ./testproj.xml:64 msgid "<emphasis>within</emphasis> the paragraph, which is surrounded by the text." msgstr "<emphasis>innerhalb</emphasis> des Absatzes, welches von Text umgeben ist." # type: <note></note> #: ./testproj.xml:64 msgid "This is a small note" msgstr "Ein kleiner Hinweis" # type: <para><informaltable> #: ./testproj.xml:68 ./test_chapter.xml:11 msgid "Finally a table with some xml tags:" msgstr "Zum Schluß eine Tabelle mit XML Tags:" # type: <entry></entry> #: ./testproj.xml:68 ./test_chapter.xml:16 msgid "xml tag" msgstr "XML Tag" # type: <entry></entry> #: ./testproj.xml:68 ./test_chapter.xml:16 msgid "result" msgstr "Ergebnis" # type: <para></para> #: ./testproj.xml:68 ./test_chapter.xml:20 msgid "command" msgstr "command" # type: <para></para> #: ./testproj.xml:68 ./test_chapter.xml:20 msgid "<command>command</command>" msgstr "<command>command</command>" # type: <para></para> #: ./testproj.xml:68 ./test_chapter.xml:25 msgid "replaceable" msgstr "replaceable" # type: <para></para> #: ./testproj.xml:68 ./test_chapter.xml:25 msgid "<replaceable>replaceable</replaceable>" msgstr "<replaceable>replaceable</replaceable>" # type: <para></para> #: ./testproj.xml:68 ./test_chapter.xml:30 msgid "prompt" msgstr "prompt" # type: <para></para> #: ./testproj.xml:68 ./test_chapter.xml:30 msgid "<prompt>prompt</prompt>" msgstr "<prompt>prompt</prompt>" |
# gmake ... /usr/local/bin/msgfmt -c --statistics doc-de.po || exit 0 36 translated messages. /usr/local/bin/po4a-translate -f sgml -m ./../testproj.xml -p doc-de.po -l ./testproj.xml -k 0 Use of uninitialized value in hash element at /usr/local/lib/perl5/site_perl/5.8.8/Locale/Po4a/Sgml.pm line 652. po4a::sgml: Warning: nsgmls is missing or non-functional. Please make sure that nsgmls is present and does not produce any error (with the -wno-valid option), and report a bug otherwise. Continuing... ... |
# gmake install ... gmake[4]: Entering directory `/usr/home/he/develop/testproj/doc/de' gmake[4]: Nothing to be done for `install-exec-am'. test -z "/usr/local/share/doc/testproj/de" || /usr/local/bin/bash ../../mkinstalldirs "/usr/local/share/doc/testproj/de" /usr/bin/install -c -m 644 'apicture.png' '/usr/local/share/doc/testproj/de/apicture.png' /usr/bin/install -c -m 644 './index.html' '/usr/local/share/doc/testproj/de/index.html' /usr/bin/install -c -m 644 './overview.html' '/usr/local/share/doc/testproj/de/overview.html' /usr/bin/install -c -m 644 './test_chapter.html' '/usr/local/share/doc/testproj/de/test_chapter.html' gmake[4]: Leaving directory `/usr/home/he/develop/testproj/doc/de' ... |
# testproj ... Help: /usr/local/share/doc/testproj/index.html Test chapter: /usr/local/share/doc/testproj/test_chapter.html # setenv LC_ALL de_DE.ISO8859-1 ; testproj ; unsetenv LC_ALL ... Hilfe: /usr/local/share/doc/testproj/de/index.html Test Kapitel: /usr/local/share/doc/testproj/de/test_chapter.html |
Prev | Home | Next |
Adding HTML Help Documentation | wxWidgets Overview |