diff --git a/.travis.yml b/.travis.yml index 320c825c..40173d69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,22 @@ language: python + +# the new trusty images of Travis cause build errors with psycopg2, see https://github.com/travis-ci/travis-ci/issues/8897 +dist: trusty +group: deprecated-2017Q4 + python: - - "2.6" - "2.7" env: - - PGVERSION=9.1 CKANVERSION=master - - PGVERSION=9.1 CKANVERSION=2.3 - - PGVERSION=9.1 CKANVERSION=2.4.0 + - CKANVERSION=master + - CKANVERSION=2.7 + - CKANVERSION=2.6 + - CKANVERSION=2.5 + - CKANVERSION=2.4 + - CKANVERSION=2.3 install: - bash bin/travis-build.bash - - pip install coveralls +services: + -postgresql script: sh bin/travis-run.sh -after_success: - - coveralls +after_success: coveralls +sudo: required diff --git a/MANIFEST.in b/MANIFEST.in index 958649bf..39d05376 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include README.rst -recursive-include ckanext/showcase *.html *.json *.js *.less *.css \ No newline at end of file +recursive-include ckanext/showcase *.html *.json *.js *.less *.css +recursive-include ckanext/showcase/i18n * diff --git a/README.rst b/README.rst index 3a63843a..3ccceac9 100644 --- a/README.rst +++ b/README.rst @@ -5,12 +5,12 @@ .. image:: https://travis-ci.org/ckan/ckanext-showcase.svg?branch=master :target: https://travis-ci.org/ckan/ckanext-showcase -.. image:: https://coveralls.io/repos/ckan/ckanext-showcase/badge.png?branch=master - :target: https://coveralls.io/r/ckan/ckanext-showcase?branch=master +.. image:: https://coveralls.io/repos/ckan/ckanext-showcase/badge.svg + :target: https://coveralls.io/r/ckan/ckanext-showcase -============= +================ ckanext-showcase -============= +================ Showcase and link to datasets in use. Datasets used in an app, website or visualization, or featured in an article, report or blog post can be showcased @@ -30,9 +30,13 @@ ckanext-showcase is intended to be a more powerful replacement for the Requirements ------------ -Current status: Beta -Compatible with CKAN 2.3. +Compatible with CKAN 2.3+. + +N.B. The ``migrate`` command, detailed below, requires the Related Item models +and actions, which have been removed in CKAN 2.6. If you wish to migrate your +Related Items, please first upgrade CKAN to 2.5, do the migration, then +continue upgrading to CKAN 2.6+. ------------ @@ -135,7 +139,11 @@ From the ``ckanext-showcase`` directory:: paster showcase migrate -c {path to production.ini} Note that each Related Item must have a unique title before migration can -proceed. +proceed. If you prefer resolving duplicates as showcases, you can use the --allow-duplicates +option to migrate them anyways. Duplicate Relations will be created as +'duplicate_' + original_related_title + '_' + related_id + + paster showcase migrate -c {path to production.ini} --allow-duplicates The Related Item property ``type`` will become a Showcase tag. The Related Item properties ``created``, ``owner_id``, ``view_count``, and ``featured`` have no @@ -157,9 +165,9 @@ coverage installed in your virtualenv (``pip install coverage``) then run:: nosetests --ckan --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.showcase --cover-inclusive --cover-erase --cover-tests ---------------------------------- +------------------------------------ Registering ckanext-showcase on PyPI ---------------------------------- +------------------------------------ ckanext-showcase should be availabe on PyPI as https://pypi.python.org/pypi/ckanext-showcase. If that link doesn't work, then @@ -186,9 +194,9 @@ steps: git push --tags ----------------------------------------- +------------------------------------------- Releasing a New Version of ckanext-showcase ----------------------------------------- +------------------------------------------- ckanext-showcase is availabe on PyPI as https://pypi.python.org/pypi/ckanext-showcase. To publish a new version to PyPI follow these steps: @@ -211,3 +219,22 @@ To publish a new version to PyPI follow these steps: git tag 0.0.2 git push --tags + + +------------------------------------------- +i18n +------------------------------------------- + +See: "Internationalizing strings in extensions" : http://docs.ckan.org/en/latest/extensions/translating-extensions.html + +1. Install babel + + pip install Babel + +2. Init Catalog for your language + + python setup.py init_catalog -l es + +3. Compile your language catalog ( You can force pybabel compile to compile messages marked as fuzzy with the -f) + + python setup.py compile_catalog -f -l es diff --git a/bin/travis-build.bash b/bin/travis-build.bash index 9abb610d..8c6136c1 100644 --- a/bin/travis-build.bash +++ b/bin/travis-build.bash @@ -5,16 +5,18 @@ echo "This is travis-build.bash..." echo "Installing the packages that CKAN requires..." sudo apt-get update -qq -sudo apt-get install postgresql-$PGVERSION solr-jetty libcommons-fileupload-java:amd64=1.2.2-1 +sudo apt-get install solr-jetty libcommons-fileupload-java echo "Installing CKAN and its Python dependencies..." git clone https://github.com/ckan/ckan cd ckan -if [ $ CKANVERSION == '2.3'] +if [ $CKANVERSION == 'master' ] then - git checkout release-v2.3 + echo "CKAN version: master" else - git checkout master + CKAN_TAG=$(git tag | grep ^ckan-$CKANVERSION | sort --version-sort | tail -n 1) + git checkout $CKAN_TAG + echo "CKAN version: ${CKAN_TAG#ckan-}" fi python setup.py develop pip install -r requirements.txt --allow-all-external @@ -30,12 +32,12 @@ cd ckan paster db init -c test-core.ini cd - -echo "Installing ckanext-ckanext-showcase and its requirements..." +echo "Installing ckanext-showcase and its requirements..." python setup.py develop pip install -r dev-requirements.txt echo "Moving test.ini into a subdir..." mkdir subdir -mv test.ini subdir +mv test-travis.ini subdir echo "travis-build.bash is done." diff --git a/bin/travis-run.sh b/bin/travis-run.sh index 1c5026bb..d3f36649 100644 --- a/bin/travis-run.sh +++ b/bin/travis-run.sh @@ -3,4 +3,4 @@ echo "NO_START=0\nJETTY_HOST=127.0.0.1\nJETTY_PORT=8983\nJAVA_HOME=$JAVA_HOME" | sudo tee /etc/default/jetty sudo cp ckan/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml sudo service jetty restart -nosetests --ckan --nologcapture --with-pylons=subdir/test.ini --with-coverage --cover-package=ckanext.showcase --cover-inclusive --cover-erase --cover-tests +nosetests --ckan --nologcapture --with-pylons=subdir/test-travis.ini --with-coverage --cover-package=ckanext.showcase --cover-inclusive --cover-erase --cover-tests diff --git a/ckanext/showcase/commands/migrate.py b/ckanext/showcase/commands/migrate.py index 8c2fcd84..a40a0559 100644 --- a/ckanext/showcase/commands/migrate.py +++ b/ckanext/showcase/commands/migrate.py @@ -17,11 +17,23 @@ class MigrationCommand(CkanCommand): paster showcase migrate -c - Migrate Related Items to Showcases + paster showcase migrate -c [--allow-duplicates] + - Migrate Related Items to Showcases and allow duplicates + Must be run from the ckanext-showcase directory. ''' summary = __doc__.split('\n')[0] usage = __doc__ + def __init__(self,name): + super(CkanCommand, self).__init__(name) + + self.parser.add_option('--allow-duplicates', dest='allow_duplicates', + default=False, help='''Use this option to allow + related items with duplicate titles to be migrated. + Duplicate showcases will be created as + 'duplicate__'.''', action='store_true') + def command(self): ''' Parse command line arguments and call appropriate method. @@ -44,6 +56,9 @@ def migrate(self): ''' ''' + # determine whether migration should allow duplicates + allow_duplicates = self.options.allow_duplicates + related_items = get_action('related_list')(data_dict={}) # preflight: @@ -51,7 +66,7 @@ def migrate(self): related_titles = [i['title'] for i in related_items] # make a list of duplicate titles duplicate_titles = self._find_duplicates(related_titles) - if duplicate_titles: + if duplicate_titles and allow_duplicates == False: print( """All Related Items must have unique titles before migration. The following Related Item titles are used more than once and need to be corrected before @@ -69,10 +84,11 @@ def migrate(self): print('Showcase for Related Item "{0}" already exists.'.format( normalized_title)) else: + showcase_title = self._gen_new_title(related.get('title'), related['id']) data_dict = { 'original_related_item_id': related.get('id'), - 'title': related.get('title'), - 'name': munge_title_to_name(related.get('title')), + 'title': showcase_title, + 'name': munge_title_to_name(showcase_title), 'notes': related.get('description'), 'image_url': related.get('image_url'), 'url': related.get('url'), @@ -120,3 +136,12 @@ def _find_duplicates(self, lst): ['two', 'three'] ''' return list(set(x for x in lst if lst.count(x) >= 2)) + + def _gen_new_title(self, title, related_id): + name = munge_title_to_name(title) + pkg_obj = model.Session.query(model.Package).filter_by(name=name).first() + if pkg_obj: + title.replace('duplicate_', '') + return 'duplicate_' + title + '_' + related_id + else: + return title diff --git a/ckanext/showcase/controller.py b/ckanext/showcase/controller.py index f4d124b6..0f596e3e 100644 --- a/ckanext/showcase/controller.py +++ b/ckanext/showcase/controller.py @@ -5,12 +5,11 @@ from ckan.plugins import toolkit as tk import ckan.model as model -import ckan.lib.base as base import ckan.lib.helpers as h import ckan.lib.navl.dictization_functions as dict_fns import ckan.logic as logic import ckan.plugins as p -from ckan.common import OrderedDict, g, ungettext +from ckan.common import OrderedDict, ungettext from ckan.controllers.package import (PackageController, url_with_params, _encode_params) @@ -23,7 +22,7 @@ request = tk.request render = tk.render abort = tk.abort -redirect = base.redirect +redirect = tk.redirect_to NotFound = tk.ObjectNotFound ValidationError = tk.ValidationError check_access = tk.check_access @@ -358,9 +357,13 @@ def _add_dataset_search(self, showcase_id, showcase_name): # unicode format (decoded from utf8) q = c.q = request.params.get('q', u'') c.query_error = False - page = self._get_page_number(request.params) + try: + page = self._get_page_number(request.params) + except AttributeError: + # in CKAN >= 2.5 _get_page_number has been moved + page = h.get_page_number(request.params) - limit = g.datasets_per_page + limit = int(config.get('ckan.datasets_per_page', 20)) # most search operations should reset the page counter: params_nopage = [(k, v) for k, v in request.params.items() @@ -466,7 +469,15 @@ def pager_url(q=None, page=None): 'license_id': _('Licenses'), } - for facet in g.facets: + # for CKAN-Versions that do not provide the facets-method from + # helper-context, import facets from ckan.common + if hasattr(h, 'facets'): + current_facets = h.facets() + else: + from ckan.common import g + current_facets = g.facets + + for facet in current_facets: if facet in default_facet_titles: facets[facet] = default_facet_titles[facet] else: @@ -511,7 +522,7 @@ def pager_url(q=None, page=None): for facet in c.search_facets.keys(): try: limit = int(request.params.get('_%s_limit' % facet, - g.facets_default_number)) + int(config.get('search.facets.default', 10)))) except ValueError: abort(400, _("Parameter '{parameter_name}' is not an integer").format( parameter_name='_%s_limit' % facet diff --git a/ckanext/showcase/i18n/__init__.py b/ckanext/showcase/i18n/__init__.py new file mode 100644 index 00000000..2e2033b3 --- /dev/null +++ b/ckanext/showcase/i18n/__init__.py @@ -0,0 +1,7 @@ +# this is a namespace package +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/ckanext/showcase/i18n/ckanext-showcase.pot b/ckanext/showcase/i18n/ckanext-showcase.pot new file mode 100644 index 00000000..b7051499 --- /dev/null +++ b/ckanext/showcase/i18n/ckanext-showcase.pot @@ -0,0 +1,522 @@ +# Translations template for ckanext-showcase. +# Copyright (C) 2015 ORGANIZATION +# This file is distributed under the same license as the ckanext-showcase +# project. +# FIRST AUTHOR , 2015. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ckanext-showcase 1.0.0b1\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2015-09-23 14:49+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.6\n" + +#: ckanext/showcase/controller.py:56 +msgid "Unauthorized to create a package" +msgstr "" + +#: ckanext/showcase/controller.py:71 ckanext/showcase/controller.py:267 +msgid "User not authorized to edit {showcase_id}" +msgstr "" + +#: ckanext/showcase/controller.py:147 ckanext/showcase/controller.py:184 +#: ckanext/showcase/controller.py:224 ckanext/showcase/controller.py:238 +#: ckanext/showcase/controller.py:274 +msgid "Showcase not found" +msgstr "" + +#: ckanext/showcase/controller.py:149 ckanext/showcase/controller.py:276 +msgid "Unauthorized to read showcase" +msgstr "" + +#: ckanext/showcase/controller.py:171 ckanext/showcase/controller.py:182 +msgid "Unauthorized to delete showcase" +msgstr "" + +#: ckanext/showcase/controller.py:176 +msgid "Showcase has been deleted." +msgstr "" + +#: ckanext/showcase/controller.py:201 ckanext/showcase/controller.py:210 +msgid "Dataset not found" +msgstr "" + +#: ckanext/showcase/controller.py:203 +msgid "Not authorized to see this page" +msgstr "" + +#: ckanext/showcase/controller.py:212 +msgid "Unauthorized to read package" +msgstr "" + +#: ckanext/showcase/controller.py:227 ckanext/showcase/controller.py:329 +msgid "The dataset has been added to the showcase." +msgid_plural "The datasets have been added to the showcase." +msgstr[0] "" +msgstr[1] "" + +#: ckanext/showcase/controller.py:241 ckanext/showcase/controller.py:297 +msgid "The dataset has been removed from the showcase." +msgid_plural "The datasets have been removed from the showcase." +msgstr[0] "" +msgstr[1] "" + +#: ckanext/showcase/controller.py:462 ckanext/showcase/templates/header.html:6 +msgid "Organizations" +msgstr "" + +#: ckanext/showcase/controller.py:463 ckanext/showcase/templates/header.html:7 +#: ckanext/showcase/templates/package/read_base.html:5 +msgid "Groups" +msgstr "" + +#: ckanext/showcase/controller.py:464 ckanext/showcase/plugin.py:103 +#: ckanext/showcase/templates/showcase/new_package_form.html:33 +msgid "Tags" +msgstr "" + +#: ckanext/showcase/controller.py:465 +msgid "Formats" +msgstr "" + +#: ckanext/showcase/controller.py:466 +msgid "Licenses" +msgstr "" + +#: ckanext/showcase/controller.py:516 +msgid "Parameter '{parameter_name}' is not an integer" +msgstr "" + +#: ckanext/showcase/controller.py:531 ckanext/showcase/controller.py:567 +msgid "User not authorized to view page" +msgstr "" + +#: ckanext/showcase/controller.py:540 ckanext/showcase/controller.py:581 +msgid "Unauthorized to perform that action" +msgstr "" + +#: ckanext/showcase/controller.py:542 +msgid "User '{user_name}' not found." +msgstr "" + +#: ckanext/showcase/controller.py:547 +msgid "The user is now a Showcase Admin" +msgstr "" + +#: ckanext/showcase/controller.py:583 +msgid "The user is not a Showcase Admin" +msgstr "" + +#: ckanext/showcase/controller.py:585 +msgid "The user is no longer a Showcase Admin" +msgstr "" + +#: ckanext/showcase/logic/converters.py:24 ckanext/showcase/logic/validators.py:29 +msgid "Not found" +msgstr "" + +#: ckanext/showcase/logic/converters.py:24 ckanext/showcase/logic/validators.py:29 +#: ckanext/showcase/templates/package/read_base.html:4 +msgid "Dataset" +msgstr "" + +#: ckanext/showcase/templates/header.html:5 +msgid "Datasets" +msgstr "" + +#: ckanext/showcase/templates/header.html:8 +#: ckanext/showcase/templates/package/dataset_showcase_list.html:3 +#: ckanext/showcase/templates/package/read_base.html:7 +#: ckanext/showcase/templates/showcase/edit_base.html:5 +#: ckanext/showcase/templates/showcase/edit_base.html:17 +#: ckanext/showcase/templates/showcase/edit_base.html:21 +#: ckanext/showcase/templates/showcase/read.html:6 +#: ckanext/showcase/templates/showcase/read.html:33 +#: ckanext/showcase/templates/showcase/search.html:4 +#: ckanext/showcase/templates/showcase/search.html:7 +msgid "Showcases" +msgstr "" + +#: ckanext/showcase/templates/header.html:9 +msgid "About" +msgstr "" + +#: ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html:3 +#: ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html:16 +msgid "Confirm Remove" +msgstr "" + +#: ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html:11 +msgid "Are you sure you want to remove this user as a Showcase Admin - {name}?" +msgstr "" + +#: ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html:15 +#: ckanext/showcase/templates/showcase/confirm_delete.html:14 +msgid "Cancel" +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:9 +msgid "Manage Showcase Admins" +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:16 +msgid "Add an Existing User" +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:19 +msgid "To make an existing user a Showcase Admin, search for their username below." +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:23 +msgid "Username" +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:32 +msgid "Add User" +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:38 +msgid "Showcase Admins" +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:43 +msgid "User" +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:51 +msgid "Are you sure you want to remove this user from the Showcase Admin list?" +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:53 +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:46 +msgid "Remove" +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:61 +msgid "There are currently no Showcase Admins." +msgstr "" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:69 +msgid "" +"

