PHPackages                             frenzy/stack-localize - 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. frenzy/stack-localize

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

frenzy/stack-localize
=====================

A stack middleware for detecting URI locales.

3438PHP

Since May 17Pushed 12y ago2 watchersCompare

[ Source](https://github.com/frenzyapp/stack-localize)[ Packagist](https://packagist.org/packages/frenzy/stack-localize)[ RSS](/packages/frenzy-stack-localize/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Frenzy/Localize
===============

[](#frenzylocalize)

This [stack middleware](http://stackphp.com) gives localization features to your application. It will start looking for the locale in the URL. If none is present, it will default to the one you provide.

No default will result in getting the HTTP\_ACCEPT\_LANGUAGE from the user and try to match it to an available locale.

This middleware can detect language specified on a URI prefix. ex.:

```
http://mydomain.com/en
http://mydomain.com/fr

```

The locale will be accessible on the Request getLocale() method and be removed from the request pathinfo for easier routing.

#### Example with Silex

[](#example-with-silex)

```
