unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
Cc: Jan Nieuwenhuizen <janneke@gnu.org>
Subject: i18n, gettext support
Date: Fri, 20 Aug 2004 22:26:10 +0200	[thread overview]
Message-ID: <200408202226.10769.bruno@clisp.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1983 bytes --]

Hello,

Jan Nieuwenhuizen asked me (the GNU gettext maintainer) for how to support
Guile programs in gettext.

The idea would be to make libintl bindings at the C level, and add support
for Scheme to xgettext and msgfmt. Common Lisp support has already been done
long ago; the guile support would therefore be a simple clone of it.

I plan to use this sample "hello world" program as an example. Is this OK
with you, the guile developers?

=============================== hello.scm ==================================
#!@GUILE@ -s
!#
;;; Example for use of GNU gettext.
;;; Copyright (C) 2004 Free Software Foundation, Inc.
;;; This file is in the public domain.

;;; Source code of the GNU guile program.

(use-modules (i18n))
(use-modules (ice-9 format))

(set! (i18n:textdomain) "hello-guile")
(set! (i18n:textdomaindir "hello-guile") "@localedir@/")
(define _ i18n:gettext)

(display (_ "Hello, world!"))
(newline)
(format #t (_ "This program is running as process number ~D.") (getpid))
(newline)
=============================================================================

Attached you find my proposal for the libintl binding module. It is based
on the existing interface in GNU clisp, and adapted for guile. Please
comment on it. You can use this proposal as a base for the documentation
of this interface.

Technically, this binding could be distributed with guile or with gettext.
I would much prefer if it were part of guile, because this frees the
guile user from checking whether the guile-libintl interface is installed
or not.

The ice-9 format string facility with its ~n@* facility is sufficient for
i18n. Is it true that most guile programs use format, not printf, for
formatted string output?

> without guile properly understanding multi-byte strings it's a bit limited

Without proper multibyte or Unicode string support, programs can not
do surgery (truncation, uppercase conversion etc.) on strings returned
from i18n:gettext, but it can output them.

Bruno


[-- Attachment #2: guile-gettext.html --]
[-- Type: text/html, Size: 17344 bytes --]

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel

             reply	other threads:[~2004-08-20 20:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-20 20:26 Bruno Haible [this message]
2004-08-23  0:58 ` i18n, gettext support Kevin Ryde
2004-09-01 16:25 ` Jan Nieuwenhuizen
2004-09-01 20:57   ` Bruno Haible
2004-09-02  9:38     ` Jan Nieuwenhuizen
2004-09-02 16:06       ` Bruno Haible
2004-09-02 16:21         ` Bruno Haible
2004-09-03  1:34           ` Kevin Ryde
2004-09-04 17:25             ` Bruno Haible
2004-09-07  0:13               ` Kevin Ryde
2004-09-07 12:38                 ` Bruno Haible
2004-09-08  1:10                   ` Kevin Ryde
2004-09-07  8:20             ` Jan Nieuwenhuizen
2004-09-07 14:16               ` Jan Nieuwenhuizen
2004-09-08  1:15                 ` Kevin Ryde
2004-09-08  8:58                   ` Jan Nieuwenhuizen
2004-09-08 10:39                   ` Bruno Haible
2004-09-08 14:37                     ` Jan Nieuwenhuizen
2004-09-08 16:37                       ` Bruno Haible
2004-09-08 21:53                     ` Jan Nieuwenhuizen
2004-09-08 22:45                       ` Kevin Ryde
2004-09-08 23:46                         ` Jan Nieuwenhuizen
2004-09-09 16:25                           ` Jan Nieuwenhuizen
2004-09-15 11:20                             ` Bruno Haible
2004-09-22  0:42                             ` Marius Vollmer
2004-09-22 14:55                               ` Bruno Haible
2004-09-02 17:32         ` Jan Nieuwenhuizen
2004-09-01 21:44   ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200408202226.10769.bruno@clisp.org \
    --to=bruno@clisp.org \
    --cc=janneke@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).