Showcase Admin: Can create and remove showcases. Can add" +" and remove datasets from showcases.

" +msgstr "" + +#: ckanext/showcase/templates/home/snippets/stats.html:5 +msgid "{site_title} statistics" +msgstr "" + +#: ckanext/showcase/templates/home/snippets/stats.html:10 +msgid "dataset" +msgid_plural "datasets" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/showcase/templates/home/snippets/stats.html:16 +msgid "organization" +msgid_plural "organizations" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/showcase/templates/home/snippets/stats.html:22 +msgid "group" +msgid_plural "groups" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/showcase/templates/home/snippets/stats.html:28 +msgid "showcase" +msgid_plural "showcases" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/showcase/templates/package/dataset_showcase_list.html:13 +msgid "Associate this showcase with this dataset" +msgstr "" + +#: ckanext/showcase/templates/package/dataset_showcase_list.html:13 +msgid "Add to showcase" +msgstr "" + +#: ckanext/showcase/templates/package/dataset_showcase_list.html:17 +msgid "Showcases featuring {dataset_name}" +msgstr "" + +#: ckanext/showcase/templates/package/dataset_showcase_list.html:22 +msgid "There are no showcases that feature this dataset" +msgstr "" + +#: ckanext/showcase/templates/package/read_base.html:6 +msgid "Activity Stream" +msgstr "" + +#: ckanext/showcase/templates/showcase/add_datasets.html:3 +msgid "Showcases - Add datasets" +msgstr "" + +#: ckanext/showcase/templates/showcase/add_datasets.html:21 +#: ckanext/showcase/templates/showcase/manage_datasets.html:24 +#: ckanext/showcase/templates/showcase/search.html:27 +msgid "Relevance" +msgstr "" + +#: ckanext/showcase/templates/showcase/add_datasets.html:22 +#: ckanext/showcase/templates/showcase/manage_datasets.html:25 +#: ckanext/showcase/templates/showcase/search.html:28 +msgid "Name Ascending" +msgstr "" + +#: ckanext/showcase/templates/showcase/add_datasets.html:23 +#: ckanext/showcase/templates/showcase/manage_datasets.html:26 +#: ckanext/showcase/templates/showcase/search.html:29 +msgid "Name Descending" +msgstr "" + +#: ckanext/showcase/templates/showcase/add_datasets.html:24 +#: ckanext/showcase/templates/showcase/manage_datasets.html:27 +#: ckanext/showcase/templates/showcase/search.html:30 +msgid "Last Modified" +msgstr "" + +#: ckanext/showcase/templates/showcase/add_datasets.html:25 +#: ckanext/showcase/templates/showcase/manage_datasets.html:28 +#: ckanext/showcase/templates/showcase/search.html:31 +msgid "Popular" +msgstr "" + +#: ckanext/showcase/templates/showcase/add_datasets.html:31 +#: ckanext/showcase/templates/showcase/manage_datasets.html:36 +msgid "Datasets available to add to this showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/add_datasets.html:48 +#: ckanext/showcase/templates/showcase/manage_datasets.html:51 +msgid "Add to Showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/add_datasets.html:78 +#: ckanext/showcase/templates/showcase/manage_datasets.html:88 +msgid "No datasets could be found" +msgstr "" + +#: ckanext/showcase/templates/showcase/confirm_delete.html:3 +#: ckanext/showcase/templates/showcase/confirm_delete.html:15 +msgid "Confirm Delete" +msgstr "" + +#: ckanext/showcase/templates/showcase/confirm_delete.html:11 +msgid "Are you sure you want to delete showcase - {showcase_name}?" +msgstr "" + +#: ckanext/showcase/templates/showcase/edit_base.html:19 +msgid "Edit" +msgstr "" + +#: ckanext/showcase/templates/showcase/edit_base.html:22 +#: ckanext/showcase/templates/showcase/new.html:3 +#: ckanext/showcase/templates/showcase/new_package_form.html:63 +msgid "Create Showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/edit_base.html:35 +msgid "View showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/edit_base.html:41 +msgid "Edit showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/edit_base.html:42 +msgid "Manage datasets" +msgstr "" + +#: ckanext/showcase/templates/showcase/manage_datasets.html:3 +msgid "Showcases - Manage datasets" +msgstr "" + +#: ckanext/showcase/templates/showcase/manage_datasets.html:96 +msgid "Datasets in this showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/manage_datasets.html:109 +msgid "Remove from Showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/manage_datasets.html:140 +msgid "This showcase has no datasets associated to it" +msgstr "" + +#: ckanext/showcase/templates/showcase/new.html:8 +msgid "Create a Showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:15 +msgid "Title" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:15 +msgid "eg. A descriptive title" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:24 +msgid "URL" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:24 +msgid "eg. my-showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:28 +msgid "Description" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:28 +msgid "eg. Some useful notes about the data" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:33 +msgid "eg. economy, mental health, government" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:44 +msgid "External link" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:44 +msgid "http://www.example.com" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:48 +msgid "Submitted By" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:48 +msgid "Joe Bloggs" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:50 +msgid "Submitter Email" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:50 +msgid "joe@example.com" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:58 +msgid "Are you sure you want to delete this showcase?" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:59 +msgid "Delete" +msgstr "" + +#: ckanext/showcase/templates/showcase/new_package_form.html:63 +msgid "Update Showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/read.html:46 +msgid "Manage" +msgstr "" + +#: ckanext/showcase/templates/showcase/read.html:53 +msgid "Private" +msgstr "" + +#: ckanext/showcase/templates/showcase/read.html:60 +msgid "Draft" +msgstr "" + +#: ckanext/showcase/templates/showcase/read.html:78 +#: ckanext/showcase/templates/showcase/snippets/showcase_info.html:27 +msgid "Launch website" +msgstr "" + +#: ckanext/showcase/templates/showcase/search.html:13 +msgid "Add Showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/search.html:33 +msgid "Search showcases..." +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/helper.html:4 +msgid "What are Showcases?" +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/helper.html:8 +msgid "" +"Datasets have been used to build apps, websites and visualizations. They've " +"been featured in articles, and written about in news reports and blog posts. " +"Showcases collect together the best examples of datasets in use, to provide " +"further insight, ideas, and inspiration." +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/helper.html:12 +#, python-format +msgid "" +"Sysadmins can manage Showcase Admins from the Showcase " +"configuration page." +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_info.html:21 +msgid "Submitted by" +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_info.html:37 +msgid "Datasets in Showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_info.html:47 +msgid "There are no Datasets in this Showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:30 +msgid "This showcase has no description" +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:35 +msgid "{num} Dataset" +msgid_plural "{num} Datasets" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:37 +msgid "0 Datasets" +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:41 +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:42 +msgid "View {showcase_title}" +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:46 +msgid "Remove dataset from this showcase" +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_search_result_text.html:7 +msgid "{number} showcase found for '{query}'" +msgid_plural "{number} showcases found for '{query}'" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_search_result_text.html:8 +msgid "No showcases found for '{query}'" +msgstr "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_search_result_text.html:9 +msgid "{number} showcase found" +msgid_plural "{number} showcases found" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/showcase/templates/showcase/snippets/showcase_search_result_text.html:10 +msgid "No showcases found" +msgstr "" + diff --git a/ckanext/showcase/i18n/es/LC_MESSAGES/ckanext-showcase.mo b/ckanext/showcase/i18n/es/LC_MESSAGES/ckanext-showcase.mo new file mode 100644 index 00000000..6696e8ee Binary files /dev/null and b/ckanext/showcase/i18n/es/LC_MESSAGES/ckanext-showcase.mo differ diff --git a/ckanext/showcase/i18n/es/LC_MESSAGES/ckanext-showcase.po b/ckanext/showcase/i18n/es/LC_MESSAGES/ckanext-showcase.po new file mode 100644 index 00000000..080b18ed --- /dev/null +++ b/ckanext/showcase/i18n/es/LC_MESSAGES/ckanext-showcase.po @@ -0,0 +1,521 @@ +# Translations template for ckanext-showcase. +# Copyright (C) 2015 ORGANIZATION +# This file is distributed under the same license as the ckanext-showcase +# project. +# FIRST AUTHOR , 2015. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ckanext-showcase 1.0.0b1\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2015-09-23 14:49+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.6\n" + +#: ckanext/showcase/controller.py:56 +msgid "Unauthorized to create a package" +msgstr "No tiene permisos para crear paquetes" + +#: ckanext/showcase/controller.py:71 ckanext/showcase/controller.py:267 +msgid "User not authorized to edit {showcase_id}" +msgstr "El usuario no está autorizado para editar {showcase_id}" + +#: ckanext/showcase/controller.py:147 ckanext/showcase/controller.py:184 +#: ckanext/showcase/controller.py:224 ckanext/showcase/controller.py:238 +#: ckanext/showcase/controller.py:274 +msgid "Showcase not found" +msgstr "Elemento destacado no encontrado" + +#: ckanext/showcase/controller.py:149 ckanext/showcase/controller.py:276 +msgid "Unauthorized to read showcase" +msgstr "No está autorizado para ver el elemento destacado" + +#: ckanext/showcase/controller.py:171 ckanext/showcase/controller.py:182 +msgid "Unauthorized to delete showcase" +msgstr "No está autorizado para eliminar el elemento destacado" + +#: ckanext/showcase/controller.py:176 +msgid "Showcase has been deleted." +msgstr "El elemento destacado ha sido eliminado" + +#: ckanext/showcase/controller.py:201 ckanext/showcase/controller.py:210 +msgid "Dataset not found" +msgstr "Conjunto de datos no encontrado" + +#: ckanext/showcase/controller.py:203 +msgid "Not authorized to see this page" +msgstr "No esta autorizado para ver esta página" + +#: ckanext/showcase/controller.py:212 +msgid "Unauthorized to read package" +msgstr "No esta autorizado para ver el paquete" + +#: ckanext/showcase/controller.py:227 ckanext/showcase/controller.py:329 +msgid "The dataset has been added to the showcase." +msgid_plural "The datasets have been added to the showcase." +msgstr[0] "El Conjunto de datos ha sido añadido al Destacado" +msgstr[1] "Los Conjuntos de datos han sido añadidos al Destacado" + +#: ckanext/showcase/controller.py:241 ckanext/showcase/controller.py:297 +msgid "The dataset has been removed from the showcase." +msgid_plural "The datasets have been removed from the showcase." +msgstr[0] "El Conjunto de datos ha sido eliminado del Destacado" +msgstr[1] "Los Conjuntos de datos han sido eliminados del Destacado" + +#: ckanext/showcase/controller.py:462 ckanext/showcase/templates/header.html:6 +msgid "Organizations" +msgstr "Organizaciones" + +#: ckanext/showcase/controller.py:463 ckanext/showcase/templates/header.html:7 +#: ckanext/showcase/templates/package/read_base.html:5 +msgid "Groups" +msgstr "Categorias" + +#: ckanext/showcase/controller.py:464 ckanext/showcase/plugin.py:103 +#: ckanext/showcase/templates/showcase/new_package_form.html:33 +msgid "Tags" +msgstr "Etiquetas" + +#: ckanext/showcase/controller.py:465 +msgid "Formats" +msgstr "Formatos" + +#: ckanext/showcase/controller.py:466 +msgid "Licenses" +msgstr "Licencias" + +#: ckanext/showcase/controller.py:516 +msgid "Parameter '{parameter_name}' is not an integer" +msgstr "El parametro '{parameter_name}' no es de tipo entero" + +#: ckanext/showcase/controller.py:531 ckanext/showcase/controller.py:567 +msgid "User not authorized to view page" +msgstr "Usuario no autorizado para ver esta página" + +#: ckanext/showcase/controller.py:540 ckanext/showcase/controller.py:581 +msgid "Unauthorized to perform that action" +msgstr "No esta autorizado para realizar esta acción" + +#: ckanext/showcase/controller.py:542 +msgid "User '{user_name}' not found." +msgstr "Usuario '{user_name}' no encontrado." + +#: ckanext/showcase/controller.py:547 +msgid "The user is now a Showcase Admin" +msgstr "El usuario es ahora administrador de Destacados" + +#: ckanext/showcase/controller.py:583 +msgid "The user is not a Showcase Admin" +msgstr "El usuario no es un administrador de Destacados" + +#: ckanext/showcase/controller.py:585 +msgid "The user is no longer a Showcase Admin" +msgstr "El usuario ya no es un administrador de Destacados" + +#: ckanext/showcase/logic/converters.py:24 ckanext/showcase/logic/validators.py:29 +msgid "Not found" +msgstr "No encontrado" + +#: ckanext/showcase/logic/converters.py:24 ckanext/showcase/logic/validators.py:29 +#: ckanext/showcase/templates/package/read_base.html:4 +msgid "Dataset" +msgstr "Conjunto de datos" + +#: ckanext/showcase/templates/header.html:5 +msgid "Datasets" +msgstr "Conjuntos de Datos" + +#: ckanext/showcase/templates/header.html:8 +#: ckanext/showcase/templates/package/dataset_showcase_list.html:3 +#: ckanext/showcase/templates/package/read_base.html:7 +#: ckanext/showcase/templates/showcase/edit_base.html:5 +#: ckanext/showcase/templates/showcase/edit_base.html:17 +#: ckanext/showcase/templates/showcase/edit_base.html:21 +#: ckanext/showcase/templates/showcase/read.html:6 +#: ckanext/showcase/templates/showcase/read.html:33 +#: ckanext/showcase/templates/showcase/search.html:4 +#: ckanext/showcase/templates/showcase/search.html:7 +msgid "Showcases" +msgstr "Destacados" + +#: ckanext/showcase/templates/header.html:9 +msgid "About" +msgstr "Acerca de" + +#: ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html:3 +#: ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html:16 +msgid "Confirm Remove" +msgstr "Confirmar eliminación" + +#: ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html:11 +msgid "Are you sure you want to remove this user as a Showcase Admin - {name}?" +msgstr "Esta seguro que desea eliminar este usuario como Administrador de Destacados - {name}?" + +#: ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html:15 +#: ckanext/showcase/templates/showcase/confirm_delete.html:14 +msgid "Cancel" +msgstr "Cancelar" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:9 +msgid "Manage Showcase Admins" +msgstr "Administrar administradores de Destacados" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:16 +msgid "Add an Existing User" +msgstr "Agregar un usuario existente" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:19 +msgid "To make an existing user a Showcase Admin, search for their username below." +msgstr "Para agregar un usuario existente como administrador de Destacados, busque el nombre de usuario abajo" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:23 +msgid "Username" +msgstr "Nombre de usuario" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:32 +msgid "Add User" +msgstr "Agregar usuario" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:38 +msgid "Showcase Admins" +msgstr "Administradores de Destacados" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:43 +msgid "User" +msgstr "Usuario" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:51 +msgid "Are you sure you want to remove this user from the Showcase Admin list?" +msgstr "Esta seguro que desea eliminar a este usuario de la lista de administradores de Destacados" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:53 +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:46 +msgid "Remove" +msgstr "Eliminar" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:61 +msgid "There are currently no Showcase Admins." +msgstr "No hay administradores de Destacados" + +#: ckanext/showcase/templates/admin/manage_showcase_admins.html:69 +msgid "" +"

