Renamed languages to locales in the code

This commit is contained in:
Gregory Oschwald
2013-10-17 12:58:21 -07:00
parent b8188bc558
commit 234dcaff7c
13 changed files with 46 additions and 39 deletions
+7 -7
View File
@@ -74,18 +74,18 @@ class City extends Country
/**
* @ignore
*/
public function __construct($raw, $languages)
public function __construct($raw, $locales)
{
parent::__construct($raw, $languages);
parent::__construct($raw, $locales);
$this->city = new \GeoIp2\Record\City($this->get('city'), $languages);
$this->city = new \GeoIp2\Record\City($this->get('city'), $locales);
$this->location = new \GeoIp2\Record\Location($this->get('location'));
$this->postal = new \GeoIp2\Record\Postal($this->get('postal'));
$this->createSubdivisions($raw, $languages);
$this->createSubdivisions($raw, $locales);
}
private function createSubdivisions($raw, $languages)
private function createSubdivisions($raw, $locales)
{
if (!isset($raw['subdivisions'])) {
return;
@@ -94,7 +94,7 @@ class City extends Country
foreach ($raw['subdivisions'] as $sub) {
array_push(
$this->subdivisions,
new \GeoIp2\Record\Subdivision($sub, $languages)
new \GeoIp2\Record\Subdivision($sub, $locales)
);
}
}
@@ -114,7 +114,7 @@ class City extends Country
private function mostSpecificSubdivision()
{
return empty($this->subdivisions)?
new \GeoIp2\Record\Subdivision(array(), $this->languages):
new \GeoIp2\Record\Subdivision(array(), $this->locales):
end($this->subdivisions);
}
}
+7 -7
View File
@@ -37,7 +37,7 @@ class Country
{
private $continent;
private $country;
private $languages;
private $locales;
private $maxmind;
private $registeredCountry;
private $representedCountry;
@@ -47,30 +47,30 @@ class Country
/**
* @ignore
*/
public function __construct($raw, $languages)
public function __construct($raw, $locales)
{
$this->raw = $raw;
$this->continent = new \GeoIp2\Record\Continent(
$this->get('continent'),
$languages
$locales
);
$this->country = new \GeoIp2\Record\Country(
$this->get('country'),
$languages
$locales
);
$this->maxmind = new \GeoIp2\Record\MaxMind($this->get('maxmind'));
$this->registeredCountry = new \GeoIp2\Record\Country(
$this->get('registered_country'),
$languages
$locales
);
$this->representedCountry = new \GeoIp2\Record\RepresentedCountry(
$this->get('represented_country'),
$languages
$locales
);
$this->traits = new \GeoIp2\Record\Traits($this->get('traits'));
$this->languages = $languages;
$this->locales = $locales;
}
/**