Skip to content

Commit

Permalink
Merge pull request FriendsOfSymfony#24 from helios-ag/master
Browse files Browse the repository at this point in the history
Translation behaviour
  • Loading branch information
ornicar committed Aug 26, 2011
2 parents e44ac07 + 710fafa commit 4a48a16
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 23 deletions.
21 changes: 21 additions & 0 deletions Resources/translations/OrnicarMessageBundle.en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
messenger: Messenger
inbox: Inbox
sent: Sent
send_new: Send a new message
search: Search
threads_found: %num% thread found with | %num% threads found with

message_info: By %sender%, on %date%
reply: Reply

subject: Subject
starter: Starter
startdate: StartDate
messages: Messages
last_message: Last message
actions: Actions
new: New
goto_last: Go to last message
on: On %date%
by: By %sender%
no_thread: There is no thread to show
21 changes: 21 additions & 0 deletions Resources/translations/OrnicarMessageBundle.ru.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
messenger: Мессенджер
inbox: Входящие
sent: Отправленные
send_new: Отправить новое сообщение
search: Поиск
threads_found: найдена %num% цепочка сообщений | найдено %num% цепочки сообщений | найдено %num% цепочек сообщений

message_info: От %sender%, %date%
reply: Ответить

subject: Тема
starter: Инициатор
startdate: Дата начала
messages: Сообщения
last_message: Последнее сообщение
actions: Действия
new: Новое
goto_last: К последнему сообщению
on: Дата %date%
by: От %sender%
no_thread: Нет сообщений для отображения
4 changes: 2 additions & 2 deletions Resources/views/Message/inbox.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

{% block content %}

<h2>Inbox</h2>
<h2>{% trans from 'OrnicarMessageBundle' %}inbox{% endtrans %}</h2>

<a href="{{ url('ornicar_message_thread_new' )}}">Send a new message</a>
<a href="{{ url('ornicar_message_thread_new' )}}">{% trans from 'OrnicarMessageBundle' %}send_new{% endtrans %}</a>

{% include 'OrnicarMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %}

Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Message/newThread.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block content %}

<h2>Send a new message</h2>
<h2>{% trans from 'OrnicarMessageBundle' %}send_new{% endtrans %}</h2>

<form action="{{ url('ornicar_message_thread_new') }}" method="post">
{{ form_widget(form) }}
Expand Down
6 changes: 4 additions & 2 deletions Resources/views/Message/search.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

{% block content %}

<h2>Search</h2>
<h2>{% trans from 'OrnicarMessageBundle' %}search{% endtrans %}</h2>

<p>{{ threads|length }} threads found with</p>
<p>{% transchoice threads|length with {'%num%': threads|length } from 'OrnicarMessageBundle' %}
threads_found
{% endtranschoice %}</p>

{% include 'OrnicarMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %}

Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Message/sent.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block content %}

<h2>Sent</h2>
<h2>{% trans from 'OrnicarMessageBundle' %}messenger{% endtrans %}</h2>

{% include 'OrnicarMessageBundle:Message:threads_list.html.twig' with {'threads': threads} %}

Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Message/thread.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% for message in thread.messages %}
<div class="messenger_thread_message">
<div class="messenger_thread_message_info">
By: {{ message.sender }}, on {{ message.createdAt|date }}
{% trans with {'%sender%': message.sender|e, '%date%': message.createdAt|date} from 'OrnicarMessageBundle' %}by{% endtrans %}
</div>

<div class="messenger_thread_message_body" id="message_{{ message.id }}">
Expand All @@ -16,7 +16,7 @@
</div>
{% endfor %}

<h3>Reply</h3>
<h3>{% trans from 'OrnicarMessageBundle' %}reply{% endtrans %}</h3>

<form action="{{ url('ornicar_message_thread_view', {'threadId': thread.id}) }}" method="post">
{{ form_widget(form) }}
Expand Down
22 changes: 11 additions & 11 deletions Resources/views/Message/threads_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<thead>
<tr>
<th>Subject</th>
<th>Starter</th>
<th>StartDate</th>
<th>Messages</th>
<th>Last message</th>
<th>Actions</th>
<th>{% trans from 'OrnicarMessageBundle' %}subject{% endtrans %}</th>
<th>{% trans from 'OrnicarMessageBundle' %}starter{% endtrans %}</th>
<th>{% trans from 'OrnicarMessageBundle' %}startdate{% endtrans %}</th>
<th>{% trans from 'OrnicarMessageBundle' %}messages{% endtrans %}</th>
<th>{% trans from 'OrnicarMessageBundle' %}last_message{% endtrans %}</th>
<th>{% trans from 'OrnicarMessageBundle' %}actions{% endtrans %}</th>
</tr>
</thead>

Expand All @@ -22,7 +22,7 @@
</a>

{% if not ornicar_message_is_read(thread) %}
(New)
({% trans from 'OrnicarMessageBundle' %}new{% endtrans %})
{% endif %}
</td>
<td>
Expand All @@ -36,12 +36,12 @@
</td>
<td>
{% if thread.lastMessage %}
<a href="{{ url('ornicar_message_thread_view', {'threadId': thread.id}) }}#message_{{ thread.lastMessage.id }}" title="Go to last message">
<a href="{{ url('ornicar_message_thread_view', {'threadId': thread.id}) }}#message_{{ thread.lastMessage.id }}" title="{% trans from 'OrnicarMessageBundle' %}goto_last{% endtrans %}">
</a>
On {{ thread.lastMessage.createdAt|date }}
{% trans with {'%date%': thread.lastMessage.createdAt|date} from 'OrnicarMessageBundle' %}on{% endtrans %}
<br />
By {{ thread.lastMessage.sender }}
{% trans with {'%sender%': thread.lastMessage.sender|e } from 'OrnicarMessageBundle' %}by{% endtrans %}
{% else %}
----
{% endif %}
Expand All @@ -56,7 +56,7 @@
{% else %}
<tr>
<td colspan="4">
There no thread to show.
{% trans from 'OrnicarMessageBundle' %}no_thread{% endtrans %}.
</td>
</tr>
{% endif %}
Expand Down
8 changes: 4 additions & 4 deletions Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={{ _charset }}" />
<title>Messenger</title>
<title>{% trans from 'OrnicarMessageBundle' %}messenger{% endtrans %}</title>
</head>

<body>

<h1>Messenger</h1>
<h1>{% trans from 'OrnicarMessageBundle' %}messenger{% endtrans %}</h1>

<ul>
<li><a href="{{ url('ornicar_message_inbox') }}">Inbox</a></li>
<li><a href="{{ url('ornicar_message_sent') }}">Sent</a></li>
<li><a href="{{ url('ornicar_message_inbox') }}">{% trans from 'OrnicarMessageBundle' %}inbox{% endtrans %}</a></li>
<li><a href="{{ url('ornicar_message_sent') }}">{% trans from 'OrnicarMessageBundle' %}sent{% endtrans %}</a></li>
</ul>

{% block content %}{% endblock %}
Expand Down

0 comments on commit 4a48a16

Please sign in to comment.