Showcase Admin: Can create and remove showcases. Can add" +" and remove datasets from showcases.

" +msgstr "

Administrador de Destacados: Puede crear y eliminar Destacados. Puede agregar y eliminar Conjuntos de datos de los Destacados.

" + +#: ckanext/showcase/templates/home/snippets/stats.html:5 +msgid "{site_title} statistics" +msgstr "Estadísticas de {site_title}" + +#: ckanext/showcase/templates/home/snippets/stats.html:10 +msgid "dataset" +msgid_plural "datasets" +msgstr[0] "Conjunto de datos" +msgstr[1] "Conjuntos de datos" + +#: ckanext/showcase/templates/home/snippets/stats.html:16 +msgid "organization" +msgid_plural "organizations" +msgstr[0] "Organización" +msgstr[1] "Organizaciones" + +#: ckanext/showcase/templates/home/snippets/stats.html:22 +msgid "group" +msgid_plural "groups" +msgstr[0] "Grupo" +msgstr[1] "Grupos" + +#: ckanext/showcase/templates/home/snippets/stats.html:28 +msgid "showcase" +msgid_plural "showcases" +msgstr[0] "Destacado" +msgstr[1] "Destacados" + +#: ckanext/showcase/templates/package/dataset_showcase_list.html:13 +msgid "Associate this showcase with this dataset" +msgstr "Asociar este Destacado con este Conjunto de datos" + +#: ckanext/showcase/templates/package/dataset_showcase_list.html:13 +msgid "Add to showcase" +msgstr "Agregar al Destacado" + +#: ckanext/showcase/templates/package/dataset_showcase_list.html:17 +msgid "Showcases featuring {dataset_name}" +msgstr "Destacados que contienen {dataset_name}" + +#: ckanext/showcase/templates/package/dataset_showcase_list.html:22 +msgid "There are no showcases that feature this dataset" +msgstr "No hay Destacados que contengan este Conjunto de datos" + +#: ckanext/showcase/templates/package/read_base.html:6 +msgid "Activity Stream" +msgstr "Flujo de actividad" + +#: ckanext/showcase/templates/showcase/add_datasets.html:3 +msgid "Showcases - Add datasets" +msgstr "Destacados - Agregar Conjuntos de datos" + +#: ckanext/showcase/templates/showcase/add_datasets.html:21 +#: ckanext/showcase/templates/showcase/manage_datasets.html:24 +#: ckanext/showcase/templates/showcase/search.html:27 +msgid "Relevance" +msgstr "Relevancia" + +#: ckanext/showcase/templates/showcase/add_datasets.html:22 +#: ckanext/showcase/templates/showcase/manage_datasets.html:25 +#: ckanext/showcase/templates/showcase/search.html:28 +msgid "Name Ascending" +msgstr "Nombre Ascendente" + +#: ckanext/showcase/templates/showcase/add_datasets.html:23 +#: ckanext/showcase/templates/showcase/manage_datasets.html:26 +#: ckanext/showcase/templates/showcase/search.html:29 +msgid "Name Descending" +msgstr "Nombre Descendente" + +#: ckanext/showcase/templates/showcase/add_datasets.html:24 +#: ckanext/showcase/templates/showcase/manage_datasets.html:27 +#: ckanext/showcase/templates/showcase/search.html:30 +msgid "Last Modified" +msgstr "Última modificación" + +#: ckanext/showcase/templates/showcase/add_datasets.html:25 +#: ckanext/showcase/templates/showcase/manage_datasets.html:28 +#: ckanext/showcase/templates/showcase/search.html:31 +msgid "Popular" +msgstr "Popular" + +#: ckanext/showcase/templates/showcase/add_datasets.html:31 +#: ckanext/showcase/templates/showcase/manage_datasets.html:36 +msgid "Datasets available to add to this showcase" +msgstr "Conjuntos de datos disponibles para agregar a este Destacado" + +#: ckanext/showcase/templates/showcase/add_datasets.html:48 +#: ckanext/showcase/templates/showcase/manage_datasets.html:51 +msgid "Add to Showcase" +msgstr "Agregar a Destacado" + +#: ckanext/showcase/templates/showcase/add_datasets.html:78 +#: ckanext/showcase/templates/showcase/manage_datasets.html:88 +msgid "No datasets could be found" +msgstr "No se encontraron Conjuntos de datos" + +#: ckanext/showcase/templates/showcase/confirm_delete.html:3 +#: ckanext/showcase/templates/showcase/confirm_delete.html:15 +msgid "Confirm Delete" +msgstr "Confirmar eliminación" + +#: ckanext/showcase/templates/showcase/confirm_delete.html:11 +msgid "Are you sure you want to delete showcase - {showcase_name}?" +msgstr "Esta seguro que desea eliminar este Destacado - {showcase_name}" + +#: ckanext/showcase/templates/showcase/edit_base.html:19 +msgid "Edit" +msgstr "Editar" + +#: ckanext/showcase/templates/showcase/edit_base.html:22 +#: ckanext/showcase/templates/showcase/new.html:3 +#: ckanext/showcase/templates/showcase/new_package_form.html:63 +msgid "Create Showcase" +msgstr "Crear Destacado" + +#: ckanext/showcase/templates/showcase/edit_base.html:35 +msgid "View showcase" +msgstr "Ver Destacado" + +#: ckanext/showcase/templates/showcase/edit_base.html:41 +msgid "Edit showcase" +msgstr "Editar Destacado" + +#: ckanext/showcase/templates/showcase/edit_base.html:42 +msgid "Manage datasets" +msgstr "Administrar Conjuntos de Datos" + +#: ckanext/showcase/templates/showcase/manage_datasets.html:3 +msgid "Showcases - Manage datasets" +msgstr "Destacados - Administrar Conjuntos de Datos" + +#: ckanext/showcase/templates/showcase/manage_datasets.html:96 +msgid "Datasets in this showcase" +msgstr "Conjuntos de datos en este Destacado" + +#: ckanext/showcase/templates/showcase/manage_datasets.html:109 +msgid "Remove from Showcase" +msgstr "Eliminar del Destacado" + +#: ckanext/showcase/templates/showcase/manage_datasets.html:140 +msgid "This showcase has no datasets associated to it" +msgstr "Este Destacado no tiene Conjuntos de datos asociados" + +#: ckanext/showcase/templates/showcase/new.html:8 +msgid "Create a Showcase" +msgstr "Crear Destacado" + +#: ckanext/showcase/templates/showcase/new_package_form.html:15 +msgid "Title" +msgstr "Título" + +#: ckanext/showcase/templates/showcase/new_package_form.html:15 +msgid "eg. A descriptive title" +msgstr "eg. Un título descriptivo" + +#: ckanext/showcase/templates/showcase/new_package_form.html:24 +msgid "URL" +msgstr "URL" + +#: ckanext/showcase/templates/showcase/new_package_form.html:24 +msgid "eg. my-showcase" +msgstr "eg. Mi Destacado" + +#: ckanext/showcase/templates/showcase/new_package_form.html:28 +msgid "Description" +msgstr "Descripción" + +#: ckanext/showcase/templates/showcase/new_package_form.html:28 +msgid "eg. Some useful notes about the data" +msgstr "eg. Alguna nota útil sobre los datos" + +#: ckanext/showcase/templates/showcase/new_package_form.html:33 +msgid "eg. economy, mental health, government" +msgstr "eg. economia, salud mental, gobierno" + +#: ckanext/showcase/templates/showcase/new_package_form.html:44 +msgid "External link" +msgstr "Link externo" + +#: ckanext/showcase/templates/showcase/new_package_form.html:44 +msgid "http://www.example.com" +msgstr "http://www.example.com" + +#: ckanext/showcase/templates/showcase/new_package_form.html:48 +msgid "Submitted By" +msgstr "Enviado por" + +#: ckanext/showcase/templates/showcase/new_package_form.html:48 +msgid "Joe Bloggs" +msgstr "Joe Bloggs" + +#: ckanext/showcase/templates/showcase/new_package_form.html:50 +msgid "Submitter Email" +msgstr "Correo electrónico del que lo envio" + +#: ckanext/showcase/templates/showcase/new_package_form.html:50 +msgid "joe@example.com" +msgstr "joe@example.com" + +#: ckanext/showcase/templates/showcase/new_package_form.html:58 +msgid "Are you sure you want to delete this showcase?" +msgstr "Esta seguro que desea eliminar este Destacado?" + +#: ckanext/showcase/templates/showcase/new_package_form.html:59 +msgid "Delete" +msgstr "Eliminar" + +#: ckanext/showcase/templates/showcase/new_package_form.html:63 +msgid "Update Showcase" +msgstr "Actualizar Destacado" + +#: ckanext/showcase/templates/showcase/read.html:46 +msgid "Manage" +msgstr "Administrar" + +#: ckanext/showcase/templates/showcase/read.html:53 +msgid "Private" +msgstr "Privado" + +#: ckanext/showcase/templates/showcase/read.html:60 +msgid "Draft" +msgstr "Borrador" + +#: ckanext/showcase/templates/showcase/read.html:78 +#: ckanext/showcase/templates/showcase/snippets/showcase_info.html:27 +msgid "Launch website" +msgstr "Lanzar sitio web" + +#: ckanext/showcase/templates/showcase/search.html:13 +msgid "Add Showcase" +msgstr "Agregar Destacado" + +#: ckanext/showcase/templates/showcase/search.html:33 +msgid "Search showcases..." +msgstr "Buscando Destacados..." + +#: ckanext/showcase/templates/showcase/snippets/helper.html:4 +msgid "What are Showcases?" +msgstr "Qué son los Destacados?" + +#: ckanext/showcase/templates/showcase/snippets/helper.html:8 +msgid "" +"Datasets have been used to build apps, websites and visualizations. They've " +"been featured in articles, and written about in news reports and blog posts. " +"Showcases collect together the best examples of datasets in use, to provide " +"further insight, ideas, and inspiration." +msgstr "Los conjuntos de datos han sido usados para crear aplicaciones, sitios web y visualizaciones. Estos han sido presentados en articulos, y se ha escrito reportes de noticias sobre estos y publicaciones en blogs. Los Destacados agrupan los mejores ejemplos de Conjuntos de datos en uso, para proveer más perspectivas, ideas e inspiración." + +#: ckanext/showcase/templates/showcase/snippets/helper.html:12 +#, python-format +msgid "" +"Sysadmins can manage Showcase Admins from the Showcase " +"configuration page." +msgstr "Los administradores del sistema pueden administrar administradores de Destacados de la configuración del Destacado." + +#: ckanext/showcase/templates/showcase/snippets/showcase_info.html:21 +msgid "Submitted by" +msgstr "Enviado por" + +#: ckanext/showcase/templates/showcase/snippets/showcase_info.html:37 +msgid "Datasets in Showcase" +msgstr "Conjuntos de datos en Destacado" + +#: ckanext/showcase/templates/showcase/snippets/showcase_info.html:47 +msgid "There are no Datasets in this Showcase" +msgstr "No hay Conjuntos de datos en este Destacado" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:30 +msgid "This showcase has no description" +msgstr "Este Destacado no tiene descripción" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:35 +msgid "{num} Dataset" +msgid_plural "{num} Datasets" +msgstr[0] "{num} Conjunto de datos" +msgstr[1] "{num} Conjuntos de datos" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:37 +msgid "0 Datasets" +msgstr "0 Conjuntos de datos" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:41 +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:42 +msgid "View {showcase_title}" +msgstr "Ver {showcase_title}" + +#: ckanext/showcase/templates/showcase/snippets/showcase_item.html:46 +msgid "Remove dataset from this showcase" +msgstr "Eliminar Conjunto de datos de este Destacado" + +#: ckanext/showcase/templates/showcase/snippets/showcase_search_result_text.html:7 +msgid "{number} showcase found for '{query}'" +msgid_plural "{number} showcases found for '{query}'" +msgstr[0] "{number} Destacado encontrado para '{query}'" +msgstr[1] "{number} Destacados encotnrados para '{query}'" + +#: ckanext/showcase/templates/showcase/snippets/showcase_search_result_text.html:8 +msgid "No showcases found for '{query}'" +msgstr "No se encontraron destacados para '{query}'" + +#: ckanext/showcase/templates/showcase/snippets/showcase_search_result_text.html:9 +msgid "{number} showcase found" +msgid_plural "{number} showcases found" +msgstr[0] "{number} Destacado encontrado" +msgstr[1] "{number} Destacados encontrados" + +#: ckanext/showcase/templates/showcase/snippets/showcase_search_result_text.html:10 +msgid "No showcases found" +msgstr "No se encontraron Destacados" \ No newline at end of file diff --git a/ckanext/showcase/logic/action/create.py b/ckanext/showcase/logic/action/create.py index 202e5532..2d23b2d2 100644 --- a/ckanext/showcase/logic/action/create.py +++ b/ckanext/showcase/logic/action/create.py @@ -24,7 +24,14 @@ def showcase_create(context, data_dict): # force type to 'showcase' data_dict['type'] = 'showcase' - upload = uploader.Upload('showcase') + # If get_uploader is available (introduced for IUploader in CKAN 2.5), use + # it, otherwise use the default uploader. + # https://github.com/ckan/ckan/pull/2510 + try: + upload = uploader.get_uploader('showcase') + except AttributeError: + upload = uploader.Upload('showcase') + upload.update_data_dict(data_dict, 'image_url', 'image_upload', 'clear_upload') diff --git a/ckanext/showcase/logic/action/get.py b/ckanext/showcase/logic/action/get.py index 359acd98..18e98018 100644 --- a/ckanext/showcase/logic/action/get.py +++ b/ckanext/showcase/logic/action/get.py @@ -3,6 +3,7 @@ import ckan.plugins.toolkit as toolkit import ckan.lib.dictization.model_dictize as model_dictize from ckan.lib.navl.dictization_functions import validate +from ckan.logic import NotAuthorized from ckanext.showcase.logic.schema import (showcase_package_list_schema, package_showcase_list_schema) @@ -115,10 +116,15 @@ def package_showcase_list(context, data_dict): showcase_list = [] if showcase_id_list is not None: for showcase_id in showcase_id_list: - showcase = toolkit.get_action('package_show')(context, - {'id': showcase_id}) - showcase_list.append(showcase) - + try: + showcase = toolkit.get_action('package_show')( + context, + {'id': showcase_id} + ) + showcase_list.append(showcase) + except NotAuthorized: + log.debug('Not authorized to access Package with ID: ' + + str(showcase_id)) return showcase_list diff --git a/ckanext/showcase/logic/action/update.py b/ckanext/showcase/logic/action/update.py index 68c10115..dc7e7caa 100644 --- a/ckanext/showcase/logic/action/update.py +++ b/ckanext/showcase/logic/action/update.py @@ -9,7 +9,14 @@ def showcase_update(context, data_dict): - upload = uploader.Upload('showcase', data_dict['image_url']) + # If get_uploader is available (introduced for IUploader in CKAN 2.5), use + # it, otherwise use the default uploader. + # https://github.com/ckan/ckan/pull/2510 + try: + upload = uploader.get_uploader('showcase', data_dict['image_url']) + except AttributeError: + upload = uploader.Upload('showcase', data_dict['image_url']) + upload.update_data_dict(data_dict, 'image_url', 'image_upload', 'clear_upload') diff --git a/ckanext/showcase/logic/schema.py b/ckanext/showcase/logic/schema.py index fd30dca0..bcce6aa1 100644 --- a/ckanext/showcase/logic/schema.py +++ b/ckanext/showcase/logic/schema.py @@ -45,7 +45,7 @@ def showcase_base_schema(): 'image_url': [toolkit.get_validator('ignore_missing'), toolkit.get_converter('convert_to_extras')], 'original_related_item_id': [ - toolkit.get_converter('ignore_missing'), + toolkit.get_validator('ignore_missing'), toolkit.get_converter('convert_to_extras')] } return schema @@ -108,7 +108,7 @@ def showcase_show_schema(): toolkit.get_validator('ignore_missing')], 'original_related_item_id': [ toolkit.get_converter('convert_from_extras'), - toolkit.get_validator('ignore_missing')], + toolkit.get_validator('ignore_missing')] }) return schema diff --git a/ckanext/showcase/plugin.py b/ckanext/showcase/plugin.py index b14e311a..4e0b18d6 100644 --- a/ckanext/showcase/plugin.py +++ b/ckanext/showcase/plugin.py @@ -1,3 +1,5 @@ +import os +import sys import logging import ckan.plugins as plugins @@ -37,13 +39,18 @@ class ShowcasePlugin(plugins.SingletonPlugin, lib_plugins.DefaultDatasetForm): plugins.implements(plugins.IPackageController, inherit=True) plugins.implements(plugins.ITemplateHelpers) + # ITranslation only available in 2.5+ + try: + plugins.implements(plugins.ITranslation) + except AttributeError: + pass + # IConfigurer def update_config(self, config): tk.add_template_directory(config, 'templates') tk.add_public_directory(config, 'public') - # If ckan is more than 2.3, use the 2.4+ toolkit method - if not tk.check_ckan_version(max_version='2.3'): + if tk.check_ckan_version(min_version='2.4'): tk.add_ckan_admin_tab(config, 'ckanext_showcase_admins', 'Showcase Config') @@ -241,8 +248,48 @@ def before_search(self, search_params): `showcase`. ''' fq = search_params.get('fq', '') + if u'dataset_type:{0}'.format(DATASET_TYPE_NAME) not in fq: fq = u'{0} -dataset_type:{1}'.format(search_params.get('fq', ''), DATASET_TYPE_NAME) search_params.update({'fq': fq}) + return search_params + + # ITranslation + + # The following methods copied from ckan.lib.plugins.DefaultTranslation so + # we don't have to mix it into the class. This means we can use Showcase + # even if ITranslation isn't available (less than 2.5). + + def i18n_directory(self): + '''Change the directory of the *.mo translation files + + The default implementation assumes the plugin is + ckanext/myplugin/plugin.py and the translations are stored in + i18n/ + ''' + # assume plugin is called ckanext..<...>.PluginClass + extension_module_name = '.'.join(self.__module__.split('.')[0:2]) + module = sys.modules[extension_module_name] + return os.path.join(os.path.dirname(module.__file__), 'i18n') + + def i18n_locales(self): + '''Change the list of locales that this plugin handles + + By default the will assume any directory in subdirectory in the + directory defined by self.directory() is a locale handled by this + plugin + ''' + directory = self.i18n_directory() + return [d for + d in os.listdir(directory) + if os.path.isdir(os.path.join(directory, d))] + + def i18n_domain(self): + '''Change the gettext domain handled by this plugin + + This implementation assumes the gettext domain is + ckanext-{extension name}, hence your pot, po and mo files should be + named ckanext-{extension name}.mo''' + return 'ckanext-{name}'.format(name=self.name) diff --git a/ckanext/showcase/templates/package/read_base.html b/ckanext/showcase/templates/package/read_base.html index 097651a8..4a2817d5 100644 --- a/ckanext/showcase/templates/package/read_base.html +++ b/ckanext/showcase/templates/package/read_base.html @@ -1,8 +1,6 @@ {% ckan_extends %} {% block content_primary_nav %} - {{ h.build_nav_icon('dataset_read', _('Dataset'), id=pkg.name) }} - {{ h.build_nav_icon('dataset_groups', _('Groups'), id=pkg.name) }} - {{ h.build_nav_icon('dataset_activity', _('Activity Stream'), id=pkg.name) }} + {{ super() }} {{ h.build_nav_icon('dataset_showcase_list', _('Showcases'), id=pkg.name) }} {% endblock %} diff --git a/ckanext/showcase/templates/showcase/add_datasets.html b/ckanext/showcase/templates/showcase/add_datasets.html index 9465ec2c..6b79ddf2 100644 --- a/ckanext/showcase/templates/showcase/add_datasets.html +++ b/ckanext/showcase/templates/showcase/add_datasets.html @@ -44,7 +44,7 @@

