Re: gettext

2010-11-22 Thread Alexander Burger
Hi Christophe,

> The ,"" syntax feels great to me, but is it used for something else than tr=
> anslatable strings?

Currently not, AFAIK.

But in general this is possible. On the lowest level, the comma
read-macro in combination with the '*Uni' global variable is not more
than an application-controlled "interning" of transient symbols or other
(also non-symbolic) data structures.

It happens to be used in the GUI framework for localization purposes.
Other applications might use it for different purposes.

Note that even in an application using the GUI framework it is conceivable
to use it locally for other purposes, e.g. like

   (let *Uni NIL
  (read something with commas)
  (process Uni) )

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: gettext

2010-11-20 Thread Alexander Burger
Hi Christophe,

   Initial note, as I also just posted in IRC: People who cannot read
   the mail messed up by Yahoo, might want to issue:

  (in "file" (while (echo "=0A") (prinl)))

On Sat, Nov 20, 2010 at 02:40:04PM +, Christophe Gragnic wrote:
> Am I alone to like gettext 8-O ?

Many ideas employed by gettext are probably good and interesting.
Instead of directly using gettext, I would rather recommend to modify
'locale' (in "lib/misc.l") to handle some of gettext's features. For
example, the "loc/XX" files could be extended to use attributes.

On the source level, the syntax with the comma read macro

   ,"Translate me"

should be kept. I can't imagine anything cleaner and easier.


I would not want to change the official system now and immediately, as I
don't want to break existing applications ;-)

Thanks,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: gettext

2010-11-20 Thread Christophe Gragnic
--- En date de : Sam 20.11.10, Alexander Burger  a =E9=
crit :=0A=0A> I must confess I was not aware of GNU gettext. What=0A> advan=
tages would it have?=0A=0A=0A1) It's a widely used and trusted machinery.=
=0A2) Some tricky problems are dealt with, like plurals:=0A=0Ahttp://www.gn=
u.org/software/gettext/manual/gettext.html#Plural-forms=0A=0A3) There are m=
any softs that deal with editing translation files to ease=0Athe process fo=
r non techy people.=0A=0A=0A> As I see it, the '_' function in gettext is s=
yntactically=0A> equivalent to the Comma read macro in PicoLisp.=0A=0AChang=
ing "txt" to _("txt")  plays in fact two roles:=0A1) a marker to know which=
 strings should be translated at translation time,=0A2) transform the Engli=
sh string in the translated one at execution time.=0A=0ASome Lisp dialects =
use gettext with (_ "txt"), or even (_"txt") for EmacsLisp (if it's not a t=
ypo, one should confirm).=0Ahttp://www.gnu.org/software/automake/manual/get=
text/List-of-Programming-Languages.html=0AMaybe PicoLisp could use "_txt".=
=0AI don't know if transient symbols are sometimes prefixed with an undersc=
ore for another specific reason.=0AA nice trick would be to retrieve the tr=
anslations and load them into the transient symbols as usual, to avoid the =
(_ "txt") syntax.=0A=0A=0A> Maintaining the ".pot", ".po", ".mo"=0A> and wh=
atever files of gettext seems a more tedious to me.=0A=0AThis mess of files=
 is to me one of the biggest advantages. As I said earlier, there are many =
softs that deal specifically with this, for example for people not used to =
edit files directly.=0AAnd this system of template generation allows us to =
know what are the new strings to translate, the old ones to not translate..=
=0AAlso gettext is clever about strings that have been changed only slight=
ly, called FUZZY STRINGS.=0AFrom:=0Ahttp://www.gnu.org/software/gettext/man=
ual/gettext.html#Fuzzy-Entries=0A=0A"Those may be produced by applying the =
program msgmerge to update an older translated PO files according to a new =
PO template file, when this tool hypothesises that some new msgid has been =
modified only slightly out of an older one, and chooses to pair what it thi=
nks to be the old translation for the new modified entry. The slight altera=
tion in the original string (the msgid string) should often be reflected in=
 the translated string, and this requires the intervention of the translato=
r. For this reason, msgmerge might mark some entries as being fuzzy."=0A=0A=
In short, when you fix a typo in an original English string, gettext can st=
ill find the old translation and mark it something like: "Please update me"=
 It also keeps old translations to be reused if ever an old original strin=
gs comes back after a change.=0A=0AAm I alone to like gettext 8-O ?=0A=0A=
=0A  
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: gettext

2010-11-20 Thread Alexander Burger
Hi Christophe,

> Hi all, I was wondering if there was a way to use gettext to load the value=
> s of the transient symbols.=0AOr maybe you'll convince me that it is a bad =
> idea...=0A=0Achri=0A=0A=0A  

I must confess I was not aware of GNU gettext. What advantages would it
have?

As I see it, the '_' function in gettext is syntactically equivalent to
the Comma read macro in PicoLisp. Maintaining the ".pot", ".po", ".mo"
and whatever files of gettext seems a more tedious to me.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe