Skip to content

Commit

Permalink
Added default transloation domains to template files and removed para…
Browse files Browse the repository at this point in the history
…meters to trans function
  • Loading branch information
ddebree committed Mar 26, 2013
1 parent ec05bec commit b80d022
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% trans_default_domain 'FOSUserBundle' %}

<form action="{{ path('fos_user_change_password') }}" {{ form_enctype(form) }} method="POST" class="fos_user_change_password">
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'change_password.submit'|trans({}, 'FOSUserBundle') }}" />
<input type="submit" value="{{ 'change_password.submit'|trans }}" />
</div>
</form>
4 changes: 3 additions & 1 deletion Resources/views/Group/edit_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% trans_default_domain 'FOSUserBundle' %}

<form action="{{ path('fos_user_group_edit', {'groupName': group_name} ) }}" {{ form_enctype(form) }} method="POST" class="fos_user_group_edit">
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'group.edit.submit'|trans([], 'FOSUserBundle') }}" />
<input type="submit" value="{{ 'group.edit.submit'|trans }}" />
</div>
</form>
4 changes: 3 additions & 1 deletion Resources/views/Group/new_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% trans_default_domain 'FOSUserBundle' %}

<form action="{{ path('fos_user_group_new') }}" {{ form_enctype(form) }} method="POST" class="fos_user_group_new">
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'group.new.submit'|trans([], 'FOSUserBundle') }}" />
<input type="submit" value="{{ 'group.new.submit'|trans }}" />
</div>
</form>
4 changes: 3 additions & 1 deletion Resources/views/Group/show_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% trans_default_domain 'FOSUserBundle' %}

<div class="fos_user_group_show">
<p>{{ 'group.show.name'|trans([], 'FOSUserBundle') }}: {{ group.getName() }}</p>
<p>{{ 'group.show.name'|trans }}: {{ group.getName() }}</p>
</div>
4 changes: 3 additions & 1 deletion Resources/views/Profile/edit_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% trans_default_domain 'FOSUserBundle' %}

<form action="{{ path('fos_user_profile_edit') }}" {{ form_enctype(form) }} method="POST" class="fos_user_profile_edit">
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'profile.edit.submit'|trans({}, 'FOSUserBundle') }}" />
<input type="submit" value="{{ 'profile.edit.submit'|trans }}" />
</div>
</form>
6 changes: 4 additions & 2 deletions Resources/views/Profile/show_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% trans_default_domain 'FOSUserBundle' %}

<div class="fos_user_user_show">
<p>{{ 'profile.show.username'|trans({}, 'FOSUserBundle') }}: {{ user.username }}</p>
<p>{{ 'profile.show.email'|trans({}, 'FOSUserBundle') }}: {{ user.email }}</p>
<p>{{ 'profile.show.username'|trans }}: {{ user.username }}</p>
<p>{{ 'profile.show.email'|trans }}: {{ user.email }}</p>
</div>
4 changes: 3 additions & 1 deletion Resources/views/Registration/checkEmail.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "FOSUserBundle::layout.html.twig" %}

{% trans_default_domain 'FOSUserBundle' %}

{% block fos_user_content %}
<p>{{ 'registration.check_email'|trans({'%email%': user.email}, 'FOSUserBundle') }}</p>
<p>{{ 'registration.check_email'|trans({'%email%': user.email}) }}</p>
{% endblock fos_user_content %}
6 changes: 4 additions & 2 deletions Resources/views/Registration/confirmed.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{% extends "FOSUserBundle::layout.html.twig" %}

{% trans_default_domain 'FOSUserBundle' %}

