nti.i18n

https://travis-ci.org/NextThought/nti.i18n.svg?branch=master https://coveralls.io/repos/github/NextThought/nti.i18n/badge.svg?branch=master Documentation Status

nti.i18n offers a small set of data and classes to support internationalization and localization in a generic Zope3/ZCA environment.

nti.i18n was heavily influenced by plone.i18n prior to version 3.

For complete details and the changelog, see the documentation.

Contents:

API Reference

This document details the API for nti.i18n.

Interfaces

Interfaces related to internationalization.

Locales

Interfaces

Interfaces related to localization.

interface nti.i18n.locales.interfaces.ICcTLDInformation

Extends: plone.i18n.locales.interfaces.ICcTLDInformation

A list of country code top level domains and their relevant languages (when known).

getTLDs()

Return a dictionary of known ccTLDs and their languages.

getAvailableTLDs()

Return a sequence of country code top level domains.

getLanguagesForTLD(tld)

Return the relevant languages for a top level domain as a sequence.

interface nti.i18n.locales.interfaces.ICountryAvailability

Extends: plone.i18n.locales.interfaces.ICountryAvailability

A list of available coutries.

getAvailableCountries()

Return a sequence or view of unicode country tags for available countries.

getCountryListing()

Return a sequence of unicode country code and country name tuples.

getCountries()

Return a dictionary mapping country tags to country data.

Country data has at least the ‘name’ key.

Implementations

Implementation of country data.

class nti.i18n.locales.countries.CountryAvailability

Bases: object

Default implementation of country availability, based on countries.json distributed with this package.

Implementation of country-code language information.

class nti.i18n.locales.cctld.CcTLDInformation

Bases: object

A list of country code top level domains their relevant languages.

Descriptions for most TLDs a can be found at http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains

Changes

1.0.0 (2017-07-06)

  • Initial PyPI release. This implements a subset of the plone.i18n APIs (not including flag resources) but with updated data and reduced dependencies.
  • Python 3 and PyPy compatibility.
  • Data live in external files so that they are hopefully easier to update.

Indices and tables