A component is a translatable resource.
Clear the local cache of the component.
Delete statistics, teardown repo, remove static dir, rest unit.
Abstract unit.prepare().
This function creates/updates the Component local repository and then unset the TransHandler property cache for it be created again, with a new set of files, next time that it will be used.
Associate a unit with this component.
Another place the same functionality happens is when the Component form is saved.
A project is a group of translatable resources.
>>> p = Project.objects.create(slug="foo", name="Foo Project")
>>> p = Project.objects.get(slug='foo')
>>> p
<Project: Foo Project>
>>> Project.objects.create(slug="foo", name="Foo Project")
Traceback (most recent call last):
...
IntegrityError: column slug is not unique
>>> p.delete()
A release of a project, as in ‘a set of specific components’.
Represents the packaging and releasing of a software project (big or small) on a particular date, for which makes sense to track translations across the whole release.
Examples of Releases is Transifex 1.0, GNOME 2.26, Fedora 10 etc.
Cached property.
This function is able to verify if an instance of a property field was already created before and, if not, it creates the new one. When needed it also is able to delete the cached property field from the memory.
Usage: @cached_property def trans(self):
...
del(self.trans)
Override default feed, using custom (including inexistent) slug.
Provides the functionality needed to decouple the Feed’s slug from the urlconf, so a feed mounted at “^/feed” can exist.
Return an appropriate TransHandler class.
TransHandler is chosen depending on the component translation type.
It will raise an exception if the Translation type is not specified.
Keyword arguments: i18n_type – The type of the TransHandler, used to decide the class to be returned.
>>> print get_trans_handler('POT')
projects.handlers.trans_handler.TransHandler
POTManager abstraction layer, specific to the projects app.
You can use this higher-level object to interact with a component’s statistics instead of meddling with the lower- level POTManager. Each Component object gets one of these as component.trans.
Clean old stats present on the database and msgmerge directory.
Useful for removing files that are not present in the upstream repository anymore.
POTHandler abstraction layer, hense specific to the projects app.
You can use this higher-level object to interact with a component’s statistics that use intltool instead of meddling with the lower-level POTManager. Each Component object gets one of these as component.trans.
Mar 02, 2010