Fix language constant to show correct lang in API

api/v1/instance had "en" hardcoded as language. This fix takes LANGUAGE_CODE from settings.py/.env and takes the first two letters as response.
This commit is contained in:
Jascha Urbach 2023-04-16 17:28:05 +02:00
parent 290b740392
commit f3b1b1d8e4
No known key found for this signature in database
GPG key ID: A43A844B114F9B08

View file

@ -9,8 +9,7 @@ from django.utils import timezone
from django.views.decorators.http import require_GET
from bookwyrm import models
from bookwyrm.settings import DOMAIN, VERSION
from bookwyrm.settings import DOMAIN, VERSION, LANGUAGE_CODE
@require_GET
def webfinger(request):
@ -110,7 +109,7 @@ def instance_info(_):
"status_count": status_count,
},
"thumbnail": logo,
"languages": ["en"],
"languages": [LANGUAGE_CODE[:2]],
"registrations": site.allow_registration,
"approval_required": not site.allow_registration
and site.allow_invite_requests,