2017 © Pedro Peláez
 

project php-language-detection

Detects the preferred language from the browser and compares this with the available languages/locales to return the best language/locale to redirect.

image

koenster/php-language-detection

Detects the preferred language from the browser and compares this with the available languages/locales to return the best language/locale to redirect.

  • Tuesday, November 8, 2016
  • by Koenster
  • Repository
  • 2 Watchers
  • 2 Stars
  • 1,490 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 18 % Grown

The README.md

PHP localization / language detection script

Detects the preferred language from the browser and compares this with the available languages/locales to return the best language/locale to redirect., (*1)

How to install

composer require koenster/php-language-detection

How to use


use koenster\PHPLanguageDetection\BrowserLocalization; $browser = $_SERVER['HTTP_ACCEPT_LANGUAGE']; $default = 'nl-NL'; $available = ['nl-NL', 'nl-BE', 'en-GB', 'fr-FR']; $browser = new BrowserLocalization(); $browser->setAvailable($available) ->setDefault($default) ->setPreferences($browser); // Will return or a default or when available, the available locale. echo $browser->detect();

License

This Language Detection script is open-sourced software licensed under the MIT license., (*2)

The Versions

08/11 2016

dev-master

9999999-dev

Detects the preferred language from the browser and compares this with the available languages/locales to return the best language/locale to redirect.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

php language detection browser localization detection browser localisation

08/11 2016

v1.0.4

1.0.4.0

Detects the preferred language from the browser and compares this with the available languages/locales to return the best language/locale to redirect.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

php language detection browser localization detection browser localisation

08/11 2016

v1.0.3

1.0.3.0

Detects the preferred language from the browser and compares this with the available languages/locales to return the best language/locale to redirect.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

php language detection browser localization detection browser localisation

25/04 2016

v1.0.2

1.0.2.0

Detects the preferred language from the browser and compares this with the available languages/locales to return the best language/locale to redirect.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

php language detection browser localization detection browser localisation

25/04 2016

v1.0.1

1.0.1.0

Detects the preferred language from the browser and compares this with the available languages/locales to return the best language/locale to redirect.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

php language detection browser localization detection browser localisation

25/04 2016

v1.0.0

1.0.0.0

Detects the preferred language from the browser and compares this with the available languages/locales to return the best language/locale to redirect.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

php language detection browser localization detection browser localisation