diff options
-rw-r--r-- | makefiles/gmake/clean.mk | 2 | ||||
-rw-r--r-- | makefiles/gmake/help.mk | 3 | ||||
-rw-r--r-- | makefiles/gmake/i18n.mk | 101 | ||||
-rw-r--r-- | makefiles/gmake/install.mk | 2 | ||||
-rw-r--r-- | makefiles/gmake/sub.mk | 1 | ||||
-rw-r--r-- | src/GNUmakefile | 8 | ||||
-rw-r--r-- | src/po/de.po | 540 |
7 files changed, 656 insertions, 1 deletions
diff --git a/makefiles/gmake/clean.mk b/makefiles/gmake/clean.mk index 95b7d0a..3c7a8a9 100644 --- a/makefiles/gmake/clean.mk +++ b/makefiles/gmake/clean.mk @@ -18,7 +18,7 @@ clean_recursive: @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \ (set -e; $(MAKE) -C $$d clean || exit 1); done) -clean: clean_recursive local_clean +clean: clean_recursive clean_po local_clean -@rm -f *.bak 2>/dev/null -@rm -f *~ 2>/dev/null -@rm -f *.d port/*.d 2>/dev/null diff --git a/makefiles/gmake/help.mk b/makefiles/gmake/help.mk index 60b2e94..aaf311a 100644 --- a/makefiles/gmake/help.mk +++ b/makefiles/gmake/help.mk @@ -9,3 +9,6 @@ make distclean clean up all generated artifacts make install install (set 'DESTDIR' and 'prefix' at will) make dist[-Z|-gz|-bz2] create tarball containing all sources make help show this very help page +make init-po create initial version of the gettext files +make update-po update the gettext files after changes +make check-po check sanity of gettext files diff --git a/makefiles/gmake/i18n.mk b/makefiles/gmake/i18n.mk new file mode 100644 index 0000000..46dd829 --- /dev/null +++ b/makefiles/gmake/i18n.mk @@ -0,0 +1,101 @@ +# handle localization stuff (gettext) +# (this follows roughly the way Postgresql handles NLS) +# +# requires: +# - CATALOG_NAME: name of the catalog (name of the library or program) +# will be installed as $(CATALOG_NAME).po in the localedir +# - GETTEXT_LANGUAGES: list of languages supported +# - GETTEXT_FILES: list of source files that contain message strings +# - GETTEXT_TRIGGERS: (optional) list of functions/macros that contain +# translatable strings +# +# provides: +# - target: init-po +# - target: update-po +# - taget: check-po + +MSGFMT=msgfmt +MSGMERGE=msgmerge +XGETTEXT=xgettext + +.PHONY: init-po update-po + +PO_FILES = $(addprefix po/, $(addsuffix .po, $(GETTEXT_LANGUAGES))) +MO_FILES = $(addprefix po/, $(addsuffix .mo, $(GETTEXT_LANGUAGES))) + +%.mo : %.po + $(MSGFMT) -c -o $@ $< + +all-po: $(MO_FILES) + +init-po: po/$(CATALOG_NAME).pot + +po/$(CATALOG_NAME).pot: $(GETTEXT_FILES) + $(XGETTEXT) -n -F -d $(CATALOG_NAME) -o $@ \ + $(addprefix -k, $(GETTEXT_TRIGGERS)) --flag=_:1:pass-c-format \ + -d $(CATALOG_NAME) -n -F $(GETTEXT_FILES) + +clean_po: + echo "Removing po files.." + +# TODO: sort out below + +# initial creation of the translation table: +# msginit -l de_CH -o test_gettext_de_CH.po -i test_gettext.pot +# +# merge the changes into the translation tables keeping existing +# translations +# msgmerge -s -U test_gettext_de_CH.po test_gettext.pot +# +# compile message files into binary format: +# msgfmt -c -v -o test_gettext_de.mo test_gettext_de.po + +# a potfile is a set of files, we can't just do this! +#%.pot: %.c +# xgettext -k_ --flag=_:1:pass-c-format -d test_gettext -s -o $@ $< +# touch $@ + +#test_gettext_de.po: test_gettext.pot +# msgmerge -s -U $@ -i $< +# touch $@ + +#test_gettext_de_CH.po: test_gettext.pot +# msgmerge -s -U $@ -i $< +# touch $@ + +# TODO: big cleanup for GCC compilation flags +# in older gcc (before 4.2.1) we can't switch off warnings selectivly with a +# prage. So gettext misses a format attribute which results in a warning +# test_gettext.c:81: warning: format not a string literal, argument types not checked +# (Solaris 8, NetBSD) +# on Solaris 10 we get a system header conflict if we don't specify -std=c99 +#test_gettext.o : test_gettext.c +# $(CC) -c -g -o $@ $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) $< + +# LANG setting differs from platform to platform a little bit :-( +#ifeq "$(PLATFORM)" "LINUX" +#TEST_LANG = de_CH +#endif +#ifeq "$(PLATFORM)" "FREEBSD" +#TEST_LANG = de_CH.ISO8859-1 +#endif +#ifeq "$(PLATFORM)" "OPENBSD" +#TEST_LANG = de_CH.ISO8859-1 +#endif +#ifeq "$(PLATFORM)" "SUNOS" +#TEST_LANG = de_CH.iso_8859_1 +#endif +#ifeq "$(PLATFORM)" "CYGWIN" +#TEST_LANG = de +#endif +#ifeq "$(PLATFORM)" "NETBSD" +#TEST_LANG = de +#endif + +#local_test: test_gettext_de.mo test_gettext_de_CH.mo +# @echo "Testing gettext.." +# @mkdir -p locale/de_CH/LC_MESSAGES +# @mkdir -p locale/de/LC_MESSAGES +# @cp test_gettext_de.mo locale/de_CH/LC_MESSAGES/test_gettext.mo +# @cp test_gettext_de.mo locale/de/LC_MESSAGES/test_gettext.mo +# @LANG=$(TEST_LANG) ./test_gettext >/dev/null 2>&1 diff --git a/makefiles/gmake/install.mk b/makefiles/gmake/install.mk index 8a5c3be..4f1e1e5 100644 --- a/makefiles/gmake/install.mk +++ b/makefiles/gmake/install.mk @@ -18,6 +18,8 @@ sbindir=$(execdir)/sbin libdir=$(execdir)/lib sysconfdir=$(execdir)/etc includedir=$(execdir)/include +datadir=$(execdir)/share +localedir=$(datadir)/locale .PHONY: install_recursive install local_install diff --git a/makefiles/gmake/sub.mk b/makefiles/gmake/sub.mk index 764d274..89c6bbb 100644 --- a/makefiles/gmake/sub.mk +++ b/makefiles/gmake/sub.mk @@ -24,3 +24,4 @@ test: $(OBJS) $(TEST_OBJS) $(CPPOBJS) $(BIN_OBJS) $(BINS) $(CPP_BINS) $(TEST_BIN -include $(TOPDIR)/makefiles/gmake/depend.mk -include $(TOPDIR)/makefiles/gmake/clean.mk -include $(TOPDIR)/makefiles/gmake/install.mk +-include $(TOPDIR)/makefiles/gmake/i18n.mk diff --git a/src/GNUmakefile b/src/GNUmakefile index 8932dcf..da28d97 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -27,6 +27,14 @@ OBJS = \ $(LOG_OBJS) \ $(DAEMON_OBJS) +CATALOG_NAME = libwolf + +GETTEXT_LANGUAGES = de + +GETTEXT_FILES = $(OBJS:.o=.c) + +GETTEXT_TRIGGERS = _ gettext_noop gettext + local_all: $(LIBS) -include $(TOPDIR)/makefiles/gmake/sub.mk diff --git a/src/po/de.po b/src/po/de.po new file mode 100644 index 0000000..5c9f0e5 --- /dev/null +++ b/src/po/de.po @@ -0,0 +1,540 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-03-18 11:06+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: daemon/daemon.c:106 +#, c-format +msgid "Error while closing file descriptor %d: %s" +msgstr "" + +#: daemon/daemon.c:134 +#, c-format +msgid "Unable to retrieve maximal number of files: %s" +msgstr "" + +#: daemon/daemon.c:139 +#, c-format +msgid "Closing all filedescriptors up to %ld" +msgstr "" + +#: daemon/daemon.c:165 +#, c-format +msgid "Unable to open fd %d as /dev/null: %s" +msgstr "" + +#: daemon/daemon.c:171 +#, c-format +msgid "Something is wrong with the file descriptors (expecting %d, got %d)!" +msgstr "" + +#: daemon/daemon.c:187 +#, c-format +msgid "Error in atomar write to fd %d: %s" +msgstr "" + +#: daemon/daemon.c:191 +#, c-format +msgid "Unexpected number of octets %zd in atomar write to fd %d (expected %zd)" +msgstr "" + +#: daemon/daemon.c:204 +#, c-format +msgid "Error in atmoar read from fd %d: %s" +msgstr "" + +#: daemon/daemon.c:208 +#, c-format +msgid "" +"Unexpected number of octets %zd in atomar read from fd %d (expected %zd)" +msgstr "" + +#: daemon/daemon.c:324 +msgid "Already running as daemon!" +msgstr "" + +#: daemon/daemon.c:336 +msgid "Unable to start daemon as not root user!" +msgstr "" + +#: daemon/daemon.c:362 +#, c-format +msgid "Unable to create exit code pipe: %s" +msgstr "" + +#: daemon/daemon.c:367 +#, c-format +msgid "Created exit code pipe (%d,%d)" +msgstr "" + +#: daemon/daemon.c:376 +#, c-format +msgid "Unable to fork the first time: %s" +msgstr "" + +#: daemon/daemon.c:382 +msgid "First fork reached" +msgstr "" + +#: daemon/daemon.c:393 +#, c-format +msgid "Parent after first fork: child is %d" +msgstr "" + +#: daemon/daemon.c:403 +#, c-format +msgid "Unable to create parent pipe: %s" +msgstr "" + +#: daemon/daemon.c:408 +#, c-format +msgid "Created parent pipe (%d,%d)" +msgstr "" + +#: daemon/daemon.c:417 +#, c-format +msgid "" +"Starting new process group session for the parent of the daemon failed: %s" +msgstr "" + +#: daemon/daemon.c:445 +#, c-format +msgid "Unable to fork the second time: %s" +msgstr "" + +#: daemon/daemon.c:451 +msgid "Second fork reached" +msgstr "" + +#: daemon/daemon.c:457 +#, c-format +msgid "Parent after second fork: child (and daemon) is %d" +msgstr "" + +#: daemon/daemon.c:475 +#, c-format +msgid "Starting new process group for daemon session failed: %s" +msgstr "" + +#: daemon/daemon.c:489 +#, c-format +msgid "Changing to root diretory failed: %s" +msgstr "" + +#: daemon/daemon.c:493 +msgid "Changed to root directory /" +msgstr "" + +#: daemon/daemon.c:502 daemon/daemon.c:545 +#, c-format +msgid "Switched umask from %04o to %04o" +msgstr "" + +#: daemon/daemon.c:508 +#, c-format +msgid "Another daemon is already running with pid '%d', can't start!" +msgstr "" + +#: daemon/daemon.c:554 +#, c-format +msgid "No group '%s' found" +msgstr "" + +#: daemon/daemon.c:557 +#, c-format +msgid "Unable to retrieve group information for group '%s': %s" +msgstr "" + +#: daemon/daemon.c:568 +#, c-format +msgid "No user '%s' found" +msgstr "" + +#: daemon/daemon.c:571 +#, c-format +msgid "Unable to retrieve user information for user '%s': %s" +msgstr "" + +#: daemon/daemon.c:579 +#, c-format +msgid "Setting unprivileged group failed: %s" +msgstr "" + +#: daemon/daemon.c:586 +#, c-format +msgid "Setting unprivileged user failed: %s" +msgstr "" + +#: daemon/daemon.c:596 +#, c-format +msgid "Switched to user '%s' (%d) and group '%s' (%d)" +msgstr "" + +#: daemon/daemon.c:625 +#, c-format +msgid "daemon_exit called int state %d (error %d)" +msgstr "" + +#: daemon/daemon.c:635 +msgid "Waiting on exit_code pipe for exit code" +msgstr "" + +#: daemon/daemon.c:640 +#, c-format +msgid "Terminating grand-parent of daemon with code %d (PID: %lu)" +msgstr "" + +#: daemon/daemon.c:657 +msgid "Waiting on parent pipe for termination signal" +msgstr "" + +#: daemon/daemon.c:663 +#, c-format +msgid "" +"Parent got termination (pidfile lock: %d, run: %d, fd: %d).. cleaning up now " +"(PID: %lu)" +msgstr "" + +#: daemon/daemon.c:672 +#, c-format +msgid "Terminating parent of daemon (PID %lu)" +msgstr "" + +#: daemon/daemon.c:691 +#, c-format +msgid "Terminating daemon (PID: %lu)" +msgstr "" + +#: daemon/daemon.c:718 +#, c-format +msgid "Terminating daemon (PID: %lu) with error" +msgstr "" + +#: daemon/daemon.c:743 +#, c-format +msgid "Unable to create signal pipe: %s" +msgstr "" + +#: daemon/daemon.c:747 +#, c-format +msgid "Created signal pipe (%d,%d)" +msgstr "" + +#: daemon/daemon.c:791 +#, c-format +msgid "Error in select when waiting for signal from pipe: %s" +msgstr "" + +#: daemon/daemon.c:805 +#, c-format +msgid "Error while reading a signal from the pipe: %s" +msgstr "" + +#: daemon/daemon.c:812 +#, c-format +msgid "Unexpected error in read: result is %d" +msgstr "" + +#: daemon/pidfile.c:61 +#, c-format +msgid "No pidfile '%s' found, daemon is not running" +msgstr "" + +#: daemon/pidfile.c:67 +#, c-format +msgid "Unable to open pidfile '%s' for reading: %s" +msgstr "" + +#: daemon/pidfile.c:79 +msgid "Another process locks the pidfile, daemon already running" +msgstr "" + +#: daemon/pidfile.c:85 +#, c-format +msgid "Unable to lock pidfile '%s': %s" +msgstr "" + +#: daemon/pidfile.c:101 +#, c-format +msgid "Unable to read pid from pidfile '%s': %s" +msgstr "" + +#: daemon/pidfile.c:118 +#, c-format +msgid "pidfile '%s' contains invalid data, can't read PID from it!" +msgstr "" + +#: daemon/pidfile.c:124 +#, c-format +msgid "Found PID '%lu' in pidfile" +msgstr "" + +#: daemon/pidfile.c:134 +#, c-format +msgid "" +"Found PID '%lu' in pidfile '%s', but no such process is running. Check and " +"manually delete the pidfile!" +msgstr "" + +#: daemon/pidfile.c:140 +#, c-format +msgid "Can't check if process with PID '%lu' is alive: %s" +msgstr "" + +#: daemon/pidfile.c:147 +#, c-format +msgid "A process with PID '%lu' is already running" +msgstr "" + +#: daemon/pidfile.c:166 +#, c-format +msgid "Unable to open pidfile '%s' for writing: %s" +msgstr "" + +#: daemon/pidfile.c:178 +#, c-format +msgid "Unable to lock pidfile '%s' after creation, daemon started in parallel?" +msgstr "" + +#: daemon/pidfile.c:184 +#, c-format +msgid "Unable to lock pidfile '%s' after creation: %s" +msgstr "" + +#: daemon/pidfile.c:196 +#, c-format +msgid "Unable to truncate the pidfile '%s' before writing to it" +msgstr "" + +#: daemon/pidfile.c:209 +#, c-format +msgid "Unable to write PID into the pidfile '%s': %s" +msgstr "" + +#: daemon/pidfile.c:216 +#, c-format +msgid "Non-atomic write failed when storing the PID into the pidfile '%s'" +msgstr "" + +#: daemon/pidfile.c:219 +#, c-format +msgid "Stored '%lu' into the pidfile '%s' and locked it" +msgstr "" + +#: daemon/pidfile.c:230 +#, c-format +msgid "Releasing (unlocking/closing) pidfile '%s' (fd: %d, locked: %d)" +msgstr "" + +#: daemon/pidfile.c:236 +#, c-format +msgid "Unable to unlock the pidfile '%s': %s" +msgstr "" + +#: daemon/pidfile.c:245 +#, c-format +msgid "Unable to close the pidfile '%s': %s" +msgstr "" + +#: daemon/pidfile.c:259 +#, c-format +msgid "Removing pidfile '%s' (fd: %d, locked: %d, running: %d)" +msgstr "" + +#: daemon/pidfile.c:272 +#, c-format +msgid "Unable to remove the pidfile '%s': %s" +msgstr "" + +#: daemon/signals.c:94 +msgid "Hangup" +msgstr "" + +#: daemon/signals.c:95 +msgid "Interrupt" +msgstr "" + +#: daemon/signals.c:96 +msgid "Quit" +msgstr "" + +#: daemon/signals.c:97 +msgid "Illegal instruction" +msgstr "" + +#: daemon/signals.c:98 +msgid "Trace trap" +msgstr "" + +#: daemon/signals.c:99 +msgid "Abort" +msgstr "" + +#: daemon/signals.c:102 +msgid "IOT trap" +msgstr "" + +#: daemon/signals.c:106 +msgid "EMT instruction" +msgstr "" + +#: daemon/signals.c:108 +msgid "BUS error" +msgstr "" + +#: daemon/signals.c:109 +msgid "Floating-point exception" +msgstr "" + +#: daemon/signals.c:110 +msgid "Kill" +msgstr "" + +#: daemon/signals.c:111 +msgid "User-defined signal 1" +msgstr "" + +#: daemon/signals.c:112 +msgid "Segmentation violation" +msgstr "" + +#: daemon/signals.c:113 +msgid "User-defined signal 2" +msgstr "" + +#: daemon/signals.c:114 +msgid "Broken pipe" +msgstr "" + +#: daemon/signals.c:115 +msgid "Alarm clock" +msgstr "" + +#: daemon/signals.c:116 +msgid "Termination" +msgstr "" + +#: daemon/signals.c:118 +msgid "Stack fault" +msgstr "" + +#: daemon/signals.c:122 daemon/signals.c:125 +msgid "Child status has changed" +msgstr "" + +#: daemon/signals.c:126 +msgid "Continue" +msgstr "" + +#: daemon/signals.c:127 +msgid "Stop" +msgstr "" + +#: daemon/signals.c:128 +msgid "Keyboard stop" +msgstr "" + +#: daemon/signals.c:129 +msgid "Background read from tty" +msgstr "" + +#: daemon/signals.c:130 +msgid "Background write to tty" +msgstr "" + +#: daemon/signals.c:131 +msgid "Urgent condition on socket" +msgstr "" + +#: daemon/signals.c:132 +msgid "CPU limit exceeded" +msgstr "" + +#: daemon/signals.c:133 +msgid "File size limit exceeded" +msgstr "" + +#: daemon/signals.c:134 +msgid "Virtual alarm clock" +msgstr "" + +#: daemon/signals.c:135 +msgid "Profiling alarm clock" +msgstr "" + +#: daemon/signals.c:137 +msgid "Window size change" +msgstr "" + +#: daemon/signals.c:141 +msgid "Pollable event occurred" +msgstr "" + +#: daemon/signals.c:145 +msgid "I/O now possible" +msgstr "" + +#: daemon/signals.c:148 +msgid "Power failure restart" +msgstr "" + +#: daemon/signals.c:151 +msgid "Bad system call" +msgstr "" + +#: daemon/signals.c:154 +msgid "Resource lost" +msgstr "" + +#: daemon/signals.c:173 +#, c-format +msgid "Can't ignore signal handler for signal '%s' (%s): %s" +msgstr "" + +#: daemon/signals.c:181 +#, c-format +msgid "Ignoring signal handler for signal '%s' (%s)" +msgstr "" + +#: daemon/signals.c:206 +#, c-format +msgid "Can't install empty signal handler for signal '%s' (%s): %s" +msgstr "" + +#: daemon/signals.c:213 +#, c-format +msgid "Installed empty signal handler for signal '%s' (%s)" +msgstr "" + +#: daemon/signals.c:232 +#, c-format +msgid "Got signal '%s' (%s)" +msgstr "" + +#: daemon/signals.c:255 +#, c-format +msgid "Can't install signal handler for signal '%s' (%s): %s" +msgstr "" + +#: daemon/signals.c:262 +#, c-format +msgid "Installed signal handler for signal '%s' (%s)" +msgstr "" + +#: log/log.c:608 +#, c-format +msgid "%s: localtime_r failed: %s\n" +msgstr "" |