diff --git a/.tx/config b/.tx/config index 87de8de338..2cddc45134 100644 --- a/.tx/config +++ b/.tx/config @@ -1,6 +1,12 @@ [main] host = https://www.transifex.com +[wagtail.wagtailsnippets] +file_filter = wagtail/wagtailsnippets/locale//LC_MESSAGES/django.po +source_file = wagtail/wagtailsnippets/locale/en/LC_MESSAGES/django.po +source_lang = en +type = PO + [wagtail.wagtailusers] file_filter = wagtail/wagtailusers/locale//LC_MESSAGES/django.po source_file = wagtail/wagtailusers/locale/en/LC_MESSAGES/django.po diff --git a/wagtail/wagtailsnippets/locale/en/LC_MESSAGES/django.po b/wagtail/wagtailsnippets/locale/en/LC_MESSAGES/django.po new file mode 100644 index 0000000000..6718e703a1 --- /dev/null +++ b/wagtail/wagtailsnippets/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,123 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-19 20:59+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: .\templates\wagtailsnippets\chooser\choose.html:2 +msgid "Choose" +msgstr "" + +#: .\templates\wagtailsnippets\edit_handlers\snippet_chooser_panel.html:10 +#, python-format +msgid "Choose another %(snippet_type_name)s" +msgstr "" + +#: .\templates\wagtailsnippets\edit_handlers\snippet_chooser_panel.html:11 +#, python-format +msgid "Choose %(snippet_type_name)s" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\confirm_delete.html:3 +#, python-format +msgid "Delete %(snippet_type_name)s - %(instance)s" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\confirm_delete.html:6 +#: .\templates\wagtailsnippets\snippets\edit.html:20 +msgid "Delete" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\confirm_delete.html:10 +#, python-format +msgid "Are you sure you want to delete this %(snippet_type_name)s?" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\confirm_delete.html:13 +msgid "Yes, delete" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\create.html:3 +#, python-format +msgid "New %(snippet_type_name)s" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\create.html:6 +msgid "New" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\create.html:17 +#: .\templates\wagtailsnippets\snippets\edit.html:17 +msgid "Save" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\edit.html:3 +#, python-format +msgid "Editing %(snippet_type_name)s - %(instance)s" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\edit.html:6 +msgid "Editing" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\index.html:3 +msgid "Snippets" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\list.html:8 +msgid "Title" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\type_index.html:3 +#, python-format +msgid "Snippets %(snippet_type_name_plural|capfirst)s" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\type_index.html:10 +#, python-format +msgid "Snippets %(snippet_type_name_plural|capfirst)s" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\type_index.html:13 +#, python-format +msgid "Add %(snippet_type_name)s" +msgstr "" + +#: .\templates\wagtailsnippets\snippets\type_index.html:23 +#, python-format +msgid "" +"No %(snippet_type_name_plural)s have been created. Why not add one?" +msgstr "" + +#: .\views\snippets.py:127 +msgid "{snippet_type} '{instance}' created." +msgstr "" + +#: .\views\snippets.py:134 +msgid "The snippet could not be created due to errors." +msgstr "" + +#: .\views\snippets.py:168 +msgid "{snippet_type} '{instance}' updated." +msgstr "" + +#: .\views\snippets.py:175 +msgid "The snippet could not be saved due to errors." +msgstr "" + +#: .\views\snippets.py:204 +msgid "{snippet_type} '{instance}' deleted." +msgstr "" diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html index 51603cd543..11b91ac747 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html @@ -1,4 +1,6 @@ -{% include "wagtailadmin/shared/header.html" with title="Choose" subtitle=snippet_type_name %} +{% load i18n %} +{% trans "Choose" as choose_str %} +{% include "wagtailadmin/shared/header.html" with title=choose_str subtitle=snippet_type_name %}
{% include "wagtailsnippets/snippets/list.html" with choosing=1 %} diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/edit_handlers/snippet_chooser_panel.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/edit_handlers/snippet_chooser_panel.html index a48cca73c1..d58da62460 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/edit_handlers/snippet_chooser_panel.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/edit_handlers/snippet_chooser_panel.html @@ -1,4 +1,5 @@ {% extends "wagtailadmin/edit_handlers/chooser_panel.html" %} +{% load i18n %} {% block chooser_class %}snippet-chooser{% endblock %} @@ -6,5 +7,5 @@ {% if is_chosen %}{{ item }}{% endif %} {% endblock %} -{% block choose_another_button_label %}Choose another {{ snippet_type_name }}{% endblock %} -{% block choose_button_label %}Choose {{ snippet_type_name }}{% endblock %} +{% block choose_another_button_label %}{% blocktrans %}Choose another {{ snippet_type_name }}{% endblocktrans %}{% endblock %} +{% block choose_button_label %}{% blocktrans %}Choose {{ snippet_type_name }}{% endblocktrans %}{% endblock %} diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/confirm_delete.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/confirm_delete.html index 2f62300fba..55c459c3dd 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/confirm_delete.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/confirm_delete.html @@ -1,15 +1,16 @@ {% extends "wagtailadmin/base.html" %} -{% block titletag %}Delete {{ snippet_type_name}} - {{ instance }}{% endblock %} +{% load i18n %} +{% block titletag %}{% blocktrans %}Delete {{ snippet_type_name}} - {{ instance }}{% endblocktrans %}{% endblock %} {% block bodyclass %}menu-snippets{% endblock %} {% block content %} - - {% include "wagtailadmin/shared/header.html" with title="Delete" subtitle=instance %} + {% trans "Delete" as delete_str %} + {% include "wagtailadmin/shared/header.html" with title=delete_str subtitle=instance %}
-

