mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-23 03:38:08 -06:00
Merge pull request #251 from Menelion/geocode-i18n
Localize geocoding to the current language
This commit is contained in:
commit
cd596a6ad6
@ -40,6 +40,7 @@ import logging
|
|||||||
import webbrowser
|
import webbrowser
|
||||||
from mysc import localization
|
from mysc import localization
|
||||||
import os
|
import os
|
||||||
|
import languageHandler
|
||||||
|
|
||||||
log = logging.getLogger("mainController")
|
log = logging.getLogger("mainController")
|
||||||
|
|
||||||
@ -952,7 +953,7 @@ class Controller(object):
|
|||||||
if tweet["coordinates"] != None:
|
if tweet["coordinates"] != None:
|
||||||
x = tweet["coordinates"]["coordinates"][0]
|
x = tweet["coordinates"]["coordinates"][0]
|
||||||
y = tweet["coordinates"]["coordinates"][1]
|
y = tweet["coordinates"]["coordinates"][1]
|
||||||
address = geocoder.reverse_geocode(y, x)
|
address = geocoder.reverse_geocode(y, x, language = languageHandler.curLang)
|
||||||
if event == None: output.speak(address[0].__str__().decode("utf-8"))
|
if event == None: output.speak(address[0].__str__().decode("utf-8"))
|
||||||
else: self.view.show_address(address[0].__str__().decode("utf-8"))
|
else: self.view.show_address(address[0].__str__().decode("utf-8"))
|
||||||
else:
|
else:
|
||||||
@ -972,7 +973,7 @@ class Controller(object):
|
|||||||
if tweet["coordinates"] != None:
|
if tweet["coordinates"] != None:
|
||||||
x = tweet["coordinates"]["coordinates"][0]
|
x = tweet["coordinates"]["coordinates"][0]
|
||||||
y = tweet["coordinates"]["coordinates"][1]
|
y = tweet["coordinates"]["coordinates"][1]
|
||||||
address = geocoder.reverse_geocode(y, x)
|
address = geocoder.reverse_geocode(y, x, language = languageHandler.curLang)
|
||||||
dlg = commonMessageDialogs.view_geodata(address[0].__str__())
|
dlg = commonMessageDialogs.view_geodata(address[0].__str__())
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"There are no coordinates in this tweet"))
|
output.speak(_(u"There are no coordinates in this tweet"))
|
||||||
|
Loading…
Reference in New Issue
Block a user