Re: Plural forms: argument selection.
- From: Liam R E Quin <liam holoweb net>
- To: Djihed Afifi <djihedlists googlemail com>
- Cc: gnome-devel-list gnome org
- Subject: Re: Plural forms: argument selection.
- Date: Thu, 27 Jul 2006 18:56:32 -0400
On Sat, 2006-07-22 at 12:54 +0100, Djihed Afifi wrote:
> Suppose the string:
> "There are %d files in directory %s".
>
> In arabic, for some plural forms, it would make more sense to omit %d
> and express it by words. By saying "more sense", I mean it would stand
> up as particularly inappropriate and inaccurate to include the number.
> Putting the number in parenthesis would be less than elegant.
There are other language problems with "%d files", one of which being
that
in Russian (as I recall) "files" needs to spelt differently for numbers
from 1 to 5... sort of like ordinals (1st, 2nd, 3rd, 4th etc.) in
English.
The solution is probably not to use clever tricks with printf and $n,
but to have a text substitution library that can be taught to do "the
right thing". In some languages, the spelling of numerals may also
depend on the grammatical gender of the governed noun, e.g. for
ordinals in French and Italian.
Few programmers would write:
The %dth filename doesn't match any file
because "the 1th filename" looks obviously silly in English.
You still come across people writing
%d file(s) was/were not found.
In this case, 3 strings can be used:
no files were found
one file was found
%d files were found
but this doesn't work for Russian.
A more powerful expression language might work, and then maybe
you could write a numbers-to-words function for your language...
maybe one that could also get the surrounding textual changes right.
Liam
--
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]