Are you sure you want to delete this {{ snippet_type_name }}?

+

{% blocktrans %}Are you sure you want to delete this {{ snippet_type_name }}?{% endblocktrans %}

{% csrf_token %} - +
diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/create.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/create.html index a882ad70e5..502170498f 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/create.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/create.html @@ -1,9 +1,10 @@ {% extends "wagtailadmin/base.html" %} -{% block titletag %}New {{ snippet_type_name}}{% endblock %} +{% load i18n %} +{% block titletag %}{% blocktrans %}New {{ snippet_type_name}}{% endblocktrans %}{% endblock %} {% block bodyclass %}menu-snippets{% endblock %} {% block content %} - - {% include "wagtailadmin/shared/header.html" with title="New" subtitle=snippet_type_name %} + {% trans "New" as new_str %} + {% include "wagtailadmin/shared/header.html" with title=new_str subtitle=snippet_type_name %}
{% csrf_token %} @@ -13,7 +14,7 @@
diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/edit.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/edit.html index 9bd0ae5f22..947fb8b31a 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/edit.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/edit.html @@ -1,9 +1,10 @@ {% extends "wagtailadmin/base.html" %} -{% block titletag %}Editing {{ snippet_type_name}} - {{ instance }}{% endblock %} +{% load i18n %} +{% block titletag %}{% blocktrans %}Editing {{ snippet_type_name}} - {{ instance }}{% endblocktrans %}{% endblock %} {% block bodyclass %}menu-snippets{% endblock %} {% block content %} - - {% include "wagtailadmin/shared/header.html" with title="Editing" subtitle=instance %} + {% trans "Editing" as editing_str %} + {% include "wagtailadmin/shared/header.html" with title=editing_str subtitle=instance %} {% csrf_token %} @@ -13,10 +14,10 @@
  • diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/index.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/index.html index 21f27b8e9f..e42a0d2c24 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/index.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/index.html @@ -1,6 +1,6 @@ {% extends "wagtailadmin/base.html" %} - -{% block titletag %}Snippets{% endblock %} +{% load i18n %} +{% block titletag %}{% trans "Snippets" %}{% endblock %} {% block bodyclass %}menu-snippets{% endblock %} {% block content %} diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/list.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/list.html index ef22dccf92..a9cf97dcde 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/list.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/list.html @@ -1,10 +1,11 @@ +{% load i18n %} - + diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/type_index.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/type_index.html index 7248211cba..6bae2cfdea 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/type_index.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/type_index.html @@ -1,15 +1,16 @@ {% extends "wagtailadmin/base.html" %} -{% block titletag %}Snippets {{ snippet_type_name_plural|capfirst }}{% endblock %} +{% load i18n %} +{% block titletag %}{% blocktrans %}Snippets {{ snippet_type_name_plural|capfirst }}{% endblocktrans %}{% endblock %} {% block bodyclass %}menu-snippets{% endblock %} {% block content %}
    -

    Snippets {{ snippet_type_name_plural|capfirst }}

    +

    {% blocktrans %}Snippets {{ snippet_type_name_plural|capfirst }}{% endblocktrans %}

    - Add {{ snippet_type_name }} + {% blocktrans %}Add {{ snippet_type_name }}{% endblocktrans %} {# TODO: figure out a way of saying "Add a/an [foo]" #}
    @@ -18,7 +19,8 @@ {% if items %} {% include "wagtailsnippets/snippets/list.html" %} {% else %} -

    No {{ snippet_type_name_plural }} have been created. Why not add one?

    + {% url 'wagtailsnippets_create' content_type.app_label content_type.model as wagtailsnippets_create_url %} +

    {% blocktrans %}No {{ snippet_type_name_plural }} have been created. Why not add one?{% endblocktrans %}

    {% endif %} {% endblock %} diff --git a/wagtail/wagtailsnippets/views/snippets.py b/wagtail/wagtailsnippets/views/snippets.py index a10a16c251..de96814a0e 100644 --- a/wagtail/wagtailsnippets/views/snippets.py +++ b/wagtail/wagtailsnippets/views/snippets.py @@ -6,6 +6,7 @@ from django.contrib.contenttypes.models import ContentType from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied +from django.utils.translation import ugettext as _ from wagtail.wagtailadmin.edit_handlers import ObjectList, extract_panel_definitions_from_model_class @@ -123,11 +124,14 @@ def create(request, content_type_app_name, content_type_model_name): messages.success( request, - "%s '%s' created." % (capfirst(get_snippet_type_name(content_type)[0]), instance) + _("{snippet_type} '{instance}' created.").format( + snippet_type=capfirst(get_snippet_type_name(content_type)[0]), + instance=instance + ) ) return redirect('wagtailsnippets_list', content_type.app_label, content_type.model) else: - messages.error(request, "The snippet could not be created due to errors.") + messages.error(request, _("The snippet could not be created due to errors.")) edit_handler = edit_handler_class(instance=instance, form=form) else: form = form_class(instance=instance) @@ -161,11 +165,14 @@ def edit(request, content_type_app_name, content_type_model_name, id): messages.success( request, - "%s '%s' updated." % (capfirst(snippet_type_name), instance) + _("{snippet_type} '{instance}' updated.").format( + snippet_type=capfirst(snippet_type_name), + instance=instance + ) ) return redirect('wagtailsnippets_list', content_type.app_label, content_type.model) else: - messages.error(request, "The snippet could not be saved due to errors.") + messages.error(request, _("The snippet could not be saved due to errors.")) edit_handler = edit_handler_class(instance=instance, form=form) else: form = form_class(instance=instance) @@ -194,7 +201,10 @@ def delete(request, content_type_app_name, content_type_model_name, id): instance.delete() messages.success( request, - "%s '%s' deleted." % (capfirst(snippet_type_name), instance) + _("{snippet_type} '{instance}' deleted.").format( + snippet_type=capfirst(snippet_type_name), + instance=instance + ) ) return redirect('wagtailsnippets_list', content_type.app_label, content_type.model) diff --git a/wagtail/wagtailusers/locale/en/LC_MESSAGES/django.po b/wagtail/wagtailusers/locale/en/LC_MESSAGES/django.po index 20cae26cfd..b7b3438cfb 100644 --- a/wagtail/wagtailusers/locale/en/LC_MESSAGES/django.po +++ b/wagtail/wagtailusers/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-19 14:35+0200\n" +"POT-Creation-Date: 2014-02-19 20:59+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -44,7 +44,7 @@ msgstr "" msgid "The two password fields didn't match." msgstr "" -#: .\forms.py:50 .\templates\wagtailusers\list.html.py:15 +#: .\forms.py:50 .\templates\wagtailusers\list.html:15 msgid "Username" msgstr "" @@ -76,70 +76,70 @@ msgstr "" msgid "Administrators have the ability to manage user accounts." msgstr "" -#: .\templates\wagtailusers\create.html.py:8 -#: .\templates\wagtailusers\create.html.py:35 +#: .\templates\wagtailusers\create.html:4 +#: .\templates\wagtailusers\create.html:8 +#: .\templates\wagtailusers\create.html:35 msgid "Add user" msgstr "" -#: .\templates\wagtailusers\create.html.py:12 -#: .\templates\wagtailusers\edit.html.py:12 +#: .\templates\wagtailusers\create.html:12 +#: .\templates\wagtailusers\edit.html:12 msgid "Account" msgstr "" -#: .\templates\wagtailusers\create.html.py:13 -#: .\templates\wagtailusers\create.html.py:28 -#: .\templates\wagtailusers\edit.html.py:13 +#: .\templates\wagtailusers\create.html:13 +#: .\templates\wagtailusers\create.html:28 +#: .\templates\wagtailusers\edit.html:13 msgid "Roles" msgstr "" -#: .\templates\wagtailusers\edit.html.py:4 -#: .\templates\wagtailusers\edit.html.py:8 +#: .\templates\wagtailusers\edit.html:4 .\templates\wagtailusers\edit.html:8 msgid "Editing" msgstr "" -#: .\templates\wagtailusers\edit.html.py:37 +#: .\templates\wagtailusers\edit.html:30 .\templates\wagtailusers\edit.html:37 msgid "Save" msgstr "" -#: .\templates\wagtailusers\index.html.py:4 -#: .\templates\wagtailusers\index.html.py:17 +#: .\templates\wagtailusers\index.html:4 +#: .\templates\wagtailusers\index.html:17 msgid "Users" msgstr "" -#: .\templates\wagtailusers\index.html.py:18 +#: .\templates\wagtailusers\index.html:18 msgid "Add a user" msgstr "" -#: .\templates\wagtailusers\list.html.py:7 +#: .\templates\wagtailusers\list.html:7 msgid "Name" msgstr "" -#: .\templates\wagtailusers\list.html.py:22 +#: .\templates\wagtailusers\list.html:22 msgid "Level" msgstr "" -#: .\templates\wagtailusers\list.html.py:23 +#: .\templates\wagtailusers\list.html:23 msgid "Status" msgstr "" -#: .\templates\wagtailusers\list.html.py:36 +#: .\templates\wagtailusers\list.html:36 msgid "Admin" msgstr "" -#: .\templates\wagtailusers\list.html.py:37 +#: .\templates\wagtailusers\list.html:37 msgid "Active" msgstr "" -#: .\templates\wagtailusers\list.html.py:37 +#: .\templates\wagtailusers\list.html:37 msgid "Inactive" msgstr "" -#: .\templates\wagtailusers\results.html.py:12 +#: .\templates\wagtailusers\results.html:12 #, python-format msgid "Sorry, no users match \"%(search_query)s\"" msgstr "" -#: .\templates\wagtailusers\results.html.py:15 +#: .\templates\wagtailusers\results.html:15 #, python-format msgid "" "There are no users configured. Why not
    Title{% trans "Title" %}