Skip to main content

z3locales

The code is distributed under terms of the Zope Public License version 2.1. See also LICENSE.txt.

Z3locales is a library which translates dates in Zope 2 to the current user language using Zope 3 technology.

Those functions are available in the module localdatetime:

get_formatted_now(request)

Return the current date formatted and translated in the current user language. The target user language is determined via the provided request.

get_formatted_date(date, size="full", request=_marker, locale=_marker, display_time=True)

Take a date (should be a tuple (year, month, day[, hour[, minute[, second]]]) or a Python datetime object), format it and translate it in the target user language (determined via locale or the given request). The modifier size and display_time can be used to change the output.

get_month_names(request=_marker, locale=_marker, calendar='gregorian')

Return a list of month names translated in the target language (determined via locale or the given request).

get_month_abbreviations(request=_marker, locale=_marker, calendar='gregorian')

Return a list of month abbreviations (usually the first three letters) translated in the target user language (determined via locale or the given request).

get_locale_info(request)

Return the locale representing the target user language using the provided request. This locale can be used after by other functions of this package.

Compatibility API exists with previous versions.

Changes

0.4.1 (2013-05-13)

  • Fallback to english if the local that is asked is not available.

0.4 (2012-09-03)

  • Use local information from Zope API’s getPreferredLanguages when no specific local is given.

0.3 (2010-10-06)

  • Refactor API to factorize needed computation. The API changed to be compatible PEP8.

0.2 (2008-09-25)

  • First release as an egg.

  • Use zope.i18n as a dependencies, not having a local copy of it.

Metadata

Release files for z3locales 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for z3locales 0.4.1
File Size Uploaded Provenance Actions
z3locales-0.4.1.tar.gz 4.2 kB Without provenance Details for z3locales-0.4.1.tar.gz

Release files / z3locales-0.4.1.tar.gz

Download URL z3locales-0.4.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
02f823d6ce5c2acd74b0883df72b8dc942a9cf0bbe1e967ff97520fa5988c948
BLAKE2b-256 checksum
How to use checksums
4f07df846482879a9bb381f32eb80b59acf01d8dd7afbbf4a55edeb8b7ecf295
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for z3locales 0.4.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page