diff --git a/ckanext/showcase/templates/showcase/edit_base.html b/ckanext/showcase/templates/showcase/edit_base.html index 7b305bfd..c863b70b 100644 --- a/ckanext/showcase/templates/showcase/edit_base.html +++ b/ckanext/showcase/templates/showcase/edit_base.html @@ -6,7 +6,7 @@ {% block styles %} {{ super() }} - + {% endblock %} {% block breadcrumb_content_selected %}{% endblock %} diff --git a/ckanext/showcase/templates/showcase/manage_datasets.html b/ckanext/showcase/templates/showcase/manage_datasets.html index 84a66343..10a35ef2 100644 --- a/ckanext/showcase/templates/showcase/manage_datasets.html +++ b/ckanext/showcase/templates/showcase/manage_datasets.html @@ -47,7 +47,7 @@

{{ _('Datasets available to add to this showcase') }}
@@ -105,7 +105,7 @@

{{ _('Datasets in this showcase') }}

diff --git a/ckanext/showcase/templates/showcase/read.html b/ckanext/showcase/templates/showcase/read.html index 3a79e00c..d7f093b5 100644 --- a/ckanext/showcase/templates/showcase/read.html +++ b/ckanext/showcase/templates/showcase/read.html @@ -7,7 +7,7 @@ {% block styles %} {{ super() }} - + {% endblock %} {% block links -%} @@ -49,7 +49,7 @@ {% block package_description %} {% if pkg.private %} - + {{ _('Private') }} {% endif %} @@ -75,7 +75,7 @@

