mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-21 22:09:36 +02:00
Add localization support for adventure and settings pages; enhance UI elements
- Updated Chinese translations in zh.json for various UI components including coordinates, sun times, and authentication settings. - Refactored adventure page to utilize localization for visit counts, descriptions, and other text elements. - Improved settings page by integrating localization for profile, security, email management, and integration sections. - Enhanced visual consistency by updating card backgrounds and adding localized text for buttons and labels.
This commit is contained in:
parent
e856a57498
commit
d3d74f9f35
15 changed files with 879 additions and 175 deletions
|
@ -4,6 +4,7 @@ from .models import Adventure, AdventureImage, ChecklistItem, Collection, Note,
|
|||
from rest_framework import serializers
|
||||
from main.utils import CustomModelSerializer
|
||||
from users.serializers import CustomUserDetailsSerializer
|
||||
from worldtravel.serializers import CountrySerializer, RegionSerializer, CitySerializer
|
||||
|
||||
|
||||
class AdventureImageSerializer(CustomModelSerializer):
|
||||
|
@ -82,7 +83,9 @@ class AdventureSerializer(CustomModelSerializer):
|
|||
category = CategorySerializer(read_only=False, required=False)
|
||||
is_visited = serializers.SerializerMethodField()
|
||||
user = serializers.SerializerMethodField()
|
||||
country = serializers.SerializerMethodField()
|
||||
country = CountrySerializer(read_only=True)
|
||||
region = RegionSerializer(read_only=True)
|
||||
city = CitySerializer(read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = Adventure
|
||||
|
@ -105,9 +108,6 @@ class AdventureSerializer(CustomModelSerializer):
|
|||
category_data['name'] = name
|
||||
return category_data
|
||||
|
||||
def get_country(self, obj):
|
||||
return obj.country.country_code if obj.country else None
|
||||
|
||||
def get_or_create_category(self, category_data):
|
||||
user = self.context['request'].user
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue