Download the PHP package raindrop/locale-bundle without Composer

On this page you can find all versions of the php package raindrop/locale-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package locale-bundle

Raindrop Locale Bundle

Build Status

This bundle is a fork of LuneticsLocaleBundle which allows you to guess the Locale from different parameters in your Symfony2 applications.

Installation

Add the package to your dependencies

Register the bundle in your kernel

Update your packages

Configuration

Allowed locales for your application

You need to define at least one valid locale that is valid for your application

Strict Mode

You can enable strict_mode, where only the exact allowed locales will be matched. For example:

We encourage you to use the non-strict mode, that'll also choose the best region locale for your user.

Guessers

You need to activate and define the order of the locale guessers. This is done in one step in the configuration :

With the example above, the guessers will be called in the order you defined as 1. session 2. cookie 2. router 3. browser.

Note that the session and cookie guessers only retrieve previously identified and saved locales by the router or browser guesser.

If you use the _locale parameter as attribute/parameter in your routes, you should use the query and router guesser first.

Locale Cookies / Session

The session and cookie guesser is usually used when you do not use locales in the uri's and you guess it from the user browser preferences. When doing this,

it is good to set session and/or cookie as the first guesser to not try to detect the locale at each request.

Cookie

If you use the cookie guesser, it will be automatically read from the cookie and write changes into the cookie anytime the locale has changed (Even from another guesser)

This is most useful for unregistered and returning visitors.

Session

The session guesser will automatically save a previously identified locale into the session and retrieve it from the session. This guesser should always be first in your guessing_order configuration if you don't use the router guesser.

FilterLocaleSwitchEvent / LocaleUpdateListener

The LocaleGuesserManager dispatches a LocaleBundleEvents::onLocalChange if you use either the 'session' or cookie guesser. The LocaleUpdateListeners checks if the locale has changed and updates the session or cookie.

For example, if you don't use route / query parameters for locales, you could build an own listener for your user login, which dispatches a LocaleBundleEvents::onLocalChange event to set the locale for your user. You just have to use the FilterLocaleSwitchEvent and set the locale.

Custom Guessers

Read more about creating your own guesser here:

Read the full documentation for creating a custom Locale Guesser

Switch to another locale

You can render a default locale switcher, simply by calling the twig function in your template :

Read the full documentation for the switcher


All versions of locale-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
symfony/framework-bundle Version >=2.1,<2.3-dev
symfony/yaml Version >=2.1,<2.3-dev
symfony/locale Version >=2.1,<2.3-dev
symfony/validator Version >=2.1,<2.3-dev
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package raindrop/locale-bundle contains the following files

Loading the files please wait ....