caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] localization
@ 2002-04-29  6:48 Yurii A.Rashkovskii
  2002-04-29  7:20 ` Jérôme Marant
  2002-04-30  1:46 ` Shawn Wagner
  0 siblings, 2 replies; 4+ messages in thread
From: Yurii A.Rashkovskii @ 2002-04-29  6:48 UTC (permalink / raw)
  To: caml-list

Guys and gals,

Is there any standard (or semi-standard) approach for program localization in OCaml? (something like gettext, or better) I mean I want to make message output in current locale (English, French, Ukranian, Russian and so on :) as easy as it is possible.

Awaiting for the reply,
Yurii.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] localization
  2002-04-29  6:48 [Caml-list] localization Yurii A.Rashkovskii
@ 2002-04-29  7:20 ` Jérôme Marant
  2002-04-30  1:46 ` Shawn Wagner
  1 sibling, 0 replies; 4+ messages in thread
From: Jérôme Marant @ 2002-04-29  7:20 UTC (permalink / raw)
  To: caml-list

On Mon, Apr 29, 2002 at 09:48:18AM +0300, Yurii A.Rashkovskii wrote:
> Guys and gals,

Hi,

> 
> Is there any standard (or semi-standard) approach for program localization in OCaml? (something like gettext, or better) I mean I want to make message output in current locale (English, French, Ukranian, Russian and so on :) as easy as it is possible.

  I've written a small OCaml binding for gettext and I can get my
  localized po files generated with xgettext.
  It need a bit of testing though. 

  Cheers,

-- 
Jérôme Marant
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] localization
  2002-04-29  6:48 [Caml-list] localization Yurii A.Rashkovskii
  2002-04-29  7:20 ` Jérôme Marant
@ 2002-04-30  1:46 ` Shawn Wagner
  2002-04-30 10:33   ` John Max Skaller
  1 sibling, 1 reply; 4+ messages in thread
From: Shawn Wagner @ 2002-04-30  1:46 UTC (permalink / raw)
  To: caml-list

On Mon, Apr 29, 2002 at 09:48:18AM +0300, Yurii A.Rashkovskii wrote:
> Guys and gals,
> 

> Is there any standard (or semi-standard) approach for program localization
> in OCaml? (something like gettext, or better) I mean I want to make message
> output in current locale (English, French, Ukranian, Russian and so on :) as
> easy as it is possible.

Here's an idea for an interface to gettext:

Use camlp4 to define a new string literal type (Perhaps using TeX-like
quotes: ``foo''), with one camlp4 module rewriting them into a call to the
translation function for normal compilation, and a second module that is
used to create a .pot file that's used just like one generated from C code
by xgettext. The idea is to make it fairly transparent, and simple to mark
strings that should be translated, without having to clutter up your code
with a lot of things like (Gettext.translate "Something ugly just
happened."). Calling textdomain() or bindtextdomain() would still have to be
done manually (And even that can probably be automated), but otherwise it
should be cleaner than using gettext in C.

-- 
Shawn Wagner
shawnw@speakeasy.org
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] localization
  2002-04-30  1:46 ` Shawn Wagner
@ 2002-04-30 10:33   ` John Max Skaller
  0 siblings, 0 replies; 4+ messages in thread
From: John Max Skaller @ 2002-04-30 10:33 UTC (permalink / raw)
  To: Shawn Wagner; +Cc: caml-list

Shawn Wagner wrote:

>Here's an idea for an interface to gettext:
>
>Use camlp4 to define a new string literal type 
>
Yeah, that's a very good idea; you can use it to write
text in your native language and worry about translations
later (indeed, delegate the work, since few people know
all the world's languages ..)

One could even "reprocess" the original source
code to replace the literals in say French with
ones in say English.. so I could read the code
more easily. 

"""BTW: Python triple quoted strings
are an interesting idea"""

-- 
John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850




-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2002-04-30 10:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-29  6:48 [Caml-list] localization Yurii A.Rashkovskii
2002-04-29  7:20 ` Jérôme Marant
2002-04-30  1:46 ` Shawn Wagner
2002-04-30 10:33   ` John Max Skaller

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 NNTP newsgroup(s).