|Last Updated||Ratings||Unique User Downloads||Download Rankings|
|2014-11-25 (8 months ago)||Not yet rated by the users||Total: 387||All time: 6,139 This week: 1,182|
|language-detector 2.1.0||Free To Use But R...||5.0||Localization, HTTP, PHP 5|
This class can detect the preferred language of the user accessing the site.
|Details provided by the author|
About ===== This PHP class chooses language based on clues provided in HTTP headers, geolocation and/or a cookie value from an ealier visit. It parses the HTTP Accept Language header and determines the most suitable language according to a list of available languages. When Accept Language header is not sent while visitor's country (code) is known, a list of possible locale codes will be produced; these will be compared to the list of available languages and most suitable language will be chosen. When Accept Language header is not sent and the user is behind anonymous proxy, the fallback will be the default language. The detected language can be stored in a cookie to avoid the need for language detection in subsequent page requests and subsequent site visits. License ======= Copyright 2012-2014 Peter Kahl (www.colossalmind.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Change Log ========== 2.0.1 ..... 2014-11-20 Cleaned up. 2.0.0 ..... 2014-11-18 Completely rewrote, improved the class. Accept Language parser now preserves the order of language code preference (q) as per RFC 2616. Changed license to Apache License, Version 2.0. 1.4.5 ..... 2014-11-14 The default language is best to be placed last in the LANG_MAP array. 1.4.4 ..... 2014-11-08 Fixed bug to properly enable/disable cookie reading/writing. 1.4.3 ..... 2014-11-02 Fixed missing host in setcookie(). Added makecookie() method. 1.4.2 ..... 2014-02-06 Clean up for strict PHP standards. 1.4.1 ..... 2013-10-08 Improved Accept Language parser. 1.4.0 ..... 2013-10-07 Eliminated the requirement that user defines GEO_LANG_MAP (by adding method to detect locale from visitor's country code). 1.3.0 ..... 2013-09-30 Added the ability to parse language codes such as 'zh-Hant-TW'. Added further options for cookie. 1.2.0 ..... 2012-11-05 Converted to PHP5. 1.1.1 ..... 2012-11-02 Added link to repo on GitHub. 1.1.0 ..... 2012-05-27 Added parameter for anonymous proxy. Improved method country_to_language(). 1.0.0 ..... 2012-02-21 Initial release
|Version Control||Unique User Downloads||Download Rankings|
|This week:||0||This week:||1,182|