Skip to content

Commit

Permalink
Merge pull request #313 from alpixel/master
Browse files Browse the repository at this point in the history
don't depend on twig text extension
  • Loading branch information
gnat42 committed Mar 23, 2016
2 parents 12cb7e8 + be7d7c4 commit ec00a03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
16 changes: 1 addition & 15 deletions Resources/doc/webinterface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,13 @@ the routes by adding the following to ``app/config/routing_dev.yml`` (note
that you need to have the SensioFrameworkExtraBundle_ installed)::

JMSTranslationBundle_ui:
resource: @JMSTranslationBundle/Controller/
resource: "@JMSTranslationBundle/Controller/"
type: annotation
prefix: /_trans

This bundle also requires the JMSDiExtraBundle_ for annotation-based
dependency injection for controllers.

This bundle also makes use of the Twig ``truncate`` filter which you find
in the `Twig extensions`_ repository. You can install it, by adding the
following to your ``app/config/config.yml``::

services:
twig.text_extension:
class: Twig_Extensions_Extension_Text
tags:
- name: twig.extension

.. _SensioFrameworkExtraBundle: https://github.com/sensio/SensioFrameworkExtraBundle
.. _JMSDiExtraBundle: https://github.com/schmittjoh/JMSDiExtraBundle
.. _Twig extensions: http://github.com/fabpot/Twig-extensions

Usage
-----
If you have followed the instructions above, you can now access the interface
Expand Down
8 changes: 4 additions & 4 deletions Resources/views/Translate/messages.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<tr>
<td>
<a class="jms-translation-anchor" id="{{ id }}" />
<p><abbr title="{{ id }}">{{ id|truncate(20) }}</abbr></p>
<p><abbr title="{{ id }}">{{ id|slice(0, 25) }}{% if id|length > 25 %}...{% endif %}</abbr></p>
</td>
<td>
<textarea data-id="{{ id }}" class="span6"{% if isWriteable is same as(false) %} readonly="readonly"{% endif %}>{{ message.localeString }}</textarea></td>
Expand All @@ -20,7 +20,7 @@
<h6>Meaning</h6>
<p>{{ message.meaning }}</p>
{% endif %}

{% if alternativeMessages[id] is defined %}
<h6>Alternative Translations</h6>
{% for locale, altMessage in alternativeMessages[id] %}
Expand All @@ -29,7 +29,7 @@
</p>
{% endfor %}
{% endif %}

{% if message.sources|length > 0 %}
<h6>Sources</h6>
<ul>
Expand All @@ -39,7 +39,7 @@
</ul>
{% endif %}

{% if message.desc is not empty
{% if message.desc is not empty
and message.localeString != message.desc
and id != message.desc
and (alternativeMessages[id][sourceLanguage] is not defined
Expand Down

0 comments on commit ec00a03

Please sign in to comment.