caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pixel <pixel@mandrakesoft.com>
To: "Jérôme Marant" <jerome.marant@free.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] printf and scanf
Date: 02 May 2002 18:11:24 +0200	[thread overview]
Message-ID: <lyit66r0lv.fsf@leia.mandrakesoft.com> (raw)
In-Reply-To: <20020502102557.A1696@fr.thalesgroup.com>

Jérôme Marant <jerome.marant@free.fr> writes:

> I've been giving the following example for quite long now: languages
> do not always order words the same way. So, sometimes, you need to
> reorder parameters in translated strings in order to get a correct
> syntax in the targeted language. With printf, you can do it this way:
> 
> fr: " %s %d"
> 
> string -> int
> 
> de: " %2$s %1$d"
> 
> int -> string
> 
> This example shows that if you want a full featured internationalisation,
> you cannot state that "you know the type you expect" since you will only
> determine it at run-time.

this only shows that " %2$s %1$d" is not a valid translation of " %s %d",
since they do not have the same type, and would fail at runtime (using this in
C would give you a segfault).

" %2$d %1$s" with type "string -> int" is a valid translation of " %s %d"

this means that not checking the translations could lead to a hole in the type
system, and so printf must be prepared to detect type errors (which it
currently does :)
-------------------
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


  reply	other threads:[~2002-05-02 16:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-01 18:00 Francois-Rene Rideau
2002-05-02  8:25 ` Jérôme Marant
2002-05-02 16:11   ` Pixel [this message]
2002-05-02 17:50     ` Jérôme Marant
2002-05-02 17:09   ` John Prevost
2002-05-02 17:52     ` Jérôme Marant
  -- strict thread matches above, loose matches on Subject: below --
2002-04-30 13:51 Francois-Rene Rideau
2002-05-01 16:06 ` Jérôme Marant
2002-05-02  6:55 ` Francois Pottier

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=lyit66r0lv.fsf@leia.mandrakesoft.com \
    --to=pixel@mandrakesoft.com \
    --cc=caml-list@inria.fr \
    --cc=jerome.marant@free.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).