This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description


This cube provides a way to manage and display entity field (attribute) translations, stored in the application database.

To achieve this for your particular entity type, you have to:

  • add an ‘i18nfield_of’ relation definition, linking from the ‘I18nField’ entity type to your translatable entity type(s)
  • add a ‘ref_lang’ relation definition, linking from your entity types to the ‘I18nLang’ entity type
  • make your business entity type inherit the ‘TranslatableEntityMixin’ and list its translatable fields in its ‘i18nfields’ attribute
  • create a simple adapter that inherits ‘_TranslatableEntityAdapter’ and is selectable for your translatable entity types

That’s all for the code part. Just add at least one I18nLang instance in your database and link your translatable entities to their reference language.

The default web UI will then display a new ‘translations’ action menu to users who can modify translatable entities, and display your translatable entities in the web request language by default.


If you want to translate all fields of the Card entity type (from the ‘card’ cube), you will need in your file:

from yams.buildobjs import RelationDefinition

class i18nfield_of(RelationDefinition):
    subject = 'I18nField'
    object = 'Card'
    cardinality = '1*'
    composite = 'object'

class ref_lang(RelationDefinition):
    subject = 'Card'
    object = 'I18nLang'
    cardinality = '1*'
    inlined = True

And in the file:

from cubicweb.selectors import is_instance

from cubes.card.entities import Card as OrigCard
from cubes.i18nfield.entities import (TranslatableEntityMixin,

class Card(TranslatableEntityMixin, OrigCard):
    i18nfields = (u'title', u'synopsis', u'content')

    def dc_title(self):
        return self.printable_value('title', format='text/plain')

class MyTranslatableEntityAdapter(_TranslatableEntityAdapter):
    __select__ = _TranslatableEntityAdapter.__select__ & is_instance('Card')
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cubicweb-i18nfield-0.1.0.tar.gz (15.2 kB) Copy SHA256 Checksum SHA256 Source Oct 24, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting