PHPackages                             anezi/locale-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. anezi/locale-extension

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

anezi/locale-extension
======================

Locale Extensions for Twig

1.2.1(5y ago)4338MITPHPPHP &gt;=7.1CI failing

Since Mar 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/anezi/locale-extension)[ Packagist](https://packagist.org/packages/anezi/locale-extension)[ RSS](/packages/anezi-locale-extension/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

Locale Extensions for Twig
--------------------------

[](#locale-extensions-for-twig)

### Installation

[](#installation)

The extension is installable via composer:

`composer require anezi/locale-extension`

### Symfony service

[](#symfony-service)

```
services:
    anezi_twig.locale_extension:
        class: Anezi\Locale\Twig\Extension\LocaleExtension
        public:    false
        arguments: ["%managed_locales%"]
        tags:
            - { name: twig.extension }
```

### Functions

[](#functions)

#### Get locales

[](#get-locales)

`{% for locale in locales() %}{{ locale }} - {% endfor %}`

shows:

**ar - en - fr -**

### Filters

[](#filters)

#### Get country name

[](#get-country-name)

`{{ "be"|country_name }}`

shows:

**Belgium**

#### Get locale name

[](#get-locale-name)

`{{ "fr_BE"|locale_name }}`

shows:

**French (Belgium)**

#### Get locale name in that locale

[](#get-locale-name-in-that-locale)

`{{ "fr_BE"|origin_locale_name }}`

shows:

**français (Belgique)**

#### Get locale short name

[](#get-locale-short-name)

`{{ "fr_BE"|locale_short_name }}`

shows:

**fr**

#### Get html direction

[](#get-html-direction)

`{{ "ar"|html_dir }}`

shows:

**rtl**

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~247 days

Total

5

Last Release

1973d ago

PHP version history (3 changes)v1.0.0PHP ~7.1

1.0.1PHP ^7.1

1.2.1PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/8da2a4376a9b330628e63e6d5b11ab407c17549b955b65adc19ca49b914e5fae?d=identicon)[amouhzi](/maintainers/amouhzi)

---

Top Contributors

[![amouhzi](https://avatars.githubusercontent.com/u/4458806?v=4)](https://github.com/amouhzi "amouhzi (59 commits)")

---

Tags

phpphp-libraryphp7twig-extensiontwigextensionlocaletwig-extension

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/anezi-locale-extension/health.svg)

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

###  Alternatives

[twig/intl-extra

A Twig extension for Intl

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

Define reusable components in Twig.

3819.8k1](/packages/redant-twig-components)[bluetel-solutions/twig-truncate-extension

Twig Extension to truncate nested HTML, safely!

11100.0k](/packages/bluetel-solutions-twig-truncate-extension)

PHPackages © 2026

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