PyAMS internationalization¶
+ +Subpackages¶
+ +Submodules¶
+pyams_i18n.attr module¶
+-
+
-
+class
pyams_i18n.attr.
I18nAttributeAdapter
(context)¶
+ Bases:
+pyams_utils.adapter.ContextAdapter
I18n attribute adapter
+-
+
-
+
get_attribute
(attribute, lang=None, request=None, default=None)¶
+
-
+
-
+
query_attribute
(attribute, lang=None, request=None)¶
+
-
+
-
+
-
+class
pyams_i18n.attr.
I18nAttributeTraverser
(context)¶
+ Bases:
+pyams_utils.adapter.ContextAdapter
++i18n++attr:lang namespace traverser
+-
+
-
+
traverse
(name, furtherpath=None)¶
+
-
+
pyams_i18n.column module¶
+ + +pyams_i18n.content module¶
+-
+
-
+class
pyams_i18n.content.
I18nManagerMixin
¶
+ Bases:
+object
I18n manager class mixin
+-
+
-
+
get_languages
()¶
+
-
+
-
+
languages
¶
+ Computed attributes based on schema fields
+Field properties provide default values, data validation and error messages +based on data found in field meta-data.
+Note that FieldProperties cannot be used with slots. They can only +be used for attributes stored in instance dictionaries.
+
-
+
pyams_i18n.expr module¶
+-
+
-
+class
pyams_i18n.expr.
I18nExpr
(expression, braces_required=False)¶
+ Bases:
+pyams_utils.tales.ContextExprMixin
,chameleon.tales.StringExpr
i18n:context.attribute TALES expression
+-
+
-
+
transform
= <Symbol value=<function render_i18n_expression> at 7fe7830305c0>¶
+
-
+
-
+
-
+
pyams_i18n.expr.
render_i18n_expression
(econtext, name)¶
+ Render an I18n expression
+Value can be given as a single attribute name (for example: “i18n:title”), in which case value +is extracted from current “context”. +But value can also be given as a dotted name, for example “i18n:local_var.property.title”.
+
pyams_i18n.include module¶
+-
+
-
+
pyams_i18n.include.
include_package
(config)¶
+ Pyramid package include
+
pyams_i18n.index module¶
+-
+
-
+class
pyams_i18n.index.
I18nTextIndexMixin
(language, interface=None)¶
+ Bases:
+hypatia.util.BaseIndexMixin
I18n text index mixin
+-
+
-
+
discriminate
(obj, default)¶
+
-
+
-
+
-
+class
pyams_i18n.index.
I18nTextIndexWithInterface
(language, discriminator, interface=None, lexicon=None, index=None, family=None)¶
+ Bases:
+pyams_i18n.index.I18nTextIndexMixin
,hypatia.text.TextIndex
I18n text index
+
pyams_i18n.language module¶
+-
+
-
+class
pyams_i18n.language.
BaseLanguagesVocabulary
(*args, **kw)¶
+ Bases:
+zope.schema.vocabulary.SimpleVocabulary
Base languages vocabulary, matching ISO 639-1 languages codes
+
-
+
-
+class
pyams_i18n.language.
ISOLanguagesVocabulary
(*args, **kw)¶
+ Bases:
+zope.schema.vocabulary.SimpleVocabulary
pyams_i18n.negotiator module¶
+-
+
-
+class
pyams_i18n.negotiator.
Negotiator
¶
+ Bases:
+persistent.Persistent
,zope.container.contained.Contained
Language negotiator utility
+-
+
-
+
cache_enabled
¶
+ Computed attributes based on schema fields
+Field properties provide default values, data validation and error messages +based on data found in field meta-data.
+Note that FieldProperties cannot be used with slots. They can only +be used for attributes stored in instance dictionaries.
+
-
+
-
+
clear_cache
(request)¶
+ Clear cached language value
+
-
+
-
+
get_language
(request)¶
+ - +
-
+
-
+
offered_languages
¶
+ Computed attributes based on schema fields
+Field properties provide default values, data validation and error messages +based on data found in field meta-data.
+Note that FieldProperties cannot be used with slots. They can only +be used for attributes stored in instance dictionaries.
+
-
+
-
+
policy
¶
+ Computed attributes based on schema fields
+Field properties provide default values, data validation and error messages +based on data found in field meta-data.
+Note that FieldProperties cannot be used with slots. They can only +be used for attributes stored in instance dictionaries.
+
-
+
-
+
server_language
¶
+ Computed attributes based on schema fields
+Field properties provide default values, data validation and error messages +based on data found in field meta-data.
+Note that FieldProperties cannot be used with slots. They can only +be used for attributes stored in instance dictionaries.
+
-
+
-
+
-
+class
pyams_i18n.negotiator.
ZopeNegotiator
¶
+ Bases:
+object
Zope language negotiator
+-
+
-
+
getLanguage
(langs, env)¶
+
-
+
-
+
-
+
pyams_i18n.negotiator.
get_locale
(request)¶
+ Get zope.i18n locale attribute
+
-
+
-
+
pyams_i18n.negotiator.
locale_negotiator
(request)¶
+ Negotiate language based on server, browser and user settings
+
pyams_i18n.property module¶
+-
+
-
+class
pyams_i18n.property.
I18nFileProperty
(field, name=None, klass=None, **args)¶
+ Bases:
+object
I18n property class used to handle files
+
pyams_i18n.schema module¶
+-
+
-
+class
pyams_i18n.schema.
DefaultValueDict
(default=None, *args, **kwargs)¶
+ Bases:
+persistent.mapping.PersistentMapping
Persistent mapping with default value
+-
+
-
+
copy
()¶
+
-
+
-
+
get
(key, default=None)¶
+
-
+
-
+
-
+class
pyams_i18n.schema.
I18nAudioField
(key_type=None, value_type=None, value_min_length=None, value_max_length=None, **kwargs)¶
+ Bases:
+pyams_i18n.schema.I18nMediaField
I18n audio field
+
-
+
-
+class
pyams_i18n.schema.
I18nField
(key_type=None, value_type=None, **kwargs)¶
+ Bases:
+zope.schema._field.Dict
I18n base field class
+
-
+
-
+class
pyams_i18n.schema.
I18nFileField
(key_type=None, value_type=None, value_min_length=None, value_max_length=None, **kwargs)¶
+ Bases:
+pyams_i18n.schema.I18nField
I18n file field
+
-
+
-
+class
pyams_i18n.schema.
I18nHTMLField
(key_type=None, value_type=None, default=None, value_constraint=None, value_min_length=0, value_max_length=None, **kwargs)¶
+ Bases:
+pyams_i18n.schema.I18nField
I18n HTML field
+
-
+
-
+class
pyams_i18n.schema.
I18nImageField
(key_type=None, value_type=None, value_min_length=None, value_max_length=None, **kwargs)¶
+ Bases:
+pyams_i18n.schema.I18nMediaField
I18n image field
+
-
+
-
+class
pyams_i18n.schema.
I18nMediaField
(key_type=None, value_type=None, value_min_length=None, value_max_length=None, **kwargs)¶
+ Bases:
+pyams_i18n.schema.I18nFileField
I18n media field
+
-
+
-
+class
pyams_i18n.schema.
I18nTextField
(key_type=None, value_type=None, default=None, value_constraint=None, value_min_length=0, value_max_length=None, **kwargs)¶
+ Bases:
+pyams_i18n.schema.I18nField
I18n text field
+
-
+
-
+class
pyams_i18n.schema.
I18nTextLineField
(key_type=None, value_type=None, default=None, value_constraint=None, value_min_length=0, value_max_length=None, **kwargs)¶
+ Bases:
+pyams_i18n.schema.I18nField
I18n text line field
+
-
+
-
+class
pyams_i18n.schema.
I18nThumbnailImageField
(key_type=None, value_type=None, value_min_length=None, value_max_length=None, **kwargs)¶
+ Bases:
+pyams_i18n.schema.I18nImageField
I18n thumbnail image field
+
-
+
-
+class
pyams_i18n.schema.
I18nVideoField
(key_type=None, value_type=None, value_min_length=None, value_max_length=None, **kwargs)¶
+ Bases:
+pyams_i18n.schema.I18nMediaField
I18n video field
+
pyams_i18n.site module¶
+-
+
-
+class
pyams_i18n.site.
I18nGenerationsChecker
¶
+ Bases:
+object
I18n generations checker
+-
+
-
+
evolve
(site, current=None)¶
+ Check for required utilities
+
-
+
-
+
generation
= 1¶
+
-
+
-
+
-
+
pyams_i18n.site.
handle_new_local_site
(event)¶
+ Create a new negotiator when a site is created
+
pyams_i18n.vocabulary module¶
+-
+
-
+class
pyams_i18n.vocabulary.
I18nContentLanguages
(context)¶
+ Bases:
+zope.schema.vocabulary.SimpleVocabulary
I18n content languages vocabulary
+
-
+
-
+class
pyams_i18n.vocabulary.
I18nOfferedLanguages
(context)¶
+ Bases:
+zope.schema.vocabulary.SimpleVocabulary
I18n offered languages vocabulary
+