Hi,
I18N is nicely described here: http://www.djangoproject.com/documentation/i18n/
Basically you need to mark any strings as _(original string), eg.:
return _('%.1f million') % (value / 1000000.0)
However there is one BIG issue with humanize - it pretty fits English,
but not other languages, that are more complex than English.
Eg. function ordinal - in English you get 1st, or 2nd, etc.
In Czech I can use either word representations: 1 = > first, 3=> third
etc. - which is not the meaning of this function, I believe. Or I can
use easy representation, such as:
1=> 1.
3 => 3.
In the latter case the ordinal function for Czech would look like:
def ordinal(value):
return '%d.' % (value)
For Czech, function intcomma could be used, we just use dot exchanged
with comma. This can be accomplished by the mentioned _(). And other
languages might be using even different separator (eg. space).
Therefore this function should be renamed. I propose to "intseparator"
or more exactly "thousandseparator".
intword is easy to be "translated" using _()
appnumber is not that easy though. In English you just use "two" for
anything that counts to 2. In Czech we differentiate by gender. For
example we say "dva muzi ~ two men" and "dve zeny ~ two women". Word
"dva" representing 2 changes.
Radek
On 7/23/06, jws <[EMAIL PROTECTED]> wrote:
>
> The humanize middleware provides filters to pretty-print numbers with
> commas and such. I was about to add filters for dates when it occured
> to me that it should reflect I18N to to show proper US/Euro dates, etc.
>
> Before I spend time on it, can we discuss how this should work in
> Django? I currently have no knowledge of I18N.
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django I18N" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/Django-I18N
-~----------~----~----~----~------~----~------~--~---