bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ordinal numbers


From: Chris Scaife
Subject: ordinal numbers
Date: Mon, 9 Aug 2010 17:05:32 +1200

Hi,

I have been studying internationalization with gettext and am writing
it up as tutorial which I hope to put on the web somewhere.

I have applied techniques for plurals to ORDINAL enumerations. I
believe these could be handled in all packages by placing them in
their own domain and by agreeing two simple coventions.

I am hoping official gettext gurus can endorse this idea or perhaps
steer me in the correct direction if there are other practices to
follow.

Summary of proposed conventions
-------------------------------

1. In source code (C domain) ordinals implemented with the text string
"°" and translated with dngettext().

e.g.

        for (int i = 1; i < 25; ++i) printf(
                gettext("In the human race you come in %d%s position!\n"),
                i, dngettext("_ordinal", "°","°", i)
        );

2. Each language (yes even English) to have it's own _ordinal.po file:

e.g.

# English translations for _ordinal package.
# Copyright (C) 2010 public domain
#
# chris scaife <address@hidden>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: 1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-08-09 14:00+1200\n"
"PO-Revision-Date: 2010-08-09 14:15+1200\n"
"Last-Translator: chris scaife <address@hidden>\n"
"Language-Team: English\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n+9)%10<3 && (n+90)%100>10 ? (n+9)%10 : 3;\n"


#: English ordinal numbers
msgid "°"
msgid_plural "°"
msgstr[0] "st"
msgstr[1] "nd"
msgstr[2] "rd"
msgstr[3] "th"

Observations
-----------

- Using the ordinal character ° as standard in C domain aims to
discourage programmed localization for English.

- I prepend an underscore on the _ordinal domain because it is general
purpose and don't want it conflicting with othere packages

- xgettext seems to extract the message for translation from dngettext
even though it is for a different domain. I think it might be better
to exclude those.

I would love to get feedback from the internationalization group on
this. Thanks in advance
Chris Scaife



reply via email to

[Prev in Thread] Current Thread [Next in Thread]