@@ -28,19 +28,19 @@ class PlaceRecord(Record):
2828 """All records with :py:attr:`names` subclass :py:class:`PlaceRecord`"""
2929 __metaclass__ = ABCMeta
3030
31- def __init__ (self , languages = None , ** kwargs ):
32- if languages is None :
33- languages = ['en' ]
31+ def __init__ (self , locales = None , ** kwargs ):
32+ if locales is None :
33+ locales = ['en' ]
3434 if kwargs .get ('names' ) is None :
3535 kwargs ['names' ] = {}
36- object .__setattr__ (self , '_languages ' , languages )
36+ object .__setattr__ (self , '_locales ' , locales )
3737 super (PlaceRecord , self ).__init__ (** kwargs )
3838
3939 @property
4040 def name (self ):
4141 """Dict with locale codes as keys and localized name as value"""
4242 # pylint:disable=E1101
43- return next ((self .names .get (x ) for x in self ._languages if x in
43+ return next ((self .names .get (x ) for x in self ._locales if x in
4444 self .names ), None )
4545
4646
@@ -71,8 +71,8 @@ class City(PlaceRecord):
7171
7272 .. attribute:: name
7373
74- The name of the city based on the languages list
75- passed to the constructor. This attribute is returned by all end points.
74+ The name of the city based on the locales list passed to the
75+ constructor. This attribute is returned by all end points.
7676
7777 :type: unicode
7878
@@ -115,8 +115,8 @@ class Continent(PlaceRecord):
115115
116116 .. attribute:: name
117117
118- Returns the name of the continent based on the languages list
119- passed to the constructor. This attribute is returned by all end points.
118+ Returns the name of the continent based on the locales list passed to
119+ the constructor. This attribute is returned by all end points.
120120
121121 :type: unicode
122122
@@ -167,8 +167,8 @@ class Country(PlaceRecord):
167167
168168 .. attribute:: name
169169
170- The name of the country based on the languages list
171- passed to the constructor. This attribute is returned by all end points.
170+ The name of the country based on the locales list passed to the
171+ constructor. This attribute is returned by all end points.
172172
173173 :type: unicode
174174
@@ -221,8 +221,8 @@ class RepresentedCountry(Country):
221221
222222 .. attribute:: name
223223
224- The name of the country based on the languages list
225- passed to the constructor. This attribute is returned by all end points.
224+ The name of the country based on the locales list passed to the
225+ constructor. This attribute is returned by all end points.
226226
227227 :type: unicode
228228
@@ -395,8 +395,8 @@ class Subdivision(PlaceRecord):
395395
396396 .. attribute:: name
397397
398- The name of the subdivision based on the languages list
399- passed to the constructor. This attribute is returned by all end points.
398+ The name of the subdivision based on the locales list passed to the
399+ constructor. This attribute is returned by all end points.
400400
401401 :type: unicode
402402
@@ -427,10 +427,10 @@ class Subdivisions(tuple):
427427
428428 """
429429 # pylint:disable=R0924,W0212,W0142
430- def __new__ (cls , languages , * subdivisions ):
431- subdivisions = [Subdivision (languages , ** x ) for x in subdivisions ]
430+ def __new__ (cls , locales , * subdivisions ):
431+ subdivisions = [Subdivision (locales , ** x ) for x in subdivisions ]
432432 obj = super (cls , Subdivisions ).__new__ (cls , subdivisions )
433- obj ._languages = languages
433+ obj ._locales = locales
434434 return obj
435435
436436 @property
@@ -445,7 +445,7 @@ def most_specific(self):
445445 try :
446446 return self [- 1 ]
447447 except IndexError :
448- return Subdivision (self ._languages )
448+ return Subdivision (self ._locales )
449449
450450
451451class Traits (Record ):
0 commit comments