邓超 | 7 Apr 2008 14:49
Picon

How to work with .po file

Hi all,
  As I know, when writing C or C++ program, those content of menu, button, label can use .po file, then different persons of different countries can see different language when running the same program. So, how about haskell? Can haskell do it? how to do it then?

--
Deng Chao

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Axel Simon | 7 Apr 2008 15:55
Picon
Picon
Favicon

Re: How to work with .po file

Hi Deng,

On Mon, 2008-04-07 at 20:49 +0800, 邓超 wrote:
> Hi all,
>   As I know, when writing C or C++ program, those content of menu,
> button, label can use .po file, then different persons of different
> countries can see different language when running the same program.
> So, how about haskell? Can haskell do it? how to do it then?

Gtk2Hs so far has not gettext support. There has been a package for
gettext around but I don't think it's actively maintained. Since ghc 6.8
there is a class called IsString with which one could implement a
library that -- when loaded -- translates all string literals in the
source code.

How important is this to you?

Axel.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Gour | 7 Apr 2008 20:41
Picon
Gravatar

Re: How to work with .po file

>>>>> "Axel" == Axel Simon <Axel.Simon <at> ens.fr> writes:

Hi Axel!

Axel> How important is this to you?

Let me say that with few devs we are starting to work on general Gtk2Hs
application and we expect to be able to make it properly 'translateable'.

Sincerely,
Gour

--

-- 

Gour  | Zagreb, Croatia  | GPG key: C6E7162D
----------------------------------------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Axel Simon | 8 Apr 2008 09:33
Picon
Picon
Favicon

Re: How to work with .po file

On Mon, 2008-04-07 at 20:41 +0200, Gour wrote:
> >>>>> "Axel" == Axel Simon <Axel.Simon <at> ens.fr> writes:
> 
> Hi Axel!
> 
> Axel> How important is this to you?
> 
> Let me say that with few devs we are starting to work on general Gtk2Hs
> application and we expect to be able to make it properly 'translateable'.

Hm, ok. Is it ok if *all* strings in a file are passed to gettext. The
problem with the ToString class is that you can't be selective as to
what gets passes to gettext.

A.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Gour | 8 Apr 2008 11:06
Picon
Gravatar

Re: How to work with .po file

>>>>> "Axel" == Axel Simon <Axel.Simon <at> ens.fr> writes:

Axel> Hm, ok. Is it ok if *all* strings in a file are passed to
Axel> gettext. The problem with the ToString class is that you can't be
Axel> selective as to what gets passes to gettext.

I'd say that Haskell (Gtk2Hs) should get/have proper gettext support so 
that one can use *.po editors.

What do you think?

Sincerely,
Gour

--

-- 

Gour  | Zagreb, Croatia  | GPG key: C6E7162D
----------------------------------------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Axel Simon | 8 Apr 2008 12:02
Picon
Picon
Favicon

Re: How to work with .po file

On Tue, 2008-04-08 at 11:06 +0200, Gour wrote:
> >>>>> "Axel" == Axel Simon <Axel.Simon <at> ens.fr> writes:
> 
> Axel> Hm, ok. Is it ok if *all* strings in a file are passed to
> Axel> gettext. The problem with the ToString class is that you can't be
> Axel> selective as to what gets passes to gettext.
> 
> I'd say that Haskell (Gtk2Hs) should get/have proper gettext support so 
> that one can use *.po editors.
> 
> What do you think?

Yes, I agree that we need some gettext support in the long run. The
question is how.

I've thought a bit more about using the new String class but it doesn't
seem to work since there is no way to hide the default instance of that
class from the Prelude (or wherever it is defined).

I see that there is already a gettext module in hackage:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/i18n-0.1.3

They use a monad which looks incredibly inconvenient to use in e.g.
callbacks. Maybe we should ask the maintainer if there is a more
lightweight solution he could add so that we recommend his package as
the way to internationalise Gtk2Hs applications.

Axel.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Kalman Noel | 7 Apr 2008 17:58
Favicon

Re: How to work with .po file

Axel Simon wrote:
> Gtk2Hs so far has not gettext support. There has been a package for
> gettext around but I don't think it's actively maintained. Since ghc 6.8
> there is a class called IsString with which one could implement a
> library that -- when loaded -- translates all string literals in the
> source code.

Using overloaded string literals for translated strings - an interesting
idea worth exploring.  For example, would there be a particular type
TranslatedString, or should any "" literal be subject to be translated?

Kalman

----------------------------------------------------------------------
Find out how you can get spam free email.
http://www.bluebottle.com/tag/3

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

Gmane