mirror of https://github.com/jumpserver/jumpserver
perf: object storage builtin comment i18n
parent
81b5f1ce93
commit
2b133a8085
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cc341a37287bb612793ea17590d6e8ffd855e87ffdfed29801053c7a85da4885
|
||||
size 178082
|
||||
oid sha256:1b4d68932f593f0783a9b091c41d7d26ca3f61cb64ab29317a1392e6da3ebe84
|
||||
size 178369
|
||||
|
|
|
@ -9392,3 +9392,9 @@ msgstr "エンタープライズ・フラッグシップ・エディション"
|
|||
|
||||
#~ msgid "Please test the connection first"
|
||||
#~ msgstr "まず接続をテストしてください"
|
||||
|
||||
msgid "Store locally"
|
||||
msgstr "ローカルに保存する"
|
||||
|
||||
msgid "Do not save"
|
||||
msgstr "保存しない"
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d9d5792f1a5effff38a5cefeb313bdadfe2ace7c80fb4377ba48b5de1aa84da5
|
||||
size 145717
|
||||
oid sha256:8e2fbd8872d5ab2d503d98222b03e8f2177fe93aa07c90fdf624b7c0b6a5da5d
|
||||
size 145926
|
||||
|
|
|
@ -9255,3 +9255,9 @@ msgstr "企业旗舰版"
|
|||
|
||||
#~ msgid "Please test the connection first"
|
||||
#~ msgstr "请先测试连接"
|
||||
|
||||
msgid "Store locally"
|
||||
msgstr "本地存储"
|
||||
|
||||
msgid "Do not save"
|
||||
msgstr "不保存"
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:513c5bb9d3f1fed19dfcff6cfc8aba78235ea1726efe11fba920201d5ea61922
|
||||
size 145828
|
||||
oid sha256:5094c79a6b828406dd63a963871bfffa70e31cd13b9d301412b3dc7b8810d2f0
|
||||
size 146037
|
||||
|
|
|
@ -9256,3 +9256,9 @@ msgstr "企業旗艦版"
|
|||
|
||||
#~ msgid "Please test the connection first"
|
||||
#~ msgstr "請先測試連接"
|
||||
|
||||
msgid "Store locally"
|
||||
msgstr "本地儲存"
|
||||
|
||||
msgid "Do not save"
|
||||
msgstr "不儲存"
|
|
@ -220,6 +220,7 @@ command_storage_type_serializer_classes_mapping = {
|
|||
class BaseStorageSerializer(serializers.ModelSerializer):
|
||||
storage_type_serializer_classes_mapping = {}
|
||||
meta = MethodSerializer()
|
||||
comment = serializers.SerializerMethodField()
|
||||
|
||||
class Meta:
|
||||
model = None
|
||||
|
@ -252,6 +253,12 @@ class BaseStorageSerializer(serializers.ModelSerializer):
|
|||
serializer = serializer_class
|
||||
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):
|
||||
instance = super().save(**kwargs)
|
||||
if self.validated_data.get('is_default', False):
|
||||
|
|
Loading…
Reference in New Issue