PHPackages                             alaczi/twig-locale-name-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. alaczi/twig-locale-name-extension

ActiveLibrary[Templating &amp; Views](/categories/templating)

alaczi/twig-locale-name-extension
=================================

Twig locale name filter extension for twig

v1.0.1(9y ago)14.0kMITPHPPHP &gt;=5.3.0

Since Feb 29Pushed 9y agoCompare

[ Source](https://github.com/alaczi/twig-locale-name-extension)[ Packagist](https://packagist.org/packages/alaczi/twig-locale-name-extension)[ Docs](http://github.com/alaczi/twig-locale-name-extension)[ RSS](/packages/alaczi-twig-locale-name-extension/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Usage
=====

[](#usage)

This twig extension is to write the human readable names of the 2 or 5 letter locale codes (eg: en or en\_GB)

Ideal to use with the language picker as you can pass the locale as second parameter to display the locale name on that language

Require as dependency
---------------------

[](#require-as-dependency)

```
    composer require alaczi/twig-locale-name-extension
```

Register the extension
----------------------

[](#register-the-extension)

### PHP

[](#php)

```
    $filter = new \alaczi\Twig\Extension\LocaleNameExtension();
    $twig = new Twig_Environment($loader);
    $twig->addFilter($filter);
```

### Symfony 2

[](#symfony-2)

```
services:
    alaczi.twig.country_extension:
        class: alaczi\Twig\Extension\LocaleNameExtension
        tags:
            - { name: twig.extension }
```

### Silex

[](#silex)

```
    $app['twig'] = $app->share($app->extend('twig', function ($twig, $app) {
        /** @var \Twig_Environment $twig */
        $twig->addExtension(new \alaczi\Twig\Extension\LocaleNameExtension())
        return $twig;
    }));
```

Usage in twig
-------------

[](#usage-in-twig)

Using the current locale:

```
    {{ locale|locale_name }}
```

Using an other locale (eg: for language pickers)

```
    {{ locale|locale_name(locale) }}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~142 days

Total

2

Last Release

3582d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4504069237c222674c79ae5be486f2fd7db465eaf7d8e3cf17fcdd7859758ae3?d=identicon)[alaczi](/maintainers/alaczi)

---

Top Contributors

[![alaczi](https://avatars.githubusercontent.com/u/3229101?v=4)](https://github.com/alaczi "alaczi (1 commits)")

---

Tags

symphonytwigtwig-extensiontwigfilterextensionlocale

### Embed Badge

![Health badge](/badges/alaczi-twig-locale-name-extension/health.svg)

```
[![Health](https://phpackages.com/badges/alaczi-twig-locale-name-extension/health.svg)](https://phpackages.com/packages/alaczi-twig-locale-name-extension)
```

###  Alternatives

[twig/intl-extra

A Twig extension for Intl

36663.2M221](/packages/twig-intl-extra)[redant/twig-components

Define reusable components in Twig.

3819.8k1](/packages/redant-twig-components)[gecko-packages/gecko-twig

Additional Twig filters and tests.

1113.0k](/packages/gecko-packages-gecko-twig)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
