Add back missing Twig filters
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3526959. -->
Reported by: [dieterholvoet](https://www.drupal.org/user/3567222)
Related to !10
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The current state of this module is a bit of a mess. In version 8.x-2.1 the twig/extra-bundle package was added as a replacement of the abandoned twig/extensions package, but it seems like no-one actually tested if that worked. Because it doesn't. It's a Symfony package that doesn't plug into Drupal by default. This makes the latest versions of this module practically useless, because it doesn't contain anymore Twig extensions.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Consider adding back Twig filters that were removed in the last versions and document everything in the project description to avoid confusion for users. Here's a start:</p>
<table>
<thead>
<tr>
<th>Extension name</th>
<th>Description</th>
<th>2.0</th>
<th>2.1</th>
</tr>
</thead>
<tbody>
<tr>
<td>shuffle</td>
<td>Shuffles an array.</td>
<td>✅<br></td>
<td>✅</td>
</tr>
<tr>
<td>time_diff</td>
<td>Converts dates to a time ago string like Facebook and Twitter has.</td>
<td>✅</td>
<td>✅</td>
</tr>
<tr>
<td>trans</td>
<td>Wrapper for the gettext() function.</td>
<td colspan="2">❌ Not added because it conflicts with core's trans tag.</td>
</tr>
<tr>
<td>localizeddate</td>
<td>Formats dates using \IntlDateFormatter.</td>
<td>✅</td>
<td>✅</td>
</tr>
<tr>
<td>localizednumber</td>
<td>Formats numbers using \IntlDateFormatter.</td>
<td>✅</td>
<td>✅</td>
</tr>
<tr>
<td>localizedcurrency</td>
<td>Formats currencies using \IntlDateFormatter.</td>
<td>✅</td>
<td>✅</td>
</tr>
<tr>
<td>truncate</td>
<td>Truncates text to a certain length, optionally preserving words.</td>
<td>✅</td>
<td>✅</td>
</tr>
<tr>
<td>wordwrap</td>
<td>Wraps a string into new lines when it reaches a specific length.</td>
<td>✅</td>
<td>✅</td>
</tr>
</tbody>
</table>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>Decide what extensions we want to bring back and bring them back.</p>
> Related issue: [Issue #3065137](https://www.drupal.org/node/3065137)
issue