Make Location information translatable
This commit is contained in:
parent
f112615aae
commit
2384e99900
|
@ -190,10 +190,29 @@ ACTIVITIES = {
|
||||||
|
|
||||||
TUNE_DATA = ['artist', 'title', 'source', 'track', 'length']
|
TUNE_DATA = ['artist', 'title', 'source', 'track', 'length']
|
||||||
|
|
||||||
LOCATION_DATA = ['accuracy', 'alt', 'area', 'bearing', 'building', 'country',
|
LOCATION_DATA = {
|
||||||
'countrycode', 'datum', 'description', 'error', 'floor', 'lat',
|
'accuracy': _('accuracy'),
|
||||||
'locality', 'lon', 'postalcode', 'region', 'room', 'speed',
|
'alt': _('alt'),
|
||||||
'street', 'text', 'timestamp', 'uri']
|
'area': _('area'),
|
||||||
|
'bearing': _('bearing'),
|
||||||
|
'building': _('building'),
|
||||||
|
'country': _('country'),
|
||||||
|
'countrycode': _('countrycode'),
|
||||||
|
'datum': _('datum'),
|
||||||
|
'description': _('description'),
|
||||||
|
'error': _('error'),
|
||||||
|
'floor': _('floor'),
|
||||||
|
'lat': _('lat'),
|
||||||
|
'locality': _('locality'),
|
||||||
|
'lon': _('lon'),
|
||||||
|
'postalcode': _('postalcode'),
|
||||||
|
'region': _('region'),
|
||||||
|
'room': _('room'),
|
||||||
|
'speed': _('speed'),
|
||||||
|
'street': _('street'),
|
||||||
|
'text': _('text'),
|
||||||
|
'timestamp': _('timestamp'),
|
||||||
|
'uri': _('uri')}
|
||||||
|
|
||||||
import gobject
|
import gobject
|
||||||
import gtk
|
import gtk
|
||||||
|
@ -483,8 +502,10 @@ class UserLocationPEP(AbstractPEP):
|
||||||
for entry in location.keys():
|
for entry in location.keys():
|
||||||
text = location[entry]
|
text = location[entry]
|
||||||
text = gobject.markup_escape_text(text)
|
text = gobject.markup_escape_text(text)
|
||||||
|
# Translate standart location tag
|
||||||
|
tag = LOCATION_DATA.get(entry, entry)
|
||||||
location_string += '\n<b>%(tag)s</b>: %(text)s' % \
|
location_string += '\n<b>%(tag)s</b>: %(text)s' % \
|
||||||
{'tag': entry.capitalize(), 'text': text}
|
{'tag': tag.capitalize(), 'text': text}
|
||||||
|
|
||||||
return location_string.strip()
|
return location_string.strip()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue