fix: Translate Google Place types to Polish in GBP audit
- Add comprehensive GOOGLE_TYPES_PL dictionary with 200+ type translations - Update _check_categories() to use Polish translations - Fallback to formatted English if translation not available - Categories like "car_repair" now display as "Warsztat samochodowy" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f28ea804d2
commit
c4d6f12840
@ -58,6 +58,262 @@ REVIEW_THRESHOLDS = {
|
||||
'excellent': 20, # Excellent review count
|
||||
}
|
||||
|
||||
# Google Place Types to Polish translations
|
||||
# Source: https://developers.google.com/maps/documentation/places/web-service/supported_types
|
||||
GOOGLE_TYPES_PL = {
|
||||
# Automotive
|
||||
'car_dealer': 'Salon samochodowy',
|
||||
'car_rental': 'Wynajem samochodów',
|
||||
'car_repair': 'Warsztat samochodowy',
|
||||
'car_wash': 'Myjnia samochodowa',
|
||||
'electric_vehicle_charging_station': 'Stacja ładowania EV',
|
||||
'gas_station': 'Stacja paliw',
|
||||
'parking': 'Parking',
|
||||
'rest_stop': 'Miejsce odpoczynku',
|
||||
|
||||
# Business
|
||||
'farm': 'Gospodarstwo rolne',
|
||||
|
||||
# Culture
|
||||
'art_gallery': 'Galeria sztuki',
|
||||
'museum': 'Muzeum',
|
||||
'performing_arts_theater': 'Teatr',
|
||||
|
||||
# Education
|
||||
'library': 'Biblioteka',
|
||||
'preschool': 'Przedszkole',
|
||||
'primary_school': 'Szkoła podstawowa',
|
||||
'school': 'Szkoła',
|
||||
'secondary_school': 'Szkoła średnia',
|
||||
'university': 'Uniwersytet',
|
||||
|
||||
# Entertainment and Recreation
|
||||
'amusement_center': 'Centrum rozrywki',
|
||||
'amusement_park': 'Park rozrywki',
|
||||
'aquarium': 'Akwarium',
|
||||
'banquet_hall': 'Sala bankietowa',
|
||||
'bowling_alley': 'Kręgielnia',
|
||||
'casino': 'Kasyno',
|
||||
'community_center': 'Centrum społeczne',
|
||||
'convention_center': 'Centrum konferencyjne',
|
||||
'cultural_center': 'Centrum kultury',
|
||||
'dog_park': 'Park dla psów',
|
||||
'event_venue': 'Miejsce eventowe',
|
||||
'hiking_area': 'Szlak turystyczny',
|
||||
'historical_landmark': 'Zabytek',
|
||||
'marina': 'Przystań',
|
||||
'movie_rental': 'Wypożyczalnia filmów',
|
||||
'movie_theater': 'Kino',
|
||||
'national_park': 'Park narodowy',
|
||||
'night_club': 'Klub nocny',
|
||||
'park': 'Park',
|
||||
'tourist_attraction': 'Atrakcja turystyczna',
|
||||
'visitor_center': 'Centrum informacyjne',
|
||||
'wedding_venue': 'Sala weselna',
|
||||
'zoo': 'Zoo',
|
||||
|
||||
# Finance
|
||||
'accounting': 'Biuro rachunkowe',
|
||||
'atm': 'Bankomat',
|
||||
'bank': 'Bank',
|
||||
|
||||
# Food and Drink
|
||||
'american_restaurant': 'Restauracja amerykańska',
|
||||
'bakery': 'Piekarnia',
|
||||
'bar': 'Bar',
|
||||
'barbecue_restaurant': 'Restauracja BBQ',
|
||||
'brazilian_restaurant': 'Restauracja brazylijska',
|
||||
'breakfast_restaurant': 'Restauracja śniadaniowa',
|
||||
'brunch_restaurant': 'Restauracja brunchowa',
|
||||
'cafe': 'Kawiarnia',
|
||||
'chinese_restaurant': 'Restauracja chińska',
|
||||
'coffee_shop': 'Kawiarnia',
|
||||
'fast_food_restaurant': 'Fast food',
|
||||
'french_restaurant': 'Restauracja francuska',
|
||||
'greek_restaurant': 'Restauracja grecka',
|
||||
'hamburger_restaurant': 'Burgery',
|
||||
'ice_cream_shop': 'Lodziarnia',
|
||||
'indian_restaurant': 'Restauracja indyjska',
|
||||
'indonesian_restaurant': 'Restauracja indonezyjska',
|
||||
'italian_restaurant': 'Restauracja włoska',
|
||||
'japanese_restaurant': 'Restauracja japońska',
|
||||
'korean_restaurant': 'Restauracja koreańska',
|
||||
'lebanese_restaurant': 'Restauracja libańska',
|
||||
'meal_delivery': 'Dostawa jedzenia',
|
||||
'meal_takeaway': 'Jedzenie na wynos',
|
||||
'mediterranean_restaurant': 'Restauracja śródziemnomorska',
|
||||
'mexican_restaurant': 'Restauracja meksykańska',
|
||||
'middle_eastern_restaurant': 'Restauracja bliskowschodnia',
|
||||
'pizza_restaurant': 'Pizzeria',
|
||||
'ramen_restaurant': 'Ramen',
|
||||
'restaurant': 'Restauracja',
|
||||
'sandwich_shop': 'Kanapki',
|
||||
'seafood_restaurant': 'Owoce morza',
|
||||
'spanish_restaurant': 'Restauracja hiszpańska',
|
||||
'steak_house': 'Steakhouse',
|
||||
'sushi_restaurant': 'Sushi',
|
||||
'thai_restaurant': 'Restauracja tajska',
|
||||
'turkish_restaurant': 'Restauracja turecka',
|
||||
'vegan_restaurant': 'Restauracja wegańska',
|
||||
'vegetarian_restaurant': 'Restauracja wegetariańska',
|
||||
'vietnamese_restaurant': 'Restauracja wietnamska',
|
||||
|
||||
# Government
|
||||
'city_hall': 'Ratusz',
|
||||
'courthouse': 'Sąd',
|
||||
'embassy': 'Ambasada',
|
||||
'fire_station': 'Straż pożarna',
|
||||
'local_government_office': 'Urząd',
|
||||
'police': 'Policja',
|
||||
'post_office': 'Poczta',
|
||||
|
||||
# Health and Wellness
|
||||
'dental_clinic': 'Klinika stomatologiczna',
|
||||
'dentist': 'Dentysta',
|
||||
'doctor': 'Lekarz',
|
||||
'drugstore': 'Apteka',
|
||||
'hospital': 'Szpital',
|
||||
'medical_lab': 'Laboratorium medyczne',
|
||||
'pharmacy': 'Apteka',
|
||||
'physiotherapist': 'Fizjoterapeuta',
|
||||
'spa': 'Spa',
|
||||
|
||||
# Lodging
|
||||
'bed_and_breakfast': 'Nocleg ze śniadaniem',
|
||||
'campground': 'Pole namiotowe',
|
||||
'camping_cabin': 'Domek kempingowy',
|
||||
'cottage': 'Domek letniskowy',
|
||||
'extended_stay_hotel': 'Hotel długoterminowy',
|
||||
'farmstay': 'Agroturystyka',
|
||||
'guest_house': 'Pensjonat',
|
||||
'hostel': 'Hostel',
|
||||
'hotel': 'Hotel',
|
||||
'lodging': 'Nocleg',
|
||||
'motel': 'Motel',
|
||||
'private_guest_room': 'Pokój gościnny',
|
||||
'resort_hotel': 'Hotel resortowy',
|
||||
'rv_park': 'Park dla kamperów',
|
||||
|
||||
# Places of Worship
|
||||
'church': 'Kościół',
|
||||
'hindu_temple': 'Świątynia hinduska',
|
||||
'mosque': 'Meczet',
|
||||
'synagogue': 'Synagoga',
|
||||
|
||||
# Services
|
||||
'barber_shop': 'Fryzjer męski',
|
||||
'beauty_salon': 'Salon kosmetyczny',
|
||||
'cemetery': 'Cmentarz',
|
||||
'child_care_agency': 'Opieka nad dziećmi',
|
||||
'consultant': 'Konsultant',
|
||||
'courier_service': 'Usługi kurierskie',
|
||||
'electrician': 'Elektryk',
|
||||
'florist': 'Kwiaciarnia',
|
||||
'funeral_home': 'Dom pogrzebowy',
|
||||
'hair_care': 'Fryzjer',
|
||||
'hair_salon': 'Salon fryzjerski',
|
||||
'insurance_agency': 'Agencja ubezpieczeniowa',
|
||||
'laundry': 'Pralnia',
|
||||
'lawyer': 'Prawnik',
|
||||
'locksmith': 'Ślusarz',
|
||||
'moving_company': 'Firma przeprowadzkowa',
|
||||
'painter': 'Malarz',
|
||||
'plumber': 'Hydraulik',
|
||||
'real_estate_agency': 'Agencja nieruchomości',
|
||||
'roofing_contractor': 'Dekarz',
|
||||
'storage': 'Magazyn',
|
||||
'tailor': 'Krawiec',
|
||||
'telecommunications_service_provider': 'Telekomunikacja',
|
||||
'travel_agency': 'Biuro podróży',
|
||||
'veterinary_care': 'Weterynarz',
|
||||
|
||||
# Shopping
|
||||
'auto_parts_store': 'Sklep z częściami',
|
||||
'bicycle_store': 'Sklep rowerowy',
|
||||
'book_store': 'Księgarnia',
|
||||
'cell_phone_store': 'Sklep z telefonami',
|
||||
'clothing_store': 'Sklep odzieżowy',
|
||||
'convenience_store': 'Sklep spożywczy',
|
||||
'department_store': 'Dom towarowy',
|
||||
'discount_store': 'Sklep z przecenami',
|
||||
'electronics_store': 'Sklep elektroniczny',
|
||||
'furniture_store': 'Sklep meblowy',
|
||||
'gift_shop': 'Sklep z upominkami',
|
||||
'grocery_store': 'Sklep spożywczy',
|
||||
'hardware_store': 'Sklep z narzędziami',
|
||||
'home_goods_store': 'Sklep z artykułami domowymi',
|
||||
'home_improvement_store': 'Market budowlany',
|
||||
'jewelry_store': 'Jubiler',
|
||||
'liquor_store': 'Sklep monopolowy',
|
||||
'market': 'Targ',
|
||||
'pet_store': 'Sklep zoologiczny',
|
||||
'shoe_store': 'Sklep obuwniczy',
|
||||
'shopping_mall': 'Centrum handlowe',
|
||||
'sporting_goods_store': 'Sklep sportowy',
|
||||
'store': 'Sklep',
|
||||
'supermarket': 'Supermarket',
|
||||
'wholesaler': 'Hurtownia',
|
||||
|
||||
# Sports
|
||||
'athletic_field': 'Boisko sportowe',
|
||||
'fitness_center': 'Siłownia',
|
||||
'golf_course': 'Pole golfowe',
|
||||
'gym': 'Siłownia',
|
||||
'playground': 'Plac zabaw',
|
||||
'ski_resort': 'Ośrodek narciarski',
|
||||
'sports_club': 'Klub sportowy',
|
||||
'sports_complex': 'Kompleks sportowy',
|
||||
'stadium': 'Stadion',
|
||||
'swimming_pool': 'Basen',
|
||||
|
||||
# Transportation
|
||||
'airport': 'Lotnisko',
|
||||
'bus_station': 'Dworzec autobusowy',
|
||||
'bus_stop': 'Przystanek autobusowy',
|
||||
'ferry_terminal': 'Terminal promowy',
|
||||
'heliport': 'Lądowisko helikopterów',
|
||||
'light_rail_station': 'Stacja kolejki',
|
||||
'park_and_ride': 'Park & Ride',
|
||||
'subway_station': 'Stacja metra',
|
||||
'taxi_stand': 'Postój taksówek',
|
||||
'train_station': 'Dworzec kolejowy',
|
||||
'transit_depot': 'Zajezdnia',
|
||||
'transit_station': 'Stacja przesiadkowa',
|
||||
'truck_stop': 'Parking dla TIR-ów',
|
||||
|
||||
# Generic types (often returned by Google)
|
||||
'establishment': 'Firma',
|
||||
'point_of_interest': 'Punkt zainteresowania',
|
||||
'general_contractor': 'Firma budowlana',
|
||||
'roofing_contractor': 'Dekarz',
|
||||
'hvac_contractor': 'Klimatyzacja i ogrzewanie',
|
||||
'plumber': 'Hydraulik',
|
||||
'electrician': 'Elektryk',
|
||||
'contractor': 'Wykonawca',
|
||||
'construction_company': 'Firma budowlana',
|
||||
'industrial_area': 'Strefa przemysłowa',
|
||||
'office': 'Biuro',
|
||||
'food': 'Gastronomia',
|
||||
'health': 'Zdrowie',
|
||||
'finance': 'Finanse',
|
||||
'political': 'Instytucja polityczna',
|
||||
'place_of_worship': 'Miejsce kultu',
|
||||
'natural_feature': 'Obiekt przyrodniczy',
|
||||
'locality': 'Miejscowość',
|
||||
'sublocality': 'Dzielnica',
|
||||
'neighborhood': 'Okolica',
|
||||
'premise': 'Lokal',
|
||||
'subpremise': 'Podlokal',
|
||||
'route': 'Trasa',
|
||||
'street_address': 'Adres',
|
||||
'floor': 'Piętro',
|
||||
'room': 'Pokój',
|
||||
'postal_code': 'Kod pocztowy',
|
||||
'country': 'Kraj',
|
||||
'administrative_area_level_1': 'Województwo',
|
||||
'administrative_area_level_2': 'Powiat',
|
||||
}
|
||||
|
||||
|
||||
@dataclass
|
||||
class FieldStatus:
|
||||
@ -460,8 +716,16 @@ class GBPAuditService:
|
||||
google_types = analysis.google_types if analysis and analysis.google_types else None
|
||||
|
||||
if google_types and len(google_types) > 0:
|
||||
# Format Google types for display (remove underscores, title case)
|
||||
formatted_types = [t.replace('_', ' ').title() for t in google_types[:3]]
|
||||
# Translate Google types to Polish using GOOGLE_TYPES_PL dictionary
|
||||
# Fallback to formatted English if translation not available
|
||||
formatted_types = []
|
||||
for t in google_types[:3]:
|
||||
if t in GOOGLE_TYPES_PL:
|
||||
formatted_types.append(GOOGLE_TYPES_PL[t])
|
||||
else:
|
||||
# Fallback: remove underscores, title case
|
||||
formatted_types.append(t.replace('_', ' ').title())
|
||||
|
||||
return FieldStatus(
|
||||
field_name='categories',
|
||||
status='complete',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user