diff --git a/backend/server/adventures/views/category_view.py b/backend/server/adventures/views/category_view.py index 6422b85..abbf2ef 100644 --- a/backend/server/adventures/views/category_view.py +++ b/backend/server/adventures/views/category_view.py @@ -14,7 +14,7 @@ class CategoryViewSet(viewsets.ModelViewSet): def list(self, request, *args, **kwargs): """ - Retrieve a list of distinct categories for adventures associated with the current user. + Retrieve a list of distinct categories for locations associated with the current user. """ categories = self.get_queryset().distinct() serializer = self.get_serializer(categories, many=True) @@ -29,7 +29,7 @@ class CategoryViewSet(viewsets.ModelViewSet): if instance.name == 'general': return Response({"error": "Cannot delete the general category"}, status=400) - # set any adventures with this category to a default category called general before deleting the category, if general does not exist create it for the user + # set any locations with this category to a default category called general before deleting the category, if general does not exist create it for the user general_category = Category.objects.filter(user=request.user, name='general').first() if not general_category: diff --git a/backend/server/adventures/views/checklist_view.py b/backend/server/adventures/views/checklist_view.py index 280a21c..d2bdece 100644 --- a/backend/server/adventures/views/checklist_view.py +++ b/backend/server/adventures/views/checklist_view.py @@ -29,12 +29,12 @@ class ChecklistViewSet(viewsets.ModelViewSet): if self.action == 'retrieve': - # For individual adventure retrieval, include public adventures + # For individual adventure retrieval, include public locations return Checklist.objects.filter( Q(is_public=True) | Q(user=self.request.user) | Q(collection__shared_with=self.request.user) ).distinct().order_by('-updated_at') else: - # For other actions, include user's own adventures and shared adventures + # For other actions, include user's own locations and shared locations return Checklist.objects.filter( Q(user=self.request.user) | Q(collection__shared_with=self.request.user) ).distinct().order_by('-updated_at') diff --git a/backend/server/adventures/views/global_search_view.py b/backend/server/adventures/views/global_search_view.py index adc0834..aab5f61 100644 --- a/backend/server/adventures/views/global_search_view.py +++ b/backend/server/adventures/views/global_search_view.py @@ -20,7 +20,7 @@ class GlobalSearchView(viewsets.ViewSet): # Initialize empty results results = { - "adventures": [], + "locations": [], "collections": [], "users": [], "countries": [], @@ -30,11 +30,11 @@ class GlobalSearchView(viewsets.ViewSet): "visited_cities": [] } - # Adventures: Full-Text Search - adventures = Location.objects.annotate( + # Locations: Full-Text Search + locations = Location.objects.annotate( search=SearchVector('name', 'description', 'location') ).filter(search=SearchQuery(search_term), user=request.user) - results["adventures"] = LocationSerializer(adventures, many=True).data + results["locations"] = LocationSerializer(locations, many=True).data # Collections: Partial Match Search collections = Collection.objects.filter( diff --git a/backend/server/adventures/views/ics_calendar_view.py b/backend/server/adventures/views/ics_calendar_view.py index 2fd7f15..0654eae 100644 --- a/backend/server/adventures/views/ics_calendar_view.py +++ b/backend/server/adventures/views/ics_calendar_view.py @@ -12,8 +12,8 @@ class IcsCalendarGeneratorViewSet(viewsets.ViewSet): @action(detail=False, methods=['get']) def generate(self, request): - adventures = Location.objects.filter(user=request.user) - serializer = LocationSerializer(adventures, many=True) + locations = Location.objects.filter(user=request.user) + serializer = LocationSerializer(locations, many=True) user = request.user name = f"{user.first_name} {user.last_name}" @@ -21,9 +21,9 @@ class IcsCalendarGeneratorViewSet(viewsets.ViewSet): cal.add('prodid', '-//My Adventure Calendar//example.com//') cal.add('version', '2.0') - for adventure in serializer.data: - if adventure['visits']: - for visit in adventure['visits']: + for location in serializer.data: + if location['visits']: + for visit in location['visits']: # Skip if start_date is missing if not visit.get('start_date'): continue @@ -41,7 +41,7 @@ class IcsCalendarGeneratorViewSet(viewsets.ViewSet): # Create event event = Event() - event.add('summary', adventure['name']) + event.add('summary', location['name']) event.add('dtstart', start_date) event.add('dtend', end_date) event.add('dtstamp', datetime.now()) @@ -49,11 +49,11 @@ class IcsCalendarGeneratorViewSet(viewsets.ViewSet): event.add('class', 'PUBLIC') event.add('created', datetime.now()) event.add('last-modified', datetime.now()) - event.add('description', adventure['description']) - if adventure.get('location'): - event.add('location', adventure['location']) - if adventure.get('link'): - event.add('url', adventure['link']) + event.add('description', location['description']) + if location.get('location'): + event.add('location', location['location']) + if location.get('link'): + event.add('url', location['link']) organizer = vCalAddress(f'MAILTO:{user.email}') organizer.params['cn'] = vText(name) diff --git a/backend/server/adventures/views/location_image_view.py b/backend/server/adventures/views/location_image_view.py index cb65908..063c7a8 100644 --- a/backend/server/adventures/views/location_image_view.py +++ b/backend/server/adventures/views/location_image_view.py @@ -9,7 +9,6 @@ from adventures.serializers import LocationImageSerializer from integrations.models import ImmichIntegration import uuid import requests -import os class AdventureImageViewSet(viewsets.ModelViewSet): serializer_class = LocationImageSerializer diff --git a/backend/server/adventures/views/location_view.py b/backend/server/adventures/views/location_view.py index 3f9797a..a30291e 100644 --- a/backend/server/adventures/views/location_view.py +++ b/backend/server/adventures/views/location_view.py @@ -7,10 +7,9 @@ from rest_framework import viewsets, status from rest_framework.decorators import action from rest_framework.response import Response import requests - -from adventures.models import Location, Category, Transportation, Lodging +from adventures.models import Location, Category from adventures.permissions import IsOwnerOrSharedWithFullAccess -from adventures.serializers import LocationSerializer, TransportationSerializer, LodgingSerializer +from adventures.serializers import LocationSerializer from adventures.utils import pagination @@ -28,7 +27,7 @@ class LocationViewSet(viewsets.ModelViewSet): def get_queryset(self): """ Returns queryset based on user authentication and action type. - Public actions allow unauthenticated access to public adventures. + Public actions allow unauthenticated access to public locations. """ user = self.request.user public_allowed_actions = {'retrieve', 'additional_info'} @@ -67,7 +66,7 @@ class LocationViewSet(viewsets.ModelViewSet): # Apply sorting logic queryset = self._apply_ordering(queryset, order_by, order_direction) - # Filter adventures without collections if requested + # Filter locations without collections if requested if include_collections == 'false': queryset = queryset.filter(collections__isnull=True) @@ -147,7 +146,7 @@ class LocationViewSet(viewsets.ModelViewSet): @action(detail=False, methods=['get']) def filtered(self, request): - """Filter adventures by category types and visit status.""" + """Filter locations by category types and visit status.""" types = request.query_params.get('types', '').split(',') # Handle 'all' types @@ -180,7 +179,7 @@ class LocationViewSet(viewsets.ModelViewSet): @action(detail=False, methods=['get']) def all(self, request): - """Get all adventures (public and owned) with optional collection filtering.""" + """Get all locations (public and owned) with optional collection filtering.""" if not request.user.is_authenticated: return Response({"error": "User is not authenticated"}, status=400) diff --git a/backend/server/adventures/views/lodging_view.py b/backend/server/adventures/views/lodging_view.py index d526c30..159c127 100644 --- a/backend/server/adventures/views/lodging_view.py +++ b/backend/server/adventures/views/lodging_view.py @@ -25,11 +25,11 @@ class LodgingViewSet(viewsets.ModelViewSet): def get_queryset(self): user = self.request.user if self.action == 'retrieve': - # For individual adventure retrieval, include public adventures, user's own adventures and shared adventures + # For individual adventure retrieval, include public locations, user's own locations and shared locations return Lodging.objects.filter( Q(is_public=True) | Q(user=user.id) | Q(collection__shared_with=user.id) ).distinct().order_by('-updated_at') - # For other actions, include user's own adventures and shared adventures + # For other actions, include user's own locations and shared locations return Lodging.objects.filter( Q(user=user.id) | Q(collection__shared_with=user.id) ).distinct().order_by('-updated_at') diff --git a/backend/server/adventures/views/note_view.py b/backend/server/adventures/views/note_view.py index 55da7b9..4b488cb 100644 --- a/backend/server/adventures/views/note_view.py +++ b/backend/server/adventures/views/note_view.py @@ -15,7 +15,7 @@ class NoteViewSet(viewsets.ModelViewSet): # return error message if user is not authenticated on the root endpoint def list(self, request, *args, **kwargs): - # Prevent listing all adventures + # Prevent listing all locations return Response({"detail": "Listing all notes is not allowed."}, status=status.HTTP_403_FORBIDDEN) @@ -39,12 +39,12 @@ class NoteViewSet(viewsets.ModelViewSet): if self.action == 'retrieve': - # For individual adventure retrieval, include public adventures + # For individual adventure retrieval, include public locations return Note.objects.filter( Q(is_public=True) | Q(user=self.request.user.id) | Q(collection__shared_with=self.request.user) ).distinct().order_by('-updated_at') else: - # For other actions, include user's own adventures and shared adventures + # For other actions, include user's own locations and shared locations return Note.objects.filter( Q(user=self.request.user.id) | Q(collection__shared_with=self.request.user) ).distinct().order_by('-updated_at') diff --git a/backend/server/adventures/views/recommendations_view.py b/backend/server/adventures/views/recommendations_view.py index e759f9c..c26913f 100644 --- a/backend/server/adventures/views/recommendations_view.py +++ b/backend/server/adventures/views/recommendations_view.py @@ -5,8 +5,6 @@ from rest_framework.response import Response from django.conf import settings import requests from geopy.distance import geodesic -import time - class RecommendationsViewSet(viewsets.ViewSet): permission_classes = [IsAuthenticated] @@ -14,7 +12,7 @@ class RecommendationsViewSet(viewsets.ViewSet): HEADERS = {'User-Agent': 'AdventureLog Server'} def parse_google_places(self, places, origin): - adventures = [] + locations = [] for place in places: location = place.get('location', {}) @@ -45,16 +43,16 @@ class RecommendationsViewSet(viewsets.ViewSet): "distance_km": round(distance_km, 2), } - adventures.append(adventure) + locations.append(adventure) # Sort by distance ascending - adventures.sort(key=lambda x: x["distance_km"]) + locations.sort(key=lambda x: x["distance_km"]) - return adventures + return locations def parse_overpass_response(self, data, request): nodes = data.get('elements', []) - adventures = [] + locations = [] all = request.query_params.get('all', False) origin = None @@ -102,13 +100,13 @@ class RecommendationsViewSet(viewsets.ViewSet): "powered_by": "osm" } - adventures.append(adventure) + locations.append(adventure) # Sort by distance if available if origin: - adventures.sort(key=lambda x: x.get("distance_km") or float("inf")) + locations.sort(key=lambda x: x.get("distance_km") or float("inf")) - return adventures + return locations def query_overpass(self, lat, lon, radius, category, request): @@ -172,8 +170,8 @@ class RecommendationsViewSet(viewsets.ViewSet): print("Overpass API error:", e) return Response({"error": "Failed to retrieve data from Overpass API."}, status=500) - adventures = self.parse_overpass_response(data, request) - return Response(adventures) + locations = self.parse_overpass_response(data, request) + return Response(locations) def query_google_nearby(self, lat, lon, radius, category, request): """Query Google Places API (New) for nearby places""" @@ -216,9 +214,9 @@ class RecommendationsViewSet(viewsets.ViewSet): places = data.get('places', []) origin = (float(lat), float(lon)) - adventures = self.parse_google_places(places, origin) + locations = self.parse_google_places(places, origin) - return Response(adventures) + return Response(locations) except requests.exceptions.RequestException as e: print(f"Google Places API error: {e}") diff --git a/backend/server/adventures/views/reverse_geocode_view.py b/backend/server/adventures/views/reverse_geocode_view.py index 1227a21..ce46f1c 100644 --- a/backend/server/adventures/views/reverse_geocode_view.py +++ b/backend/server/adventures/views/reverse_geocode_view.py @@ -5,9 +5,7 @@ from rest_framework.response import Response from worldtravel.models import Region, City, VisitedRegion, VisitedCity from adventures.models import Location from adventures.serializers import LocationSerializer -import requests from adventures.geocoding import reverse_geocode -from adventures.geocoding import extractIsoCode from django.conf import settings from adventures.geocoding import search_google, search_osm @@ -47,14 +45,14 @@ class ReverseGeocodeViewSet(viewsets.ViewSet): @action(detail=False, methods=['post']) def mark_visited_region(self, request): - # searches through all of the users adventures, if the serialized data is_visited, is true, runs reverse geocode on the adventures and if a region is found, marks it as visited. Use the extractIsoCode function to get the region + # searches through all of the users locations, if the serialized data is_visited, is true, runs reverse geocode on the locations and if a region is found, marks it as visited. Use the extractIsoCode function to get the region new_region_count = 0 new_regions = {} new_city_count = 0 new_cities = {} - adventures = Location.objects.filter(user=self.request.user) - serializer = LocationSerializer(adventures, many=True) - for adventure, serialized_adventure in zip(adventures, serializer.data): + locations = Location.objects.filter(user=self.request.user) + serializer = LocationSerializer(locations, many=True) + for adventure, serialized_adventure in zip(locations, serializer.data): if serialized_adventure['is_visited'] == True: lat = adventure.latitude lon = adventure.longitude diff --git a/backend/server/adventures/views/stats_view.py b/backend/server/adventures/views/stats_view.py index 3f279e2..b3fcb38 100644 --- a/backend/server/adventures/views/stats_view.py +++ b/backend/server/adventures/views/stats_view.py @@ -1,11 +1,9 @@ from rest_framework import viewsets -from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.decorators import action from django.shortcuts import get_object_or_404 from worldtravel.models import City, Region, Country, VisitedCity, VisitedRegion from adventures.models import Location, Collection -from users.serializers import CustomUserDetailsSerializer as PublicUserSerializer from django.contrib.auth import get_user_model User = get_user_model() @@ -26,7 +24,7 @@ class StatsViewSet(viewsets.ViewSet): user.email = None # get the counts for the user - adventure_count = Location.objects.filter( + location_count = Location.objects.filter( user=user.id).count() trips_count = Collection.objects.filter( user=user.id).count() @@ -40,7 +38,7 @@ class StatsViewSet(viewsets.ViewSet): user=user.id).values('region__country').distinct().count() total_countries = Country.objects.count() return Response({ - 'adventure_count': adventure_count, + 'location_count': location_count, 'trips_count': trips_count, 'visited_city_count': visited_city_count, 'total_cities': total_cities, diff --git a/backend/server/adventures/views/tags_view.py b/backend/server/adventures/views/tags_view.py index 0700b9e..da1ab12 100644 --- a/backend/server/adventures/views/tags_view.py +++ b/backend/server/adventures/views/tags_view.py @@ -10,7 +10,7 @@ class ActivityTypesView(viewsets.ViewSet): @action(detail=False, methods=['get']) def types(self, request): """ - Retrieve a list of distinct activity types for adventures associated with the current user. + Retrieve a list of distinct activity types for locations associated with the current user. Args: request (HttpRequest): The HTTP request object. diff --git a/backend/server/adventures/views/transportation_view.py b/backend/server/adventures/views/transportation_view.py index 00a6bd6..a8d0c65 100644 --- a/backend/server/adventures/views/transportation_view.py +++ b/backend/server/adventures/views/transportation_view.py @@ -1,12 +1,10 @@ from rest_framework import viewsets, status -from rest_framework.decorators import action from rest_framework.response import Response from django.db.models import Q from adventures.models import Transportation from adventures.serializers import TransportationSerializer from rest_framework.exceptions import PermissionDenied from adventures.permissions import IsOwnerOrSharedWithFullAccess -from rest_framework.permissions import IsAuthenticated class TransportationViewSet(viewsets.ModelViewSet): queryset = Transportation.objects.all() @@ -25,11 +23,11 @@ class TransportationViewSet(viewsets.ModelViewSet): def get_queryset(self): user = self.request.user if self.action == 'retrieve': - # For individual adventure retrieval, include public adventures, user's own adventures and shared adventures + # For individual adventure retrieval, include public locations, user's own locations and shared locations return Transportation.objects.filter( Q(is_public=True) | Q(user=user.id) | Q(collection__shared_with=user.id) ).distinct().order_by('-updated_at') - # For other actions, include user's own adventures and shared adventures + # For other actions, include user's own locations and shared locations return Transportation.objects.filter( Q(user=user.id) | Q(collection__shared_with=user.id) ).distinct().order_by('-updated_at') diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 88e2d92..750958f 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -572,7 +572,13 @@ "search": { "adventurelog_results": "AdventureLog-Ergebnisse", "online_results": "Online-Ergebnisse", - "public_adventures": "Öffentliche Abenteuer" + "public_adventures": "Öffentliche Abenteuer", + "cities": "Städte", + "countries": "Länder", + "found": "gefunden", + "result": "Ergebnis", + "results": "Ergebnisse", + "try_searching_desc": "Versuchen Sie, nach Abenteuern, Sammlungen, Ländern, Regionen, Städten oder Nutzern zu suchen." }, "map": { "add_adventure": "Neues Abenteuer hinzufügen", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 611b699..c547b07 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -589,7 +589,13 @@ "search": { "adventurelog_results": "AdventureLog Results", "public_adventures": "Public Adventures", - "online_results": "Online Results" + "online_results": "Online Results", + "result": "Result", + "results": "Results", + "found": "found", + "try_searching_desc": "Try searching for adventures, collections, countries, regions, cities, or users.", + "countries": "Countries", + "cities": "Cities" }, "map": { "view_details": "View Details", diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json index b8f1bde..a213e33 100644 --- a/frontend/src/locales/es.json +++ b/frontend/src/locales/es.json @@ -572,7 +572,13 @@ "search": { "adventurelog_results": "Resultados del registro de aventuras", "online_results": "Resultados en línea", - "public_adventures": "Aventuras públicas" + "public_adventures": "Aventuras públicas", + "cities": "Ciudades", + "countries": "Países", + "found": "encontró", + "result": "Resultado", + "results": "Resultados", + "try_searching_desc": "Intente buscar aventuras, colecciones, países, regiones, ciudades o usuarios." }, "map": { "add_adventure": "Agregar nueva aventura", diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json index d2e7b60..1942756 100644 --- a/frontend/src/locales/fr.json +++ b/frontend/src/locales/fr.json @@ -572,7 +572,13 @@ "search": { "adventurelog_results": "Résultats dans AdventureLog", "online_results": "Résultats en ligne", - "public_adventures": "Aventures publiques" + "public_adventures": "Aventures publiques", + "cities": "Villes", + "countries": "Pays", + "found": "trouvé", + "result": "Résultat", + "results": "Résultats", + "try_searching_desc": "Essayez de rechercher des aventures, des collections, des pays, des régions, des villes ou des utilisateurs." }, "map": { "add_adventure": "Ajouter une nouvelle aventure", diff --git a/frontend/src/locales/it.json b/frontend/src/locales/it.json index b6872dd..c2d4197 100644 --- a/frontend/src/locales/it.json +++ b/frontend/src/locales/it.json @@ -572,7 +572,13 @@ "search": { "adventurelog_results": "Risultati di AdventureLog", "online_results": "Risultati in linea", - "public_adventures": "Avventure pubbliche" + "public_adventures": "Avventure pubbliche", + "cities": "Città", + "countries": "Paesi", + "found": "trovato", + "result": "Risultato", + "results": "Risultati", + "try_searching_desc": "Prova a cercare avventure, collezioni, paesi, regioni, città o utenti." }, "map": { "add_adventure": "Aggiungi nuova avventura", diff --git a/frontend/src/locales/ko.json b/frontend/src/locales/ko.json index 6ad3124..669f2a4 100644 --- a/frontend/src/locales/ko.json +++ b/frontend/src/locales/ko.json @@ -469,7 +469,13 @@ "search": { "adventurelog_results": "Adventurelog 결과", "online_results": "온라인 결과", - "public_adventures": "공개 모험" + "public_adventures": "공개 모험", + "cities": "도시", + "countries": "국가", + "found": "설립하다", + "result": "결과", + "results": "결과", + "try_searching_desc": "모험, 컬렉션, 국가, 지역, 도시 또는 사용자를 검색하십시오." }, "settings": { "about_this_background": "이 배경에 대해", diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json index d6c52b8..93741c6 100644 --- a/frontend/src/locales/nl.json +++ b/frontend/src/locales/nl.json @@ -572,7 +572,13 @@ "search": { "adventurelog_results": "AdventureLog resultaten", "online_results": "Online resultaten", - "public_adventures": "Openbare avonturen" + "public_adventures": "Openbare avonturen", + "cities": "Steden", + "countries": "Landen", + "found": "gevonden", + "result": "Resultaat", + "results": "Resultaat", + "try_searching_desc": "Probeer op zoek naar avonturen, collecties, landen, regio's, steden of gebruikers." }, "map": { "add_adventure": "Voeg nieuw avontuur toe", diff --git a/frontend/src/locales/no.json b/frontend/src/locales/no.json index cac684e..089a192 100644 --- a/frontend/src/locales/no.json +++ b/frontend/src/locales/no.json @@ -589,7 +589,13 @@ "search": { "adventurelog_results": "AdventureLog-resultater", "public_adventures": "Offentlige eventyr", - "online_results": "Nettresultater" + "online_results": "Nettresultater", + "cities": "Byer", + "countries": "Land", + "found": "funnet", + "result": "Resultat", + "results": "Resultater", + "try_searching_desc": "Prøv å søke etter eventyr, samlinger, land, regioner, byer eller brukere." }, "map": { "view_details": "Vis detaljer", diff --git a/frontend/src/locales/pl.json b/frontend/src/locales/pl.json index 09b9490..260e045 100644 --- a/frontend/src/locales/pl.json +++ b/frontend/src/locales/pl.json @@ -572,7 +572,13 @@ "search": { "adventurelog_results": "Wyniki AdventureLog", "public_adventures": "Publiczne podróże", - "online_results": "Wyniki online" + "online_results": "Wyniki online", + "cities": "Miasta", + "countries": "Kraje", + "found": "znaleziony", + "result": "Wynik", + "results": "Wyniki", + "try_searching_desc": "Spróbuj szukać przygód, kolekcji, krajów, regionów, miast lub użytkowników." }, "map": { "view_details": "Zobacz szczegóły", diff --git a/frontend/src/locales/ru.json b/frontend/src/locales/ru.json index 6c51b58..0511cbe 100644 --- a/frontend/src/locales/ru.json +++ b/frontend/src/locales/ru.json @@ -589,7 +589,13 @@ "search": { "adventurelog_results": "Результаты AdventureLog", "public_adventures": "Публичные приключения", - "online_results": "Онлайн результаты" + "online_results": "Онлайн результаты", + "cities": "Города", + "countries": "Страны", + "found": "найденный", + "result": "Результат", + "results": "Результаты", + "try_searching_desc": "Попробуйте искать приключения, коллекции, страны, регионы, города или пользователей." }, "map": { "view_details": "Подробности", diff --git a/frontend/src/locales/sv.json b/frontend/src/locales/sv.json index 0218849..e84d5ad 100644 --- a/frontend/src/locales/sv.json +++ b/frontend/src/locales/sv.json @@ -572,7 +572,13 @@ "search": { "adventurelog_results": "AdventureLog-resultat", "online_results": "Online resultat", - "public_adventures": "Offentliga äventyr" + "public_adventures": "Offentliga äventyr", + "cities": "Städer", + "countries": "Länder", + "found": "funnna", + "result": "Resultat", + "results": "Resultat", + "try_searching_desc": "Försök att söka efter äventyr, samlingar, länder, regioner, städer eller användare." }, "map": { "add_adventure": "Lägg till nytt äventyr", diff --git a/frontend/src/locales/zh.json b/frontend/src/locales/zh.json index 1114271..721df19 100644 --- a/frontend/src/locales/zh.json +++ b/frontend/src/locales/zh.json @@ -572,7 +572,13 @@ "search": { "adventurelog_results": "AdventureLog 结果", "online_results": "在线结果", - "public_adventures": "已公开的冒险" + "public_adventures": "已公开的冒险", + "cities": "城市", + "countries": "国家", + "found": "成立", + "result": "结果", + "results": "结果", + "try_searching_desc": "尝试搜索冒险,收藏,国家,地区,城市或用户。" }, "map": { "add_adventure": "添加新冒险", diff --git a/frontend/src/routes/dashboard/+page.svelte b/frontend/src/routes/dashboard/+page.svelte index d035f29..a1ec3b7 100644 --- a/frontend/src/routes/dashboard/+page.svelte +++ b/frontend/src/routes/dashboard/+page.svelte @@ -51,9 +51,9 @@ : user?.username}!
- {#if stats.adventure_count > 0} + {#if stats.location_count > 0} {$t('dashboard.welcome_text_1')} - {stats.adventure_count} + {stats.location_count} {$t('dashboard.welcome_text_2')} {:else} {$t('dashboard.welcome_text_3')} @@ -171,7 +171,7 @@ {$t('dashboard.view_all')} - {stats.adventure_count} + {stats.location_count} diff --git a/frontend/src/routes/profile/[uuid]/+page.svelte b/frontend/src/routes/profile/[uuid]/+page.svelte index 406c947..5422c02 100644 --- a/frontend/src/routes/profile/[uuid]/+page.svelte +++ b/frontend/src/routes/profile/[uuid]/+page.svelte @@ -23,7 +23,7 @@ visited_country_count: number; total_regions: number; trips_count: number; - adventure_count: number; + location_count: number; visited_region_count: number; total_countries: number; visited_city_count: number; @@ -48,34 +48,34 @@ // Achievement levels $: achievementLevel = - (stats?.adventure_count ?? 0) >= 100 + (stats?.location_count ?? 0) >= 100 ? 'Legendary Explorer' - : (stats?.adventure_count ?? 0) >= 75 + : (stats?.location_count ?? 0) >= 75 ? 'World Wanderer' - : (stats?.adventure_count ?? 0) >= 50 + : (stats?.location_count ?? 0) >= 50 ? 'Explorer Master' - : (stats?.adventure_count ?? 0) >= 35 + : (stats?.location_count ?? 0) >= 35 ? 'Globetrotter' - : (stats?.adventure_count ?? 0) >= 25 + : (stats?.location_count ?? 0) >= 25 ? 'Seasoned Traveler' - : (stats?.adventure_count ?? 0) >= 15 + : (stats?.location_count ?? 0) >= 15 ? 'Adventure Seeker' - : (stats?.adventure_count ?? 0) >= 10 + : (stats?.location_count ?? 0) >= 10 ? 'Trailblazer' - : (stats?.adventure_count ?? 0) >= 5 + : (stats?.location_count ?? 0) >= 5 ? 'Journey Starter' - : (stats?.adventure_count ?? 0) >= 1 + : (stats?.location_count ?? 0) >= 1 ? 'Travel Enthusiast' : 'New Explorer'; $: achievementColor = - (stats?.adventure_count ?? 0) >= 50 + (stats?.location_count ?? 0) >= 50 ? 'text-warning' - : (stats?.adventure_count ?? 0) >= 25 + : (stats?.location_count ?? 0) >= 25 ? 'text-success' - : (stats?.adventure_count ?? 0) >= 10 + : (stats?.location_count ?? 0) >= 10 ? 'text-info' - : (stats?.adventure_count ?? 0) >= 5 + : (stats?.location_count ?? 0) >= 5 ? 'text-secondary' : 'text-primary'; @@ -159,7 +159,7 @@ {/if} - {#if stats && stats.adventure_count > 0} + {#if stats && stats.location_count > 0}