perf: 修改翻译

pull/12928/head
ibuler 2024-03-27 17:50:44 +08:00
parent f6e4d909ff
commit c22f88ae42
4 changed files with 25 additions and 18 deletions

View File

@ -125,7 +125,7 @@ class AssetSerializer(BulkOrgResourceModelSerializer, ResourceLabelsMixin, Writa
category = LabeledChoiceField(choices=Category.choices, read_only=True, label=_('Category')) category = LabeledChoiceField(choices=Category.choices, read_only=True, label=_('Category'))
type = LabeledChoiceField(choices=AllTypes.choices(), read_only=True, label=_('Type')) type = LabeledChoiceField(choices=AllTypes.choices(), read_only=True, label=_('Type'))
protocols = AssetProtocolsSerializer(many=True, required=False, label=_('Protocols'), default=()) protocols = AssetProtocolsSerializer(many=True, required=False, label=_('Protocols'), default=())
accounts = AssetAccountSerializer(many=True, required=False, allow_null=True, write_only=True, label=_('Account')) accounts = AssetAccountSerializer(many=True, required=False, allow_null=True, write_only=True, label=_('Accounts'))
nodes_display = serializers.ListField(read_only=False, required=False, label=_("Node path")) nodes_display = serializers.ListField(read_only=False, required=False, label=_("Node path"))
_accounts = None _accounts = None

View File

@ -15,7 +15,7 @@ __all__ = ['DomainSerializer', 'DomainWithGatewaySerializer', 'DomainListSeriali
class DomainSerializer(ResourceLabelsMixin, BulkOrgResourceModelSerializer): class DomainSerializer(ResourceLabelsMixin, BulkOrgResourceModelSerializer):
gateways = ObjectRelatedField( gateways = ObjectRelatedField(
many=True, required=False, label=_('Gateway'), read_only=True, many=True, required=False, label=_('Gateways'), read_only=True,
) )
assets_amount = serializers.IntegerField(label=_('Assets amount'), read_only=True) assets_amount = serializers.IntegerField(label=_('Assets amount'), read_only=True)

View File

@ -30,30 +30,36 @@ class PlatformAutomationSerializer(serializers.ModelSerializer):
] ]
extra_kwargs = { extra_kwargs = {
# 启用资产探测 # 启用资产探测
"ping_enabled": {"label": _("Ping enabled"), "help_text": _("Enable asset detection")}, "ping_enabled": {"label": _("Ping enabled"), },
"ping_method": {"label": _("Ping method")}, "ping_method": {"label": _("Ping method"), "help_text": _("Enable asset detection")},
"gather_facts_enabled": { "gather_facts_enabled": {"label": _("Gather facts enabled"), },
"label": _("Gather facts enabled"), "gather_facts_method": {
"help_text": _("Enable asset facts collection") "label": _("Gather facts method"),
"help_text": _("Enable asset information collection")
}, },
"gather_facts_method": {"label": _("Gather facts method")}, "verify_account_method": {
"verify_account_enabled": { "label": _("Verify account method"),
"label": _("Verify account enabled"),
"help_text": _("Enable account verification") "help_text": _("Enable account verification")
}, },
"verify_account_method": {"label": _("Verify account method")},
"change_secret_enabled": { "change_secret_enabled": {
"label": _("Change secret enabled"), "label": _("Change secret enabled"),
},
"change_secret_method": {
"label": _("Change secret method"),
"help_text": _("Enable account secret auto change") "help_text": _("Enable account secret auto change")
}, },
"change_secret_method": {"label": _("Change secret method")}, "push_account_enabled": {"label": _("Push account enabled"), },
"push_account_enabled": {"label": _("Push account enabled"), "help_text": _("Enable account auto push")}, "push_account_method": {
"push_account_method": {"label": _("Push account method")}, "label": _("Push account method"),
"help_text": _("Enable account auto push")
},
"gather_accounts_enabled": { "gather_accounts_enabled": {
"label": _("Gather accounts enabled"), "label": _("Gather accounts enabled"),
},
"gather_accounts_method": {
"label": _("Gather accounts method"),
"help_text": _("Enable account collection") "help_text": _("Enable account collection")
}, },
"gather_accounts_method": {"label": _("Gather accounts method")},
} }

View File

@ -1040,12 +1040,13 @@
"StrategyHelpTips": "Identify the unique attributes of assets (such as platforms) based on priority of strategies; when an asset's attribute (like nodes) can be configured to multiple, all Actions of the strategies will be executed.", "StrategyHelpTips": "Identify the unique attributes of assets (such as platforms) based on priority of strategies; when an asset's attribute (like nodes) can be configured to multiple, all Actions of the strategies will be executed.",
"StrategyList": "Policy List", "StrategyList": "Policy List",
"StrategyUpdate": "Update the Policy", "StrategyUpdate": "Update the Policy",
"SuEnabled": "Enable SU", "SuEnabled": "Enable switch",
"SuFrom": "SU From", "SuFrom": "Switch From",
"Submit": "Submit", "Submit": "Submit",
"Success": "Success", "Success": "Success",
"SuccessAsset": "Successful Assets", "SuccessAsset": "Successful Assets",
"SuccessfulOperation": "Action successful", "SuccessfulOperation": "Action successful",
"AddInDetailText": "After successful creation or update, add to the details",
"Summary(success/total)": " Overview( Successful/Total )", "Summary(success/total)": " Overview( Successful/Total )",
"Sunday": "Sunday", "Sunday": "Sunday",
"SuperAdmin": "Super Administrator", "SuperAdmin": "Super Administrator",
@ -1197,7 +1198,7 @@
"UserProfile": "Profile", "UserProfile": "Profile",
"UserSession": "Asset Sessions", "UserSession": "Asset Sessions",
"UserSetting": "Preference", "UserSetting": "Preference",
"UserSwitchFrom": "SU from", "UserSwitchFrom": "Switch from",
"UserUpdate": "Update the User", "UserUpdate": "Update the User",
"Username": "Username", "Username": "Username",
"UsernamePlaceholder": "Please Enter Username", "UsernamePlaceholder": "Please Enter Username",