Update extension to use ITranslation interface
This commit is contained in:
parent
6a94f97837
commit
472b56c55a
|
@ -2,7 +2,7 @@
|
|||
host = https://www.transifex.com
|
||||
|
||||
[sixodp.ckanext-rating]
|
||||
file_filter = i18n/<lang>/LC_MESSAGES/ckanext-rating.po
|
||||
source_file = i18n/ckanext-rating.pot
|
||||
file_filter = ckanext/rating/i18n/<lang>/LC_MESSAGES/ckanext-rating.po
|
||||
source_file = ckanext/rating/i18n/ckanext-rating.pot
|
||||
source_lang = en
|
||||
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
|
||||
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,13 +47,15 @@ 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.IPackageController, 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
|
||||
|
||||
|
|
12
setup.cfg
12
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
|
Loading…
Reference in New Issue