perf: lang setting from core

This commit is contained in:
ibuler
2024-06-28 16:36:34 +08:00
committed by 老广
parent f5053728e7
commit 772c9b385c
6 changed files with 25 additions and 9 deletions

View File

@@ -3,7 +3,7 @@ from rest_framework import generics
from rest_framework.permissions import AllowAny
from authentication.permissions import IsValidUserOrConnectionToken
from common.const.choices import COUNTRY_CALLING_CODES
from common.const.choices import COUNTRY_CALLING_CODES, Language
from common.utils import get_logger, lazyproperty
from common.utils.timezone import local_now
from .. import serializers
@@ -26,7 +26,14 @@ class OpenPublicSettingApi(generics.RetrieveAPIView):
return {
"XPACK_ENABLED": settings.XPACK_ENABLED,
"INTERFACE": self.interface_setting,
"COUNTRY_CALLING_CODES": COUNTRY_CALLING_CODES
"COUNTRY_CALLING_CODES": COUNTRY_CALLING_CODES,
"LANGUAGES": [
{
'name': title,
'code': code
}
for code, title in Language.choices
]
}