caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Printf and i18n
Date: Thu, 18 Apr 2002 10:27:34 +0200	[thread overview]
Message-ID: <20020418102734.H11492@verdot.inria.fr> (raw)
In-Reply-To: <20020418100241.B2735@fr.thalesgroup.com>; from jerome.marant@fr.thalesgroup.com on Thu, Apr 18, 2002 at 10:02:42AM +0200

Hi,

On Thu, Apr 18, 2002 at 10:02:42AM +0200, Jérôme Marant wrote:

>   By the way, in order to improve the localization process, we would need
>   to add the "argument reordering" feature to printf functions.
>   For instance, with: 
> 
>   printf " %2$d %1$s" "foo" 1

I have something like that, indeed. It is also John Prevost's remark.
For that I use the same system of lexicon, but I don't use printf, but
just print_string for this kind of phrases.

I have specific functions to translate that sort of cases. The string
is scanned by an automat to build the resulting string.

I have as example in my lexicon:

       %1 of %2
   cs: %1 :g:%2
   de: %1 von :d:%2
   en: %2's %1
   fr: %1 d[e']%2
   it: %1 d[i']%2
   pl: %1 :g:%2

There is also some system for elision (before vowels), in French and
in Italian. In French, to translate "Adam's car", you have "la voiture
d'Adam", not "la voiture de Adam".

And there is a system of declination in German and Polish. The :g:
introduces the genitive case for the next phrase. And I have a system
to indicate genitive cases for the other terms.

Another case, the way dates are printed:

       (date)
   cs: 1. %m %y/%d. %m %y/%m %y/%y
   de: 1. %m %y/%d. %m %y/%m %y/%y
   en: 1 %m %y/%d %m %y/%m %y/%y
   fr: 1er %m %y/%d %m %y/%m %y/%y
   it: 1o %m %y/%d %m %y/%m %y/%y
   pl: 1 %m %y/%d %m %y/%m %y/%y

%m = month, %y = year %d = day

The slash separate the cases:
   first in the month
   other in the month
   date when there is only month and year
   date when there is only year

Of course, in all these examples, printf does not work: you have to
apply print_string, or printf "%s"

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
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


  parent reply	other threads:[~2002-04-18  8:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-17 17:37 Jérôme Marant
2002-04-17 17:53 ` [Caml-list] Modular subject-observer pattern ? Pascal Grossé
2002-04-18  6:47 ` [Caml-list] Printf and i18n Daniel de Rauglaudre
2002-04-18  8:01   ` John Prevost
2002-04-18  8:02   ` Jérôme Marant
2002-04-18  8:13     ` Jacques Garrigue
2002-04-18  8:17       ` Chris Hecker
2002-04-18  8:21       ` Jérôme Marant
2002-04-18  8:27     ` Daniel de Rauglaudre [this message]
2002-04-18  9:33       ` Jérôme Marant
2002-04-18 10:40         ` Daniel de Rauglaudre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020418102734.H11492@verdot.inria.fr \
    --to=daniel.de_rauglaudre@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).