{% endblock %} {% if pkg.url %} -

{{ _('Launch website') }}

+

{{ _('Launch website') }}

{% endif %} {% endblock %} @@ -93,7 +93,7 @@

{% block secondary_help_content %}{% endblock %} {% block package_info %} - {% snippet 'showcase/snippets/showcase_info.html', pkg=pkg %} + {% snippet 'showcase/snippets/showcase_info.html', pkg=pkg, showcase_pkgs=c.showcase_pkgs %} {% endblock %} {% block package_social %} diff --git a/ckanext/showcase/templates/showcase/search.html b/ckanext/showcase/templates/showcase/search.html index c7173da5..4d0d35ab 100644 --- a/ckanext/showcase/templates/showcase/search.html +++ b/ckanext/showcase/templates/showcase/search.html @@ -48,6 +48,6 @@ {{ h.snippet('snippets/facet_list.html', title=c.facet_titles[facet], name=facet) }} {% endfor %} - close + close {% endblock %} diff --git a/ckanext/showcase/templates/showcase/snippets/helper.html b/ckanext/showcase/templates/showcase/snippets/helper.html index d51c5376..fdc1894f 100644 --- a/ckanext/showcase/templates/showcase/snippets/helper.html +++ b/ckanext/showcase/templates/showcase/snippets/helper.html @@ -1,6 +1,6 @@

- + {{ _('What are Showcases?') }}

diff --git a/ckanext/showcase/templates/showcase/snippets/showcase_info.html b/ckanext/showcase/templates/showcase/snippets/showcase_info.html index c07dd36d..957ae82e 100644 --- a/ckanext/showcase/templates/showcase/snippets/showcase_info.html +++ b/ckanext/showcase/templates/showcase/snippets/showcase_info.html @@ -24,7 +24,7 @@

{{ pkg.title or pkg.name }}

{% if pkg.url %} {% endif %} @@ -34,10 +34,10 @@

{{ pkg.title or pkg.name }}

-

{{ _('Datasets in Showcase') }}

- {% if c.showcase_pkgs %} +

{{ _('Datasets in Showcase') }}

+ {% if showcase_pkgs %}