[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] i18n for Scheme programs?

From: Alejandro Forero Cuervo
Subject: Re: [Chicken-users] i18n for Scheme programs?
Date: Fri, 7 Oct 2005 01:39:55 -0500
User-agent: Mutt/1.5.9i

> Doing this on the C-level (I don't know much about gettext, so this must
> be taken with a grain of salt) is probably not the right way, there are
> many strings that you probably don't want to translate, like symbol
> print-names.
> The only internationalization system I have used is the one in Qt and
> something similar shouldn't be too hard. For example, a macro
> (or some read-syntax) could expand into a table-lookup.
> Alternatively, one could extend the compiler to transform string-literals
> directly.

Well, what I was thinking was of having the Scheme programmer write

  (_ "foo")

instead of


Here, _ would be a wrapper to gettext(3), which receives "foo" and
returns the translated string.  So it would be activated by the
programmer on a string-by-string basis.

There is also a bindtextdomain function that specifies the path to the
translation files and another function (I don't recall its name right
now) that allows you to explicity specify the language such as en_US
or es_CO (otherwise gettext gets the language from env variables).

The advantage of using gettext is reusing all the tools they have for
creating the translation files and stuff.

BTW, it is also possible to translate Chicken itself.  In this case we
would basically make it possible to translate the error messages and
stuff (again, this would be done by replacing "foo" with _("foo") in
Chicken C sources wherever it makes sense, on a string-by-string
basis).  I was, however, refering to the other case: making it
possible to translate Scheme programs that run over Chicken.



---=(  Comunidad de Usuarios de Software Libre en Colombia  )=---
---=( )=--=( address@hidden  )=---

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]