Skip to content

Commit

Permalink
Merge pull request #5 from sebastibe/master
Browse files Browse the repository at this point in the history
Form label translations
  • Loading branch information
damyanbogoev committed Jun 10, 2018
2 parents 74b63e3 + 7f82cec commit 4244be7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
4 changes: 3 additions & 1 deletion bookshelf/admin/forms/author_forms.py
@@ -1,4 +1,6 @@
from wtforms import Form, TextField, validators
from flask_babel import lazy_gettext as _


class CreateAuthorForm(Form):
names = TextField('Names', [validators.Length(min=5, max=70)])
names = TextField(_('Names'), [validators.Length(min=5, max=70)])
4 changes: 2 additions & 2 deletions bookshelf/admin/templates/admin_index.htm
@@ -1,6 +1,6 @@
{% extends 'layout.htm' %}
{% block container %}
<div class="top-pad">
<a class="navbar-brand" href="{{ url_for('admin.create_author') }}">Create an Author</a>
<a class="navbar-brand" href="{{ url_for('admin.create_author') }}">{{ _('Create an Author') }}</a>
</div>
{% endblock %}
{% endblock %}
4 changes: 2 additions & 2 deletions bookshelf/admin/templates/create_author.htm
Expand Up @@ -11,7 +11,7 @@
<form method="POST" action="{{url_for('admin.create_author')}}">
{{ form.csrf_token }}
{{ form.names.label }} {{ form.names(size=20) }}
<input type="submit" value="Create">
<input type="submit" value="{{ _('Create') }}">
</form>
</div>
{% endblock %}
{% endblock %}
4 changes: 2 additions & 2 deletions bookshelf/babel.cfg
@@ -1,3 +1,3 @@
[python 1="**.py" language=":"][/python]
[python: **.py]
[jinja2: **/templates/**.htm]
extensions=jinja2.ext.autoescape,jinja2.ext.with_
extensions=jinja2.ext.autoescape,jinja2.ext.with_
12 changes: 12 additions & 0 deletions bookshelf/translations/bg/LC_MESSAGES/messages.po
Expand Up @@ -19,6 +19,18 @@ msgstr ""
"Generated-By: Babel 2.2.0\n"
"X-Generator: Poedit 1.8.6\n"

#: bookshelf/admin/forms/author_forms.py:6
msgid "Names"
msgstr "Имена"

#: bookshelf/admin/templates/admin_index.htm:4
msgid "Create an Author"
msgstr "Създайте автор"

#: bookshelf/admin/templates/create_author.htm:14
msgid "Create"
msgstr "Създайте"

#: bookshelf/main/templates/authors.htm:7
msgid "id"
msgstr "id"
Expand Down
12 changes: 12 additions & 0 deletions bookshelf/translations/fr/LC_MESSAGES/messages.po
Expand Up @@ -19,6 +19,18 @@ msgstr ""
"Last-Translator: \n"
"X-Generator: Poedit 1.8.6\n"

#: bookshelf/admin/forms/author_forms.py:6
msgid "Names"
msgstr "Noms"

#: bookshelf/admin/templates/admin_index.htm:4
msgid "Create an Author"
msgstr "Ajouter un auteur"

#: bookshelf/admin/templates/create_author.htm:14
msgid "Create"
msgstr "Ajouter"

#: bookshelf/main/templates/authors.htm:7
msgid "id"
msgstr "id"
Expand Down

0 comments on commit 4244be7

Please sign in to comment.