2017 © Pedro Peláez
 

library language-selector

image

jones/language-selector

  • Tuesday, May 27, 2014
  • by Jones
  • Repository
  • 1 Watchers
  • 1 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel 4 LanguageSelector

A package for Laravel 4 which sets dynamic the Language for the user, (*1)

Latest Stable Version Total Downloads, (*2)

Contributing

If you have any suggestions or improvements feel free to create an issue or create a Pull Request., (*3)

Installation

Add jones/language-selector as a requirement to composer.json:, (*4)

{
    ...
    "require": {
        ...
        "jones/language-selector": "dev-master"
        ...
    },
}

Update composer:, (*5)

$ php composer.phar update

Add the provider to your app/config/app.php:, (*6)

'providers' => array(

    ...
    'Jones\LanguageSelector\LanguageSelectorServiceProvider',

),

(Optional) Publish package config:, (*7)

$ php artisan config:publish jones/language-selector

Configuration

  • lang_key: The key where the language of the user is set

How is checked which language is used?

First it is checked whether you entered a language key and if so we try to get the language from the user (You need to use Laravel's Auth class or Sentry and the language have to be the short key, eg 'en'). If we found a valid language we use this. Second we check the "Accept-Language" Header and try to set the language with it. If both failed we use the locale set in the config., (*8)

The Versions

27/05 2014

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Avatar Jones

15/07 2013

v1.0.0

1.0.0.0

  Sources   Download

The Requires

 

by Avatar Jones