diff --git a/i18n/ckanext-harvest.pot b/ckanext/harvest/i18n/ckanext-harvest.pot similarity index 100% rename from i18n/ckanext-harvest.pot rename to ckanext/harvest/i18n/ckanext-harvest.pot diff --git a/i18n/sv/LC_MESSAGES/ckanext-harvest.mo b/ckanext/harvest/i18n/sv/LC_MESSAGES/ckanext-harvest.mo similarity index 100% rename from i18n/sv/LC_MESSAGES/ckanext-harvest.mo rename to ckanext/harvest/i18n/sv/LC_MESSAGES/ckanext-harvest.mo diff --git a/i18n/sv/LC_MESSAGES/ckanext-harvest.po b/ckanext/harvest/i18n/sv/LC_MESSAGES/ckanext-harvest.po similarity index 100% rename from i18n/sv/LC_MESSAGES/ckanext-harvest.po rename to ckanext/harvest/i18n/sv/LC_MESSAGES/ckanext-harvest.po diff --git a/ckanext/harvest/plugin.py b/ckanext/harvest/plugin.py index 890a6ce..94eb287 100644 --- a/ckanext/harvest/plugin.py +++ b/ckanext/harvest/plugin.py @@ -7,6 +7,12 @@ from ckan import logic from ckan import model import ckan.plugins as p from ckan.lib.plugins import DefaultDatasetForm +try: + from ckan.lib.plugins import DefaultTranslation +except ImportError: + class DefaultTranslation(): + pass + from ckan.lib.navl import dictization_functions from ckanext.harvest import logic as harvest_logic @@ -15,12 +21,14 @@ from ckanext.harvest.model import setup as model_setup from ckanext.harvest.model import HarvestSource, HarvestJob, HarvestObject + log = getLogger(__name__) assert not log.disabled DATASET_TYPE_NAME = 'harvest' -class Harvest(p.SingletonPlugin, DefaultDatasetForm): + +class Harvest(p.SingletonPlugin, DefaultDatasetForm, DefaultTranslation): p.implements(p.IConfigurable) p.implements(p.IRoutes, inherit=True) @@ -31,6 +39,9 @@ class Harvest(p.SingletonPlugin, DefaultDatasetForm): p.implements(p.IPackageController, inherit=True) p.implements(p.ITemplateHelpers) p.implements(p.IFacets, inherit=True) + if p.toolkit.check_ckan_version(min_version='2.5.0'): + p.implements(p.ITranslation, inherit=True) + startup = False