This project has been archived by its maintainers, and is no longer receiving any updates.
This package provides additional I18n and L10n features. In particular it provides an API to compute the time duratrions over various timezones.
Detailed Dcoumentation
Time Duration Computation
The duration format code is not ideal, but as the code notes, the icu library does not appear to support internationalizing dates. Therefore, this approach tries to get close enough to be flexible enough for most localization. Only time, and localizers, will tell if it is a reasonable approach.
The formatter always gives the first two pertinent measures of a duration, leaving off the rest. The rest of the file just shows some examples.
>>> from zc.i18n.duration import format >>> from zope.publisher.browser import TestRequest >>> request = TestRequest() >>> from datetime import timedelta >>> format(request, timedelta(days=5)) u'5 days ' >>> format(request, timedelta(days=1)) u'1 day ' >>> format(request, timedelta(days=1, hours=13, minutes=12)) u'1 day 13 hours ' >>> format(request, timedelta(hours=13, minutes=12)) u'13 hours 12 minutes ' >>> format(request, timedelta(hours=13)) u'13 hours ' >>> format(request, timedelta(hours=1, minutes=1, seconds=1)) u'1 hour 1 minute ' >>> format(request, timedelta(minutes=45, seconds=1)) u'45 minutes 1 second' >>> format(request, timedelta(seconds=5)) u'5 seconds' >>> format(request, timedelta(days=-1, hours=-2)) u'-1 day -2 hours ' >>> format(request, timedelta(days=-2, hours=22)) u'-1 day -2 hours ' >>> format(request, timedelta(days=-1)) u'-1 day ' >>> format(request, timedelta(days=-1, hours=-13, minutes=-12)) u'-1 day -13 hours ' >>> format(request, timedelta(hours=-13, minutes=-12)) u'-13 hours -12 minutes ' >>> format(request, timedelta(hours=-13)) u'-13 hours ' >>> format(request, timedelta(hours=-1, minutes=-1, seconds=-1)) u'-1 hour -1 minute ' >>> format(request, timedelta(minutes=-45, seconds=-1)) u'-45 minutes -1 second' >>> format(request, timedelta(seconds=-5)) u'-5 seconds' >>> format(request, timedelta()) u'No time'
CHANGES
0.7.0 (2009-07-24)
Fixed tests to work with latest package versions.
The buildout now also pulls in the test extras, which is required.
0.6.1 (2008-05-20)
No code changes, and only a very minor documentation tweak. Re-released to avoid confusion over package versions found in the wild.
0.5.2 (2007-11-03)
Improve package data.
0.5.1 (2006-05-24)
Package data update.
0.5.0 (2006-05-24)
Initial release.
Metadata
Release files for zc.i18n 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zc.i18n-0.7.0.tar.gz | 8.1 kB | Without provenance | Details for zc.i18n-0.7.0.tar.gz |
Release files / zc.i18n-0.7.0.tar.gz
| Download URL | zc.i18n-0.7.0.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3dcb3912ac0cf64b03f9578998e6db329da83bb563ddc067b10e1aa2d230f16
|
|
BLAKE2b-256 checksum How to use checksums |
c6b04a239fbd48d0760c5a2327dfc6821c21076d1150977b9c978f4cce615647
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for zc.i18n 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.