From 2b95c25e94a22a5f090b2d447db17a54e029ae3b Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Thu, 8 Aug 2024 22:33:20 +0200 Subject: [PATCH] feat: translate place types --- config/packages/translation.yaml | 1 + src/Places/Domain/PlaceType.php | 8 ++ templates/places/_info_window.html.twig | 2 +- translations/messages+intl-icu.en.yaml | 183 ++++++++++++++++++++++++ translations/messages+intl-icu.fr.yaml | 183 ++++++++++++++++++++++++ 5 files changed, 376 insertions(+), 1 deletion(-) create mode 100644 translations/messages+intl-icu.en.yaml create mode 100644 translations/messages+intl-icu.fr.yaml diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index b3f8f9c..e1807c3 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -1,5 +1,6 @@ framework: default_locale: en + enabled_locales: ['en', 'fr'] translator: default_path: '%kernel.project_dir%/translations' fallbacks: diff --git a/src/Places/Domain/PlaceType.php b/src/Places/Domain/PlaceType.php index 8ff868b..2fedf8b 100644 --- a/src/Places/Domain/PlaceType.php +++ b/src/Places/Domain/PlaceType.php @@ -4,6 +4,9 @@ namespace App\Places\Domain; +use Symfony\Component\Translation\TranslatableMessage; +use function Symfony\Component\Translation\t; + /** * https://developers.google.com/maps/documentation/places/web-service/place-types?hl=fr */ @@ -209,4 +212,9 @@ enum PlaceType: string case TRANSIT_DEPOT = 'transit_depot'; case TRANSIT_STATION = 'transit_station'; case TRUCK_STOP = 'truck_stop'; + + public function toTranslatable(): TranslatableMessage + { + return t('place_type.' . $this->value); + } } diff --git a/templates/places/_info_window.html.twig b/templates/places/_info_window.html.twig index 96f4d9c..6970938 100644 --- a/templates/places/_info_window.html.twig +++ b/templates/places/_info_window.html.twig @@ -2,7 +2,7 @@

{{ place.address.formattedAddress }}