{% block fos_user_content %}
<p>{{ 'registration.confirmed'|trans({'%username%': user.username}, 'FOSUserBundle') }}</p>
<p>{{ 'registration.confirmed'|trans({'%username%': user.username}) }}</p>
{% if app.session is not empty %}
{% set targetUrl = app.session.get('_security.' ~ app.security.token.providerKey ~ '.target_path') %}
{% if targetUrl is not empty %}<p><a href="{{ targetUrl }}">{{ 'registration.back'|trans({}, 'FOSUserBundle') }}</a></p>{% endif %}
{% if targetUrl is not empty %}<p><a href="{{ targetUrl }}">{{ 'registration.back'|trans }}</a></p>{% endif %}
{% endif %}
{% endblock fos_user_content %}
5 changes: 3 additions & 2 deletions Resources/views/Registration/email.txt.twig
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{% trans_default_domain 'FOSUserBundle' %}
{% block subject %}
{% autoescape false %}
{{ 'registration.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }}
{{ 'registration.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{% endautoescape %}
{% endblock %}
{% block body_text %}
{% autoescape false %}
{{ 'registration.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }}
{{ 'registration.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{% endautoescape %}
{% endblock %}
{% block body_html %}{% endblock %}
4 changes: 3 additions & 1 deletion Resources/views/Registration/register_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% trans_default_domain 'FOSUserBundle' %}

<form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" class="fos_user_registration_register">
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'registration.submit'|trans({}, 'FOSUserBundle') }}" />
<input type="submit" value="{{ 'registration.submit'|trans }}" />
</div>
</form>
4 changes: 3 additions & 1 deletion Resources/views/Resetting/checkEmail.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% extends "FOSUserBundle::layout.html.twig" %}

{% trans_default_domain 'FOSUserBundle' %}

{% block fos_user_content %}
<p>
{{ 'resetting.check_email'|trans({'%email%': email}, 'FOSUserBundle') }}
{{ 'resetting.check_email'|trans({'%email%': email}) }}
</p>
{% endblock %}
5 changes: 3 additions & 2 deletions Resources/views/Resetting/email.txt.twig
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{% trans_default_domain 'FOSUserBundle' %}
{% block subject %}
{% autoescape false %}
{{ 'resetting.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }}
{{ 'resetting.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{% endautoescape %}
{% endblock %}
{% block body_text %}
{% autoescape false %}
{{ 'resetting.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }}
{{ 'resetting.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{% endautoescape %}
{% endblock %}
{% block body_html %}{% endblock %}
4 changes: 3 additions & 1 deletion Resources/views/Resetting/passwordAlreadyRequested.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "FOSUserBundle::layout.html.twig" %}

{% trans_default_domain 'FOSUserBundle' %}

{% block fos_user_content %}
<p>{{ 'resetting.password_already_requested'|trans({}, 'FOSUserBundle') }}</p>
<p>{{ 'resetting.password_already_requested'|trans }}</p>
{% endblock fos_user_content %}
8 changes: 5 additions & 3 deletions Resources/views/Resetting/request_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{% trans_default_domain 'FOSUserBundle' %}

<form action="{{ path('fos_user_resetting_send_email') }}" method="POST" class="fos_user_resetting_request">
<div>
{% if invalid_username is defined %}
<p>{{ 'resetting.request.invalid_username'|trans({'%username%': invalid_username}, 'FOSUserBundle') }}</p>
<p>{{ 'resetting.request.invalid_username'|trans({'%username%': invalid_username}) }}</p>
{% endif %}
<label for="username">{{ 'resetting.request.username'|trans({}, 'FOSUserBundle') }}</label>
<label for="username">{{ 'resetting.request.username'|trans }}</label>
<input type="text" id="username" name="username" required="required" />
</div>
<div>
<input type="submit" value="{{ 'resetting.request.submit'|trans({}, 'FOSUserBundle') }}" />
<input type="submit" value="{{ 'resetting.request.submit'|trans }}" />
</div>
</form>
4 changes: 3 additions & 1 deletion Resources/views/Resetting/reset_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% trans_default_domain 'FOSUserBundle' %}

<form action="{{ path('fos_user_resetting_reset', {'token': token}) }}" {{ form_enctype(form) }} method="POST" class="fos_user_resetting_reset">
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'resetting.reset.submit'|trans({}, 'FOSUserBundle') }}" />
<input type="submit" value="{{ 'resetting.reset.submit'|trans }}" />
</div>
</form>
12 changes: 7 additions & 5 deletions Resources/views/Security/login.html.twig
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
{% extends "FOSUserBundle::layout.html.twig" %}

{% trans_default_domain 'FOSUserBundle' %}

{% block fos_user_content %}
{% if error %}
<div>{{ error|trans({}, 'FOSUserBundle') }}</div>
<div>{{ error|trans }}</div>
{% endif %}

<form action="{{ path("fos_user_security_check") }}" method="post">
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />

<label for="username">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
<label for="username">{{ 'security.login.username'|trans }}</label>
<input type="text" id="username" name="_username" value="{{ last_username }}" required="required" />

<label for="password">{{ 'security.login.password'|trans({}, 'FOSUserBundle') }}</label>
<label for="password">{{ 'security.login.password'|trans }}</label>
<input type="password" id="password" name="_password" required="required" />

<input type="checkbox" id="remember_me" name="_remember_me" value="on" />
<label for="remember_me">{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}</label>
<label for="remember_me">{{ 'security.login.remember_me'|trans }}</label>

<input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}" />
<input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans }}" />
</form>
{% endblock fos_user_content %}

0 comments on commit b80d022

Please sign in to comment.