perf: object storage builtin comment i18n

pull/13898/head
wangruidong 2024-08-06 10:36:50 +08:00 committed by Bryan
parent 81b5f1ce93
commit 2b133a8085
7 changed files with 31 additions and 6 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:cc341a37287bb612793ea17590d6e8ffd855e87ffdfed29801053c7a85da4885 oid sha256:1b4d68932f593f0783a9b091c41d7d26ca3f61cb64ab29317a1392e6da3ebe84
size 178082 size 178369

View File

@ -9392,3 +9392,9 @@ msgstr "エンタープライズ・フラッグシップ・エディション"
#~ msgid "Please test the connection first" #~ msgid "Please test the connection first"
#~ msgstr "まず接続をテストしてください" #~ msgstr "まず接続をテストしてください"
msgid "Store locally"
msgstr "ローカルに保存する"
msgid "Do not save"
msgstr "保存しない"

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:d9d5792f1a5effff38a5cefeb313bdadfe2ace7c80fb4377ba48b5de1aa84da5 oid sha256:8e2fbd8872d5ab2d503d98222b03e8f2177fe93aa07c90fdf624b7c0b6a5da5d
size 145717 size 145926

View File

@ -9255,3 +9255,9 @@ msgstr "企业旗舰版"
#~ msgid "Please test the connection first" #~ msgid "Please test the connection first"
#~ msgstr "请先测试连接" #~ msgstr "请先测试连接"
msgid "Store locally"
msgstr "本地存储"
msgid "Do not save"
msgstr "不保存"

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:513c5bb9d3f1fed19dfcff6cfc8aba78235ea1726efe11fba920201d5ea61922 oid sha256:5094c79a6b828406dd63a963871bfffa70e31cd13b9d301412b3dc7b8810d2f0
size 145828 size 146037

View File

@ -9256,3 +9256,9 @@ msgstr "企業旗艦版"
#~ msgid "Please test the connection first" #~ msgid "Please test the connection first"
#~ msgstr "請先測試連接" #~ msgstr "請先測試連接"
msgid "Store locally"
msgstr "本地儲存"
msgid "Do not save"
msgstr "不儲存"

View File

@ -220,6 +220,7 @@ command_storage_type_serializer_classes_mapping = {
class BaseStorageSerializer(serializers.ModelSerializer): class BaseStorageSerializer(serializers.ModelSerializer):
storage_type_serializer_classes_mapping = {} storage_type_serializer_classes_mapping = {}
meta = MethodSerializer() meta = MethodSerializer()
comment = serializers.SerializerMethodField()
class Meta: class Meta:
model = None model = None
@ -252,6 +253,12 @@ class BaseStorageSerializer(serializers.ModelSerializer):
serializer = serializer_class serializer = serializer_class
return serializer return serializer
@staticmethod
def get_comment(obj):
need_translate_comments = ['Store locally', 'Do not save']
comment = obj.comment
return _(comment) if comment in need_translate_comments else comment
def save(self, **kwargs): def save(self, **kwargs):
instance = super().save(**kwargs) instance = super().save(**kwargs)
if self.validated_data.get('is_default', False): if self.validated_data.get('is_default', False):