diff --git a/translations/messages+intl-icu.en.yaml b/translations/messages+intl-icu.en.yaml new file mode 100644 index 0000000..03b190b --- /dev/null +++ b/translations/messages+intl-icu.en.yaml @@ -0,0 +1,183 @@ +place_type: + administrative_area_level_1: Administrative Area Level 1 + administrative_area_level_2: Administrative Area Level 2 + administrative_area_level_3: Administrative Area Level 3 + administrative_area_level_4: Administrative Area Level 4 + administrative_area_level_5: Administrative Area Level 5 + administrative_area_level_6: Administrative Area Level 6 + administrative_area_level_7: Administrative Area Level 7 + archipelago: Archipelago + colloquial_area: Colloquial Area + continent: Continent + country: Country + establishment: Establishment + finance: Finance + floor: Floor + food: Food + general_contractor: General Contractor + geocode: Geocode + health: Health + intersection: Intersection + landmark: Landmark + locality: Locality + natural_feature: Natural Feature + neighborhood: Neighborhood + place_of_worship: Place of Worship + plus_code: Plus Code + point_of_interest: Point of Interest + political: Political + post_box: Post Box + postal_code: Postal Code + postal_code_prefix: Postal Code Prefix + postal_code_suffix: Postal Code Suffix + postal_town: Postal Town + premise: Premise + room: Room + route: Route + street_address: Street Address + street_number: Street Number + sublocality: Sublocality + sublocality_level_1: Sublocality Level 1 + sublocality_level_2: Sublocality Level 2 + sublocality_level_3: Sublocality Level 3 + sublocality_level_4: Sublocality Level 4 + sublocality_level_5: Sublocality Level 5 + subpremise: Subpremise + town_square: Town Square + art_gallery: Art Gallery + museum: Museum + performing_arts_theater: Performing Arts Theater + library: Library + preschool: Preschool + primary_school: Primary School + school: School + secondary_school: Secondary School + university: University + amusement_center: Amusement Center + amusement_park: Amusement Park + aquarium: Aquarium + banquet_hall: Banquet Hall + bowling_alley: Bowling Alley + casino: Casino + community_center: Community Center + convention_center: Convention Center + cultural_center: Cultural Center + dog_park: Dog Park + event_venue: Event Venue + hiking_area: Hiking Area + historical_landmark: Historical Landmark + marina: Marina + movie_rental: Movie Rental + movie_theater: Movie Theater + national_park: National Park + night_club: Night Club + park: Park + tourist_attraction: Tourist Attraction + visitor_center: Visitor Center + wedding_venue: Wedding Venue + zoo: Zoo + american_restaurant: American Restaurant + bakery: Bakery + bar: Bar + barbecue_restaurant: Barbecue Restaurant + brazilian_restaurant: Brazilian Restaurant + breakfast_restaurant: Breakfast Restaurant + brunch_restaurant: Brunch Restaurant + cafe: Cafe + chinese_restaurant: Chinese Restaurant + coffee_shop: Coffee Shop + fast_food_restaurant: Fast Food Restaurant + french_restaurant: French Restaurant + greek_restaurant: Greek Restaurant + hamburger_restaurant: Hamburger Restaurant + ice_cream_shop: Ice Cream Shop + indian_restaurant: Indian Restaurant + indonesian_restaurant: Indonesian Restaurant + italian_restaurant: Italian Restaurant + japanese_restaurant: Japanese Restaurant + korean_restaurant: Korean Restaurant + lebanese_restaurant: Lebanese Restaurant + meal_delivery: Meal Delivery + meal_takeaway: Meal Takeaway + mediterranean_restaurant: Mediterranean Restaurant + mexican_restaurant: Mexican Restaurant + middle_eastern_restaurant: Middle Eastern Restaurant + pizza_restaurant: Pizza Restaurant + ramen_restaurant: Ramen Restaurant + restaurant: Restaurant + sandwich_shop: Sandwich Shop + seafood_restaurant: Seafood Restaurant + spanish_restaurant: Spanish Restaurant + steak_house: Steak House + sushi_restaurant: Sushi Restaurant + thai_restaurant: Thai Restaurant + turkish_restaurant: Turkish Restaurant + vegan_restaurant: Vegan Restaurant + vegetarian_restaurant: Vegetarian Restaurant + vietnamese_restaurant: Vietnamese Restaurant + bed_and_breakfast: Bed and Breakfast + campground: Campground + camping_cabin: Camping Cabin + cottage: Cottage + extended_stay_hotel: Extended Stay Hotel + farmstay: Farmstay + guest_house: Guest House + hostel: Hostel + hotel: Hotel + lodging: Lodging + motel: Motel + private_guest_room: Private Guest Room + resort_hotel: Resort Hotel + rv_park: RV Park + church: Church + hindu_temple: Hindu Temple + mosque: Mosque + synagogue: Synagogue + auto_parts_store: Auto Parts Store + bicycle_store: Bicycle Store + book_store: Book Store + cell_phone_store: Cell Phone Store + clothing_store: Clothing Store + convenience_store: Convenience Store + department_store: Department Store + discount_store: Discount Store + electronics_store: Electronics Store + furniture_store: Furniture Store + gift_shop: Gift Shop + grocery_store: Grocery Store + hardware_store: Hardware Store + home_goods_store: Home Goods Store + home_improvement_store: Home Improvement Store + jewelry_store: Jewelry Store + liquor_store: Liquor Store + market: Market + pet_store: Pet Store + shoe_store: Shoe Store + shopping_mall: Shopping Mall + sporting_goods_store: Sporting Goods Store + store: Store + supermarket: Supermarket + wholesaler: Wholesaler + athletic_field: Athletic Field + fitness_center: Fitness Center + golf_course: Golf Course + gym: Gym + playground: Playground + ski_resort: Ski Resort + sports_club: Sports Club + sports_complex: Sports Complex + stadium: Stadium + swimming_pool: Swimming Pool + airport: Airport + bus_station: Bus Station + bus_stop: Bus Stop + ferry_terminal: Ferry Terminal + heliport: Heliport + light_rail_station: Light Rail Station + park_and_ride: Park and Ride + subway_station: Subway Station + taxi_stand: Taxi Stand + train_station: Train Station + transit_depot: Transit Depot + transit_station: Transit Station + truck_stop: Truck Stop diff --git a/translations/messages+intl-icu.fr.yaml b/translations/messages+intl-icu.fr.yaml new file mode 100644 index 0000000..bda788a --- /dev/null +++ b/translations/messages+intl-icu.fr.yaml @@ -0,0 +1,183 @@ +place_type: + administrative_area_level_1: Région administrative de niveau 1 + administrative_area_level_2: Région administrative de niveau 2 + administrative_area_level_3: Région administrative de niveau 3 + administrative_area_level_4: Région administrative de niveau 4 + administrative_area_level_5: Région administrative de niveau 5 + administrative_area_level_6: Région administrative de niveau 6 + administrative_area_level_7: Région administrative de niveau 7 + archipelago: Archipel + colloquial_area: Zone familière + continent: Continent + country: Pays + establishment: Établissement + finance: Finance + floor: Étage + food: Alimentation + general_contractor: Entrepreneur général + geocode: Géocode + health: Santé + intersection: Intersection + landmark: Repère + locality: Localité + natural_feature: Caractéristique naturelle + neighborhood: Quartier + place_of_worship: Lieu de culte + plus_code: Code plus + point_of_interest: Point d'intérêt + political: Politique + post_box: Boîte postale + postal_code: Code postal + postal_code_prefix: Préfixe du code postal + postal_code_suffix: Suffixe du code postal + postal_town: Ville postale + premise: Lieu + room: Pièce + route: Route + street_address: Adresse + street_number: Numéro de rue + sublocality: Sous-localité + sublocality_level_1: Sous-localité de niveau 1 + sublocality_level_2: Sous-localité de niveau 2 + sublocality_level_3: Sous-localité de niveau 3 + sublocality_level_4: Sous-localité de niveau 4 + sublocality_level_5: Sous-localité de niveau 5 + subpremise: Sous-lieu + town_square: Place de ville + art_gallery: Galerie d'art + museum: Musée + performing_arts_theater: Théâtre des arts du spectacle + library: Bibliothèque + preschool: École maternelle + primary_school: École primaire + school: École + secondary_school: Collège/lycée + university: Université + amusement_center: Centre de divertissement + amusement_park: Parc d'attractions + aquarium: Aquarium + banquet_hall: Salle de banquet + bowling_alley: Salle de bowling + casino: Casino + community_center: Centre communautaire + convention_center: Centre de conventions + cultural_center: Centre culturel + dog_park: Parc pour chiens + event_venue: Lieu de l'événement + hiking_area: Zone de randonnée + historical_landmark: Monument historique + marina: Marina + movie_rental: Location de films + movie_theater: Cinéma + national_park: Parc national + night_club: Boîte de nuit + park: Parc + tourist_attraction: Attraction touristique + visitor_center: Centre d'accueil + wedding_venue: Lieu de mariage + zoo: Zoo + american_restaurant: Restaurant américain + bakery: Boulangerie + bar: Bar + barbecue_restaurant: Restaurant barbecue + brazilian_restaurant: Restaurant brésilien + breakfast_restaurant: Restaurant de petit déjeuner + brunch_restaurant: Restaurant de brunch + cafe: Café + chinese_restaurant: Restaurant chinois + coffee_shop: Café + fast_food_restaurant: Restauration rapide + french_restaurant: Restaurant français + greek_restaurant: Restaurant grec + hamburger_restaurant: Restaurant de hamburgers + ice_cream_shop: Glacier + indian_restaurant: Restaurant indien + indonesian_restaurant: Restaurant indonésien + italian_restaurant: Restaurant italien + japanese_restaurant: Restaurant japonais + korean_restaurant: Restaurant coréen + lebanese_restaurant: Restaurant libanais + meal_delivery: Livraison de repas + meal_takeaway: Plats à emporter + mediterranean_restaurant: Restaurant méditerranéen + mexican_restaurant: Restaurant mexicain + middle_eastern_restaurant: Restaurant du Moyen-Orient + pizza_restaurant: Pizzeria + ramen_restaurant: Restaurant de ramen + restaurant: Restaurant + sandwich_shop: Sandwicherie + seafood_restaurant: Restaurant de fruits de mer + spanish_restaurant: Restaurant espagnol + steak_house: Steakhouse + sushi_restaurant: Restaurant de sushi + thai_restaurant: Restaurant thaïlandais + turkish_restaurant: Restaurant turc + vegan_restaurant: Restaurant végétalien + vegetarian_restaurant: Restaurant végétarien + vietnamese_restaurant: Restaurant vietnamien + bed_and_breakfast: Chambre d'hôtes + campground: Terrain de camping + camping_cabin: Cabine de camping + cottage: Gîte + extended_stay_hotel: Hôtel de long séjour + farmstay: Séjour à la ferme + guest_house: Maison d'hôtes + hostel: Auberge + hotel: Hôtel + lodging: Hébergement + motel: Motel + private_guest_room: Chambre d'hôte privée + resort_hotel: Hôtel de villégiature + rv_park: Parc pour camping-cars + church: Église + hindu_temple: Temple hindou + mosque: Mosquée + synagogue: Synagogue + auto_parts_store: Magasin de pièces automobiles + bicycle_store: Magasin de vélos + book_store: Librairie + cell_phone_store: Magasin de téléphones portables + clothing_store: Magasin de vêtements + convenience_store: Dépanneur + department_store: Grand magasin + discount_store: Magasin de rabais + electronics_store: Magasin d'électronique + furniture_store: Magasin de meubles + gift_shop: Magasin de cadeaux + grocery_store: Épicerie + hardware_store: Quincaillerie + home_goods_store: Magasin d'articles ménagers + home_improvement_store: Magasin de rénovation + jewelry_store: Bijouterie + liquor_store: Magasin d'alcools + market: Marché + pet_store: Animalerie + shoe_store: Magasin de chaussures + shopping_mall: Centre commercial + sporting_goods_store: Magasin d'articles de sport + store: Magasin + supermarket: Supermarché + wholesaler: Grossiste + athletic_field: Terrain de sport + fitness_center: Centre de fitness + golf_course: Terrain de golf + gym: Salle de gym + playground: Terrain de jeu + ski_resort: Station de ski + sports_club: Club de sport + sports_complex: Complexe sportif + stadium: Stade + swimming_pool: Piscine + airport: Aéroport + bus_station: Gare routière + bus_stop: Arrêt de bus + ferry_terminal: Terminal de ferry + heliport: Héliport + light_rail_station: Station de tramway + park_and_ride: Parc relais + subway_station: Station de métro + taxi_stand: Station de taxis + train_station: Gare + transit_depot: Dépôt de transit + transit_station: Station de transit + truck_stop: Aire de repos pour camions