summaryrefslogtreecommitdiff
path: root/NOTES
blob: 5ca494b9c1fb26d2b1c744d38f7727a8fa5ac1ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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.

By the way, what I forgot to mention is that I needed to replace

#include <stdlib.h>

in the gettext-po.h header file by

typedef long size_t;

otherwise “guild compile-ffi gettext-po.ffi” would fail with the error
message

ffi-help: WARNING: the FFI helper is experimental
(unknown):1: not found: "gnu/stubs-32.h"
compile-ffi: parse failed

So this change is needed in order to reproduce my ffi.


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=_ --keyword=__

To create a po file from a pot file, do the usual:

cd po
msginit -l de --no-translator

To merge an existing po file with a new pot file:

cd po
msgmerge -U de.po pelzfloriande-website.pot

To build the site, assuming nyacc’s source is in
$HOME/build/nyacc/src/nyacc:

 On Parabola:
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

 On Guix:
GUILE_LOAD_PATH=$HOME/keep/projects/pelzfloriande-website:$HOME/build/nyacc/src/nyacc/examples:$GUILE_LOAD_PATH LD_LIBRARY_PATH=/gnu/store/0jjgg2bk6qmx87sdksm7bd2b3z10yd6j-gettext-0.19.8.1/lib 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