PHPackages                             kumulo/locale-bundle - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. kumulo/locale-bundle

Active[Localization &amp; i18n](/categories/localization)

kumulo/locale-bundle
====================

00PHP

Pushed 5y ago1 watchersCompare

[ Source](https://github.com/kumulo/locale-bundle)[ Packagist](https://packagist.org/packages/kumulo/locale-bundle)[ RSS](/packages/kumulo-locale-bundle/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersionsUsed By (0)

Locale Bundle
=============

[](#locale-bundle)

Install
-------

[](#install)

```
composer install kumulo/locale-bundle
```

Configuration
-------------

[](#configuration)

Set the default locale :

```
# config/packages/locale_bundle.yaml
locale_bundle:
  default_locale: en
```

Link it the Symfony default locale to the bundle :

```
# config/packages/locale_bundle.yaml
locale_bundle:
  default_locale: '%kernel.default_locale%'
```

Manage the list of available locales :

```
# config/packages/locale_bundle.yaml
locale_bundle:
  available_locales: ['en', 'fr']
```

Locale Helpers :
----------------

[](#locale-helpers-)

Locale helpers will automatically set the locale. There is 1 (to upgrade) kind of manager :

**Header Manager**

This manager will set the locale with `Accept-Language` headers. It's quite useful when you want to make a translation for an API.

**To come**

- `UserLocaleHelper` to set locale with user preferences
- `RouteLocaleHelper` to set locale with route `_locale` parameter

Add a new locale helper
-----------------------

[](#add-a-new-locale-helper)

If you want to create your own locale helper, just create a new class and extend the `AbstractLocaleHelper`.

```
