diff --git a/.tx/config b/.tx/config index 769ad2d..53fa919 100644 --- a/.tx/config +++ b/.tx/config @@ -2,7 +2,7 @@ host = https://www.transifex.com [sixodp.ckanext-rating] -file_filter = i18n//LC_MESSAGES/ckanext-rating.po -source_file = i18n/ckanext-rating.pot +file_filter = ckanext/rating/i18n//LC_MESSAGES/ckanext-rating.po +source_file = ckanext/rating/i18n/ckanext-rating.pot source_lang = en type = PO \ No newline at end of file diff --git a/i18n/ckanext-rating.pot b/ckanext/rating/i18n/ckanext-rating.pot similarity index 100% rename from i18n/ckanext-rating.pot rename to ckanext/rating/i18n/ckanext-rating.pot diff --git a/ckanext/rating/i18n/en_GB/LC_MESSAGES/ckanext-rating.mo b/ckanext/rating/i18n/en_GB/LC_MESSAGES/ckanext-rating.mo new file mode 100644 index 0000000..2b39fe0 Binary files /dev/null and b/ckanext/rating/i18n/en_GB/LC_MESSAGES/ckanext-rating.mo differ diff --git a/i18n/en_GB/LC_MESSAGES/ckanext-rating.po b/ckanext/rating/i18n/en_GB/LC_MESSAGES/ckanext-rating.po similarity index 100% rename from i18n/en_GB/LC_MESSAGES/ckanext-rating.po rename to ckanext/rating/i18n/en_GB/LC_MESSAGES/ckanext-rating.po diff --git a/ckanext/rating/i18n/fi/LC_MESSAGES/ckanext-rating.mo b/ckanext/rating/i18n/fi/LC_MESSAGES/ckanext-rating.mo new file mode 100644 index 0000000..ea94cf1 Binary files /dev/null and b/ckanext/rating/i18n/fi/LC_MESSAGES/ckanext-rating.mo differ diff --git a/i18n/fi/LC_MESSAGES/ckanext-rating.po b/ckanext/rating/i18n/fi/LC_MESSAGES/ckanext-rating.po similarity index 67% rename from i18n/fi/LC_MESSAGES/ckanext-rating.po rename to ckanext/rating/i18n/fi/LC_MESSAGES/ckanext-rating.po index 722d2cc..6c2d172 100644 --- a/i18n/fi/LC_MESSAGES/ckanext-rating.po +++ b/ckanext/rating/i18n/fi/LC_MESSAGES/ckanext-rating.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2016-11-22 13:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Mikko Nieminen , 2016\n" +"Last-Translator: Zharktas , 2017\n" "Language-Team: Finnish (https://www.transifex.com/6aika-dataportal/teams/68018/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -21,28 +21,28 @@ msgstr "" #: ckanext/rating/logic/action.py:29 msgid "You must supply a package id or name (parameter \"package\")." -msgstr "" +msgstr "Sinun täytyy antaa tietoaineiston id tai nimi (parametri \"package\")." #: ckanext/rating/logic/action.py:32 msgid "You must supply a rating (parameter \"rating\")." -msgstr "" +msgstr "Luokitus täytyy antaa (parametri \"rating\")." #: ckanext/rating/logic/action.py:37 msgid "Rating must be an integer value." -msgstr "" +msgstr "Arvosanan on oltava numero" #: ckanext/rating/logic/action.py:41 #, python-format msgid "Rating must be between %i and %i." -msgstr "" +msgstr "Arvosanan on oltava väliltä %i ja %i." #: ckanext/rating/logic/action.py:44 msgid "Not found" -msgstr "" +msgstr "Ei löytynyt" #: ckanext/rating/logic/action.py:59 msgid "You must supply a package id (parameter \"package_id\")." -msgstr "" +msgstr "Sinun täytyy antaa tietoaineiston id (parametri \"package_id\")." #: ckanext/rating/templates/package/snippets/info.html:23 msgid "Rating" @@ -55,11 +55,11 @@ msgstr "Antamasi arvosana" #: ckanext/rating/templates/package/snippets/info.html:43 msgid "Followers" -msgstr "" +msgstr "Seuraajat" #: ckanext/rating/templates/rating/rating_description.html:10 msgid "no rating given" -msgstr "arvostelua ei annettu" +msgstr "arvosanaa ei annettu" #: ckanext/rating/templates/rating/rating_description.html:12 msgid "bad" @@ -88,38 +88,3 @@ msgstr "arvostelu" #: ckanext/rating/templates/rating/stars_inactive.html:23 msgid "ratings" msgstr "arvostelua" - -#: ckanext/rating/templates/showcase/snippets/showcase_info.html:8 -msgid "Submitted by" -msgstr "" - -#: ckanext/rating/templates/showcase/snippets/showcase_info.html:26 -msgid "Launch website" -msgstr "" - -#: ckanext/rating/templates/showcase/snippets/showcase_item.html:19 -msgid "This showcase has no description" -msgstr "" - -#: ckanext/rating/templates/showcase/snippets/showcase_item.html:24 -msgid "{num} Dataset" -msgid_plural "{num} Datasets" -msgstr[0] "" -msgstr[1] "" - -#: ckanext/rating/templates/showcase/snippets/showcase_item.html:26 -msgid "0 Datasets" -msgstr "" - -#: ckanext/rating/templates/showcase/snippets/showcase_item.html:30 -#: ckanext/rating/templates/showcase/snippets/showcase_item.html:31 -msgid "View {showcase_title}" -msgstr "" - -#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 -msgid "Remove" -msgstr "" - -#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 -msgid "Remove dataset from this showcase" -msgstr "" diff --git a/ckanext/rating/i18n/sv/LC_MESSAGES/ckanext-rating.mo b/ckanext/rating/i18n/sv/LC_MESSAGES/ckanext-rating.mo new file mode 100644 index 0000000..034f987 Binary files /dev/null and b/ckanext/rating/i18n/sv/LC_MESSAGES/ckanext-rating.mo differ diff --git a/i18n/sv/LC_MESSAGES/ckanext-rating.po b/ckanext/rating/i18n/sv/LC_MESSAGES/ckanext-rating.po similarity index 100% rename from i18n/sv/LC_MESSAGES/ckanext-rating.po rename to ckanext/rating/i18n/sv/LC_MESSAGES/ckanext-rating.po diff --git a/ckanext/rating/plugin.py b/ckanext/rating/plugin.py index e5483ff..ea871d2 100644 --- a/ckanext/rating/plugin.py +++ b/ckanext/rating/plugin.py @@ -8,6 +8,7 @@ from ckanext.rating.logic import action from ckanext.rating import helpers import ckanext.rating.logic.auth as rating_auth from ckanext.rating.model import Rating +from ckan.lib.plugins import DefaultTranslation def sort_by_rating(sort): @@ -46,12 +47,14 @@ def sort_by_rating(sort): return q -class RatingPlugin(plugins.SingletonPlugin): +class RatingPlugin(plugins.SingletonPlugin, DefaultTranslation): plugins.implements(plugins.IConfigurer) plugins.implements(plugins.IActions) plugins.implements(plugins.ITemplateHelpers) plugins.implements(plugins.IAuthFunctions) plugins.implements(plugins.IRoutes, inherit=True) + if toolkit.check_ckan_version(min_version='2.5.0'): + plugins.implements(plugins.ITranslation, inherit=True) # IConfigurer diff --git a/setup.cfg b/setup.cfg index f91391b..09c9d3d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,21 +1,21 @@ [extract_messages] keywords = translate isPlural add_comments = TRANSLATORS: -output_file = i18n/ckanext-rating.pot +output_file = ckanext/rating/i18n/ckanext-rating.pot width = 80 [init_catalog] domain = ckanext-rating -input_file = i18n/ckanext-rating.pot -output_dir = i18n +input_file = ckanext/rating/i18n/ckanext-rating.pot +output_dir = ckanext/rating/i18n [update_catalog] domain = ckanext-rating -input_file = i18n/ckanext-rating.pot -output_dir = i18n +input_file = ckanext/rating/i18n/ckanext-rating.pot +output_dir = ckanext/rating/i18n previous = true [compile_catalog] domain = ckanext-rating -directory = i18n +directory = ckanext/rating/i18n statistics = true \ No newline at end of file