From 147a7fa8376429e78fe17f4a199c2394149c33a9 Mon Sep 17 00:00:00 2001 From: Ludovic Court`es Date: Fri, 2 Feb 2007 17:15:33 +0000 Subject: Added basic GNU Gettext support. * .arch-inventory: Mark `ABOUT-NLS' as precious. * Makefile.am (SUBDIRS): Added `po'. (ACLOCAL_AMFLAGS): New. (EXTRA_DIST): New. * configure.ac: Look for `gettext', output `po/Makefile.in'. * src/guile/skribilo/biblio/template.scm (make-bib-entry-template/default): Internationalized a bit. (make-bib-entry-template/skribe): Likewise. * src/guile/skribilo/utils/syntax.scm (%skribilo-module-reader): I18ned. (_): New. (N_): New. git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-11 --- src/guile/skribilo/biblio/template.scm | 6 +++--- src/guile/skribilo/utils/syntax.scm | 23 ++++++++++++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'src/guile') diff --git a/src/guile/skribilo/biblio/template.scm b/src/guile/skribilo/biblio/template.scm index 5a82e26..30a6512 100644 --- a/src/guile/skribilo/biblio/template.scm +++ b/src/guile/skribilo/biblio/template.scm @@ -1,7 +1,7 @@ ;;; template.scm -- Template system for bibliography entries. ;;; ;;; Copyright 2003, 2004 Manuel Serrano -;;; Copyright 2006 Ludovic Courtès +;;; Copyright 2006, 2007 Ludovic Courtès ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -115,7 +115,7 @@ (case kind ((techreport) `(author ". " (or title url documenturl) ". " - number ", " institution ", " + ,(_ "Technical Report") " " number ", " institution ", " address ", " month " " year ", " ("pp. " pages) ".")) ((article) @@ -159,7 +159,7 @@ (case kind ((techreport) `(author " -- " (or title url documenturl) " -- " - number ", " institution ", " + ,(_ "Technical Report") " " number ", " institution ", " address ", " month ", " year ", " ("pp. " pages) ".")) ((article) diff --git a/src/guile/skribilo/utils/syntax.scm b/src/guile/skribilo/utils/syntax.scm index 44bff09..6a99771 100644 --- a/src/guile/skribilo/utils/syntax.scm +++ b/src/guile/skribilo/utils/syntax.scm @@ -1,6 +1,6 @@ ;;; syntax.scm -- Syntactic candy for Skribilo modules. ;;; -;;; Copyright 2005, 2006 Ludovic Courtès +;;; Copyright 2005, 2006, 2007 Ludovic Courtès ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -23,7 +23,8 @@ :use-module (system reader library) :use-module (system reader compat) ;; make sure `current-reader' exists :use-module (system reader confinement) - :export (%skribe-reader %skribilo-module-reader) + :export (%skribe-reader %skribilo-module-reader + _ N_) :export-syntax (unwind-protect unless when)) ;;; Author: Ludovic Courtès @@ -49,7 +50,7 @@ (if (string? file) (format #f "~a:~a:~a: " file line column) "") - "unexpected character in Skribilo module") + (_ "unexpected character in Skribilo module")) chr))) ;; By default, don't record positions: this yields a nice read @@ -76,6 +77,22 @@ (define-macro (when condition . exprs) `(if ,condition (begin ,@exprs))) + +;;; +;;; Gettext support. +;;; + +(define %skribilo-text-domain "skribilo") + +(textdomain %skribilo-text-domain) + +(define (_ msg) + (gettext msg %skribilo-text-domain)) + +(define (N_ msg msgplural n) + (ngettext msg msg plural n %skribilo-text-domain)) + + ;;; arch-tag: 9a0e0638-64f0-480a-ab19-49e8bfcbcd9b ;;; syntax.scm ends here -- cgit v1.2.3