i18n: Use new translation string factory.
- Use the translation factory create in rhodecode.translation instead of creating multiple instances in each module.
This commit is contained in:
parent
a15878f3b3
commit
e3428604d0
5 changed files with 7 additions and 15 deletions
|
|
@ -21,12 +21,11 @@
|
|||
import logging
|
||||
|
||||
from pyramid.exceptions import ConfigurationError
|
||||
from pyramid.i18n import TranslationStringFactory
|
||||
|
||||
from rhodecode.lib.utils2 import safe_str
|
||||
from rhodecode.model.settings import SettingsModel
|
||||
from rhodecode.translation import _
|
||||
|
||||
_ = TranslationStringFactory('rhodecode-enterprise')
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,7 @@
|
|||
|
||||
import colander
|
||||
|
||||
from pyramid.i18n import TranslationStringFactory
|
||||
|
||||
_ = TranslationStringFactory('rhodecode-enterprise')
|
||||
from rhodecode.translation import _
|
||||
|
||||
|
||||
class AuthnPluginSettingsSchemaBase(colander.MappingSchema):
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import formencode.htmlfill
|
|||
import logging
|
||||
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
from pyramid.i18n import TranslationStringFactory
|
||||
from pyramid.renderers import render
|
||||
from pyramid.response import Response
|
||||
|
||||
|
|
@ -34,11 +33,10 @@ from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
|
|||
from rhodecode.model.forms import AuthSettingsForm
|
||||
from rhodecode.model.meta import Session
|
||||
from rhodecode.model.settings import SettingsModel
|
||||
from rhodecode.translation import _
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
_ = TranslationStringFactory('rhodecode-enterprise')
|
||||
|
||||
|
||||
class AuthnPluginViewBase(object):
|
||||
|
||||
|
|
|
|||
|
|
@ -22,15 +22,12 @@ import datetime
|
|||
import formencode
|
||||
import logging
|
||||
import urlparse
|
||||
import uuid
|
||||
|
||||
from pylons import url
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
from pyramid.i18n import TranslationStringFactory
|
||||
from pyramid.view import view_config
|
||||
from recaptcha.client.captcha import submit
|
||||
|
||||
from rhodecode.authentication.base import loadplugin
|
||||
from rhodecode.events import UserRegistered
|
||||
from rhodecode.lib.auth import (
|
||||
AuthUser, HasPermissionAnyDecorator, CSRFRequired)
|
||||
|
|
@ -43,10 +40,9 @@ from rhodecode.model.login_session import LoginSession
|
|||
from rhodecode.model.meta import Session
|
||||
from rhodecode.model.settings import SettingsModel
|
||||
from rhodecode.model.user import UserModel
|
||||
from rhodecode.translation import _
|
||||
|
||||
|
||||
_ = TranslationStringFactory('rhodecode-enterprise')
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,11 @@
|
|||
|
||||
|
||||
import pylons
|
||||
from pyramid.i18n import get_localizer, TranslationStringFactory
|
||||
|
||||
from pyramid.i18n import get_localizer
|
||||
from pyramid.threadlocal import get_current_request
|
||||
|
||||
tsf = TranslationStringFactory('rc_root')
|
||||
from rhodecode.translation import _ as tsf
|
||||
|
||||
|
||||
def add_renderer_globals(event):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue