unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* i18n, gettext support
@ 2004-08-20 20:26 Bruno Haible
  2004-08-23  0:58 ` Kevin Ryde
  2004-09-01 16:25 ` Jan Nieuwenhuizen
  0 siblings, 2 replies; 28+ messages in thread
From: Bruno Haible @ 2004-08-20 20:26 UTC (permalink / raw)
  Cc: Jan Nieuwenhuizen

[-- 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

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2004-09-22 14:55 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-20 20:26 i18n, gettext support Bruno Haible
2004-08-23  0:58 ` 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

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).