Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
i18n: configuration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikuncar committed Apr 3, 2017
1 parent 049f0a7 commit de20eed
Show file tree
Hide file tree
Showing 17 changed files with 511 additions and 430 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ deploy:
user: jirikuncar
password:
secure: xzhkM+54+dmI7aFxWdMxTkHcMfOzuAxcGOpBanY367MyETtmNZUQx1VAQh5381UHiQ0+mg433srWrR4V1h0tsSB31KZAPazeh44zxpJRCv9b5Fx+46PmYW6ZpY8+vqUpFrKCcaLX5ZmEf62xXY3cvMbp0ubAURiV6N+hHyuH90w+3xucrSnFOuVHVuI3Eqp5Bz6zxEKscrIaZiT9CPh0F2jBpGZT8qXCYT1N8xeyH0SCszvKsIIoaPitpQDnoSkBfy6VHiNU6Tznseer6uLzrW80ynKu5mZwjT4mGT0j/rBUcbIpAYHajnsHXL27Gu32mli7beOkgd2vEpb14x5JygkPoYoUnSJlwhRUgAkNZVR5teNOcP87wU6ZAdv1jhfuQA/NUUpZucVpzASojAxf2996krT4hjYz7KJ2z5lSOww016EZ5mxyktGF23KXH9zrCWUv24r1K9JOUH+6OuQHFF40q1YiL2ro63raUdLm/Y3DLgeO6oDXZPMI2DFdRFCSpY2sGI6ZBrU89MuCJhju5Y838hOWQS330UcA71MpcsnmSZDsJ9o+Rrty6wowOdMqx4bmrm0G8ILNK4MosO7KwXZUMj/iV4SLUQjhBLhOTS+vLO8sa7PCZssK7z8C+378Y4Q+hrfsctCCGVBgRhuIr5KSLtKeD3bObQ/4VfIdK9E=
distributions: "sdist bdist_wheel"
distributions: "compile_catalog sdist bdist_wheel"
on:
repo: inveniosoftware/flask-security-fork
tags: true
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include AUTHORS
include CHANGES
include LICENSE
include README.rst
include babel.ini
include pytest.ini
include tox.ini
recursive-exclude tests/__pycache__ *
Expand All @@ -15,6 +16,6 @@ recursive-include docs *.rst
recursive-include docs *.txt
recursive-include docs Makefile
recursive-include flask_security/templates *.*
recursive-include flask_security/translations *
recursive-include flask_security/translations *.po *.pot *.mo
recursive-include tests *
prune scripts
10 changes: 10 additions & 0 deletions babel.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Extraction from Python source files

[python: **.py]
encoding = utf-8

# Extraction from Jinja2 templates

[jinja2: **/templates/**.html]
encoding = utf-8
extensions = jinja2.ext.autoescape, jinja2.ext.with_
5 changes: 0 additions & 5 deletions babel/babel.ini

This file was deleted.

4 changes: 0 additions & 4 deletions babel/babel.sh

This file was deleted.

302 changes: 0 additions & 302 deletions babel/security.pot

This file was deleted.

17 changes: 14 additions & 3 deletions flask_security/babel.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# -*- coding: utf-8 -*-
"""
flask_security.babel
~~~~~~~~~~~~~~~~~~~~
I18N support for Flask-Security.
"""

import pkg_resources

from flask_babelex import Domain
from flask_security import translations
from wtforms.i18n import messages_path


class CustomDomain(Domain):
def __init__(self):
super(CustomDomain, self).__init__(
translations.__path__[0], domain='security')
pkg_resources.resource_filename('flask_security', 'translations'),
domain='flask_security'
)

domain = CustomDomain()

Expand All @@ -19,7 +30,7 @@ def __init__(self):


class Translations(object):
''' Fixes WTForms translation support and uses wtforms translations '''
"""Fixes WTForms translation support and uses wtforms translations."""

def gettext(self, string):
return wtforms_domain.gettext(string)
Expand Down
Loading

0 comments on commit de20eed

Please sign in to comment.