Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/unreal4u/detecting-locale-blog

This is a small example file for an entry in my blog
https://github.com/unreal4u/detecting-locale-blog

Last synced: about 2 months ago
JSON representation

This is a small example file for an entry in my blog

Awesome Lists containing this project

README

        

localeDetection
======

This is an example class for a [blog post available here](http://blog.unreal4u.com/).

Disclaimer
--------

This is not an official class or something that you can put right on a
production system! This is intended to be an example class for a blog post only!

The blog post is available at my blog and is in spanish. You should read that
blog post first prior to using this code!

Disclaimer
--------

Esto no es una class oficial o algo que puedas poner en tu sistema de
producción! Sólo es un ejemplo de una class que fue escrita rápidamente para un
post en mi blog!

El post del blog está disponible en mi blog y está en español. Deberías leer eso
antes de ocupar este código!

Installation
--------

* Execute composer with composer.phar install or composer.phar update
* This should install all dependencies
* If you don't know how to use composer or what it is, visit their [official homepage](http://getcomposer.org/).
* Download Maxmind's GeoLite2 Country database from [their website](http://dev.maxmind.com/geoip/geoip2/geolite2/).
* Use the code:

include('src/unreal4u/localeDetection.php');

$localeDetection = new unreal4u\localeDetection();
$localeDetection->geoliteCountryDBLocation = '../db/GeoLite2-Country.mmdb';
var_dump($localeDetection->getLocaleFromClient());

Instalación
--------

* Ejecuta composer con composer.phar install or composer.phar update
* Esto debería instalar todas las dependencias.
* Si no sabes cómo usar composer o qué es, visita su [página oficial](http://getcomposer.org/).
* Baja la base de datos "GeoLite2 Country" desde la [página de Maxmind](http://dev.maxmind.com/geoip/geoip2/geolite2/).
* Usa el código:

include('src/unreal4u/localeDetection.php');

$localeDetection = new unreal4u\localeDetection();
$localeDetection->geoliteCountryDBLocation = '../db/GeoLite2-Country.mmdb';
var_dump($localeDetection->getLocaleFromClient());