diff --git a/src/main/java/ru/soune/nocopy/service/geo/GeoCountryService.java b/src/main/java/ru/soune/nocopy/service/geo/GeoCountryService.java index a888029..843d2fe 100644 --- a/src/main/java/ru/soune/nocopy/service/geo/GeoCountryService.java +++ b/src/main/java/ru/soune/nocopy/service/geo/GeoCountryService.java @@ -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";