summaryrefslogtreecommitdiff
path: root/NOTES
diff options
context:
space:
mode:
authorFlorian Pelz <pelzflorian@pelzflorian.de>2017-12-09 17:46:51 +0100
committerFlorian Pelz <pelzflorian@pelzflorian.de>2017-12-09 17:46:51 +0100
commit5f97bf157eaddcfe722c97dcab349b7dcfbbcd9d (patch)
treed624f9597e5d127b67333725c36cad2653be7a91 /NOTES
parent6a6a82ddca3527610f561a601a3c02ec9f9f0c86 (diff)
Use Gettext PO files for translations with libgettextpo.
I want to avoid repeated setlocale calls and thus am not using the gettext function directly. See the code comments for details.
Diffstat (limited to 'NOTES')
-rw-r--r--NOTES26
1 files changed, 26 insertions, 0 deletions
diff --git a/NOTES b/NOTES
new file mode 100644
index 0000000..bcb77c7
--- /dev/null
+++ b/NOTES
@@ -0,0 +1,26 @@
+This is the code for my personal website built with Haunt. Since I
+want translations to work with po files but without repeatedly calling
+setlocale, I’m using the ffi-helper in nyacc
+<savannah.nongnu.org/projects/nyacc/> to call libgettextpo to parse
+the po files.
+
+gettext-po.scm was created with the ffi-helper.
+
+To create a pot file, call:
+
+xgettext -f po/POTFILES -o po/pelzfloriande-website.pot --from-code=UTF-8 --copyright-holder="" --package-name="pelzfloriande-website" --msgid-bugs-address="pelzflorian@pelzflorian.de" --keyword=_
+
+To create a po file from a pot file, do the usual:
+
+cd po
+msginit -l de --no-translator
+
+To build the site, assuming nyacc’s source is in
+$HOME/build/nyacc/src/nyacc:
+
+GUILE_LOAD_PATH=$HOME/keep/projects/pelzfloriande-website:$HOME/build/nyacc/src/nyacc/examples:$GUILE_LOAD_PATH GUILE_LOAD_COMPILED_PATH=$GUILE_LOAD_COMPILED_PATH:$HOME/.cache/guile/ccache/2.2-LE-8-3.A/home/florian/keep/projects/pelzfloriande-website haunt build
+
+Use this to run guile with strace for debugging. It’s probably easiest
+to do this from Emacs; I’m currently using M-x shell in Emacs.
+
+GUILE_LOAD_PATH=$HOME/keep/projects/pelzfloriande-website:$HOME/build/nyacc/src/nyacc/examples:$GUILE_LOAD_PATH GUILE_LOAD_COMPILED_PATH=$GUILE_LOAD_COMPILED_PATH:$HOME/.cache/guile/ccache/2.2-LE-8-3.A/home/florian/keep/projects/pelzfloriande-website strace -o out guile