[Top][All Lists]

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

[Demexp-dev] Issue to use ocaml-gettext with lablgtk

From: David MENTRE
Subject: [Demexp-dev] Issue to use ocaml-gettext with lablgtk
Date: Mon, 23 Jan 2006 19:59:48 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Hello Sylvain,

I'm trying to translated a Glade-2 interface with ocaml-gettext but it
does not seem to work.

In my program, I define module DemexpGettext:

module Gettext = Gettext.Program
      let textdomain   = "demexp"
      let codeset      = None
      let dir          = None
      let dependencies = Gettext.init

Then, I use it in the main module of my program, before calling

let gettext_args, _ = DemexpGettext.Gettext.init

I parse command line.

let cmdline_options =
  Arg.align ([
 ] @ gettext_args)

Function [[parse_cmdline]] parses command line options. It sets global
flags defined in [[Clntflags]] (see \codechunkref{code:clntflags}).

let parse_cmdline () =
  let anon_fun url =
    flag_url_list := url :: !flag_url_list in
  Arg.parse cmdline_options anon_fun usage_msg

let _ = 
  parse_cmdline ();
    GMain.Main.main ();

I do a "make install-buildpo" that installs compiled MO files in local
build/share/locale/ directory.

Then I call my program as follow, but Glade interface is not translated:
./gtk2-clnt/demexp-gtk2-client --gettext-dir 
~/pub/expdem/demexp--dev--0.7/build/share/locale/ --gettext-language fr_FR.UTF-8

(I have tried various variations, fr, fr_FR, with no more success)

Is it the right way to use your library? Have I missed something to
initialize (I'm a bit lost in all the Gettext modules)? Any suggestion?

BTW, it would be nice to have a --gettext-debug mode where ocaml-gettext
prints what it is doing and where is it looking for on stderr.

Best wishes,
pub  1024D/A3AD7A2A 2004-10-03 David MENTRE <address@hidden>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A

reply via email to

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