aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-09-10 21:10:38 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-09-11 19:58:54 +0200
commitfabddcf27bce94651ae1f0eea868d6747431e6d3 (patch)
tree434a3b27fc81bf0f8e3a8f982ff57dfc43471138
parentClean up and include exception utility documentation. (diff)
downloadcalp-fabddcf27bce94651ae1f0eea868d6747431e6d3.tar.gz
calp-fabddcf27bce94651ae1f0eea868d6747431e6d3.tar.xz
Add documentation for translation procedures.
-rw-r--r--doc/ref/guile.texi1
-rw-r--r--doc/ref/guile/translation.texi31
2 files changed, 32 insertions, 0 deletions
diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi
index 1fc0065a..131d435c 100644
--- a/doc/ref/guile.texi
+++ b/doc/ref/guile.texi
@@ -12,6 +12,7 @@
@include guile/xdg-basedir.texi
@include guile/web.texi
@include guile/vcomponent.texi
+@include guile/translation.texi
@node Errors and Conditions
@section Errors and Conditions
diff --git a/doc/ref/guile/translation.texi b/doc/ref/guile/translation.texi
new file mode 100644
index 00000000..0e710c47
--- /dev/null
+++ b/doc/ref/guile/translation.texi
@@ -0,0 +1,31 @@
+@node Translation
+@section Translation
+
+Base for string translation in the application. Calp uses Guile's
+built in gettext bindings. The text domain used is ``calp''.
+
+@defun translate str
+@anchor{translate}
+Translate a string from english into an (through enviroment) specified
+target language. All newlines in the source string will be changed to
+spaces.
+
+This procedure is both used as the ``backend'' for @ref{G_}, but also
+for non-literal strings which should be translated.
+@end defun
+
+@defun G_ msg ...
+@anchor{G_}
+The ``global'' binding indicating a string to be translated.
+
+All arguments must be strings, and will be concatenated before being
+passed to @ref{translate} (meaning newlines will be ignored).
+@end defun
+
+@defun yes-no-check string [locale=%global-locale]
+Checks @var{string} if it's a yes or no response in the given
+@var{locale}.
+
+Returns @code{'yes} or @code{'no}, or @code{#f} if the string couldn't
+be parsed as a yes/no predicate in the current locale.
+@end defun