Update extension to use ITranslation interface
This commit is contained in:
parent
6a94f97837
commit
472b56c55a
|
@ -2,7 +2,7 @@
|
||||||
host = https://www.transifex.com
|
host = https://www.transifex.com
|
||||||
|
|
||||||
[sixodp.ckanext-rating]
|
[sixodp.ckanext-rating]
|
||||||
file_filter = i18n/<lang>/LC_MESSAGES/ckanext-rating.po
|
file_filter = ckanext/rating/i18n/<lang>/LC_MESSAGES/ckanext-rating.po
|
||||||
source_file = i18n/ckanext-rating.pot
|
source_file = ckanext/rating/i18n/ckanext-rating.pot
|
||||||
source_lang = en
|
source_lang = en
|
||||||
type = PO
|
type = PO
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -8,6 +8,7 @@ from ckanext.rating.logic import action
|
||||||
from ckanext.rating import helpers
|
from ckanext.rating import helpers
|
||||||
import ckanext.rating.logic.auth as rating_auth
|
import ckanext.rating.logic.auth as rating_auth
|
||||||
from ckanext.rating.model import Rating
|
from ckanext.rating.model import Rating
|
||||||
|
from ckan.lib.plugins import DefaultTranslation
|
||||||
|
|
||||||
|
|
||||||
def sort_by_rating(sort):
|
def sort_by_rating(sort):
|
||||||
|
@ -46,13 +47,15 @@ def sort_by_rating(sort):
|
||||||
return q
|
return q
|
||||||
|
|
||||||
|
|
||||||
class RatingPlugin(plugins.SingletonPlugin):
|
class RatingPlugin(plugins.SingletonPlugin, DefaultTranslation):
|
||||||
plugins.implements(plugins.IConfigurer)
|
plugins.implements(plugins.IConfigurer)
|
||||||
plugins.implements(plugins.IActions)
|
plugins.implements(plugins.IActions)
|
||||||
plugins.implements(plugins.ITemplateHelpers)
|
plugins.implements(plugins.ITemplateHelpers)
|
||||||
plugins.implements(plugins.IAuthFunctions)
|
plugins.implements(plugins.IAuthFunctions)
|
||||||
plugins.implements(plugins.IPackageController, inherit=True)
|
plugins.implements(plugins.IPackageController, inherit=True)
|
||||||
plugins.implements(plugins.IRoutes, inherit=True)
|
plugins.implements(plugins.IRoutes, inherit=True)
|
||||||
|
if toolkit.check_ckan_version(min_version='2.5.0'):
|
||||||
|
plugins.implements(plugins.ITranslation, inherit=True)
|
||||||
|
|
||||||
# IConfigurer
|
# IConfigurer
|
||||||
|
|
||||||
|
|
12
setup.cfg
12
setup.cfg
|
@ -1,21 +1,21 @@
|
||||||
[extract_messages]
|
[extract_messages]
|
||||||
keywords = translate isPlural
|
keywords = translate isPlural
|
||||||
add_comments = TRANSLATORS:
|
add_comments = TRANSLATORS:
|
||||||
output_file = i18n/ckanext-rating.pot
|
output_file = ckanext/rating/i18n/ckanext-rating.pot
|
||||||
width = 80
|
width = 80
|
||||||
|
|
||||||
[init_catalog]
|
[init_catalog]
|
||||||
domain = ckanext-rating
|
domain = ckanext-rating
|
||||||
input_file = i18n/ckanext-rating.pot
|
input_file = ckanext/rating/i18n/ckanext-rating.pot
|
||||||
output_dir = i18n
|
output_dir = ckanext/rating/i18n
|
||||||
|
|
||||||
[update_catalog]
|
[update_catalog]
|
||||||
domain = ckanext-rating
|
domain = ckanext-rating
|
||||||
input_file = i18n/ckanext-rating.pot
|
input_file = ckanext/rating/i18n/ckanext-rating.pot
|
||||||
output_dir = i18n
|
output_dir = ckanext/rating/i18n
|
||||||
previous = true
|
previous = true
|
||||||
|
|
||||||
[compile_catalog]
|
[compile_catalog]
|
||||||
domain = ckanext-rating
|
domain = ckanext-rating
|
||||||
directory = i18n
|
directory = ckanext/rating/i18n
|
||||||
statistics = true
|
statistics = true
|
Loading…
Reference in New Issue