This commit is contained in:
@@ -97,7 +97,8 @@ public class GeoCountryService {
|
||||
InetAddress ipAddress = InetAddress.getByName(ip);
|
||||
CityResponse response = cityDbReader.city(ipAddress);
|
||||
|
||||
return response.getCity().getName();
|
||||
return response.getCity().getNames().getOrDefault("ru",
|
||||
response.getCity().getName());
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to get city for IP: {}", ip, e);
|
||||
return "UNKNOWN";
|
||||
@@ -109,7 +110,8 @@ public class GeoCountryService {
|
||||
InetAddress ipAddress = InetAddress.getByName(ip);
|
||||
CountryResponse response = countryDbReader.country(ipAddress);
|
||||
|
||||
return response.getCountry().getName();
|
||||
return response.getCountry().getNames().getOrDefault("ru",
|
||||
response.getCountry().getName());
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to get country for IP: {}", ip, e);
|
||||
return "UNKNOWN";
|
||||
|
||||
Reference in New Issue
Block a user