<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.*</td>
</tr>
</tbody>
</table>
<p dir="auto">i think the functions from Intl/ResourceBundle should be awailable as twig functions or filter.<br>
like doing "<code class="notranslate"> val | language_name</code>" should do "<code class="notranslate">Intl::getLanguageBundle()-&gt;getLanguageName(val)</code>"<br>
I Think Filter is better than Function?</p>
<p dir="auto">but i don't know if they should be added to Symfony/Bridge/Twig, or be an extra bundle.</p>
<p dir="auto">what should it be use for?<br>
like when creating an view of a Model or Entity and you get "de" as value it should be turn it into "German".</p>
<p dir="auto">Tell me if it would be a good idea to add a extension/twig folder, containing a IcuExtension.php with those functions :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public function getFunctions()
{
    return array(
        new \Twig_SimpleFunction('languageName', array($this, 'getLanguageName')),
        new \Twig_SimpleFunction('scriptName', array($this, 'getScriptName')),
        new \Twig_SimpleFunction('countryName', array($this, 'getCountryName')),
    );
}

public function getLanguageName($language, $region = null, $displayLocale = null)
{
    return Intl::getLanguageBundle()-&gt;getLanguageName($language, $region, $displayLocale);
}

public function getScriptName($script, $language = null, $displayLocale = null)
{
    return Intl::getLanguageBundle()-&gt;getScriptName($script, $language = null, $displayLocale = null);
}

public function getCountryName($country, $displayLocale = null)
{
    return Intl::getRegionBundle()-&gt;getCountryName($country, $displayLocale = null);
}"><pre class="notranslate"><code class="notranslate">public function getFunctions()
{
    return array(
        new \Twig_SimpleFunction('languageName', array($this, 'getLanguageName')),
        new \Twig_SimpleFunction('scriptName', array($this, 'getScriptName')),
        new \Twig_SimpleFunction('countryName', array($this, 'getCountryName')),
    );
}

public function getLanguageName($language, $region = null, $displayLocale = null)
{
    return Intl::getLanguageBundle()-&gt;getLanguageName($language, $region, $displayLocale);
}

public function getScriptName($script, $language = null, $displayLocale = null)
{
    return Intl::getLanguageBundle()-&gt;getScriptName($script, $language = null, $displayLocale = null);
}

public function getCountryName($country, $displayLocale = null)
{
    return Intl::getRegionBundle()-&gt;getCountryName($country, $displayLocale = null);
}
</code></pre></div>
<p dir="auto">So we can use them in twig like that for ex</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{{ languageName('en') }}
{{ languageName('en', null, 'de') }}"><pre class="notranslate"><code class="notranslate">{{ languageName('en') }}
{{ languageName('en', null, 'de') }}
</code></pre></div>
<p dir="auto">If it's a good idea, I'll make a PR.</p>
<p dir="auto">K.</p>