kazelee
2025-05-27 49efcc39ef399f8f3b170f6b06ffc2177643f1b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
'use strict';
window.SwaggerTranslator = {
    _words: [],
 
    translate: function ()
    {
        var $this = this;
        $('[data-sw-translate]').each(function ()
        {
            $(this).html($this._tryTranslate($(this).html()));
            $(this).val($this._tryTranslate($(this).val()));
            $(this).attr('title', $this._tryTranslate($(this).attr('title')));
        });
    },
 
    setControllerSummary: function ()
    {
        $.ajax({
            type: "get",
            async: true,
            url: $("#input_baseUrl").val(),
            dataType: "json",
            success: function (data)
            {
                var summaryDict = data.ControllerDesc;
                var id, controllerName, strSummary;
                $("#resources_container .resource").each(function (i, item)
                {
                    id = $(item).attr("id");
                    if (id)
                    {
                        controllerName = id.substring(9);
                        strSummary = summaryDict[controllerName];
                        if (strSummary)
                        {
                            $(item).children(".heading").children(".options").first().prepend('<li class="controller-summary" title="' + strSummary + '">' + strSummary + '</li>');
                        }
                    }
                });
            }
        });
    },
 
    setModelDescriptions: function() {
        $.ajax({
            type: "get",
            url: $("#input_baseUrl").val(),
            dataType: "json",
            success: function(data) {
                var modelDesc = data.ModelDesc;
                // ÔÚÄ£ÐÍÕ¹Ê¾ÇøÓòÌí¼ÓÃèÊö
                $(".model-box").each(function() {
                    var modelName = $(this).find(".model-title").text();
                    if (modelDesc[modelName]) {
                        $(this).find(".model-description").remove();
                        $(this).append(
                            `<div class="model-description">${modelDesc[modelName]}</div>`
                        );
                    }
                });
            }
        });
    },
    _tryTranslate: function (word)
    {
        return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
    },
 
    learn: function (wordsMap)
    {
        this._words = wordsMap;
    }
};
 
 
/* jshint quotmark: float */
window.SwaggerTranslator.learn({
    "Warning: Deprecated": "¾¯¸æ£ºÒѹýʱ",
    "Implementation Notes": "ʵÏÖ±¸×¢",
    "Response Class": "ÏìÓ¦Àà",
    "Status": "״̬",
    "Parameters": "²ÎÊý",
    "Parameter": "²ÎÊý",
    "Value": "Öµ",
    "Description": "ÃèÊö",
    "Parameter Type": "²ÎÊýÀàÐÍ",
    "Data Type": "Êý¾ÝÀàÐÍ",
    "Response Messages": "ÏìÓ¦ÏûÏ¢",
    "HTTP Status Code": "HTTP ×´Ì¬Âë",
    "Reason": "Ô­Òò",
    "Response Model": "ÏìӦģÐÍ",
    "Request URL": "ÇëÇó URL",
    "Response Body": "ÏìÓ¦Ìå",
    "Response Code": "ÏìÓ¦Âë",
    "Response Headers": "ÏìӦͷ",
    "Hide Response": "Òþ²ØÏìÓ¦",
    "Headers": "Í·",
    "Try it out!": "ÊÔһϣ¡",
    "Show/Hide": "ÏÔʾ/Òþ²Ø",
    "List Operations": "ÏÔʾ²Ù×÷",
    "Expand Operations": "Õ¹¿ª²Ù×÷",
    "Raw": "ԭʼ",
    "can't parse JSON.  Raw result": "ÎÞ·¨½âÎö JSON¡£Ô­Ê¼½á¹û",
    "Model Schema": "Ä£Ðͼܹ¹",
    "Model": "Ä£ÐÍ",
    "apply": "Ó¦ÓÃ",
    "Username": "Óû§Ãû",
    "Password": "ÃÜÂë",
    "Terms of service": "·þÎñÌõ¿î",
    "Created by": "´´½¨Õß",
    "See more at": "²é¿´¸ü¶à£º",
    "Contact the developer": "ÁªÏµ¿ª·¢Õß",
    "api version": "api °æ±¾",
    "Response Content Type": "ÏìÓ¦ Content Type",
    "fetching resource": "ÕýÔÚ»ñÈ¡×ÊÔ´",
    "fetching resource list": "ÕýÔÚ»ñÈ¡×ÊÔ´Áбí",
    "Explore": "ä¯ÀÀ",
    "Show Swagger Petstore Example Apis": "ÏÔʾ Swagger Petstore Ê¾Àý Apis",
    "Can't read from server.  It may not have the appropriate access-control-origin settings.": "ÎÞ·¨´Ó·þÎñÆ÷¶ÁÈ¡¡£¿ÉÄÜûÓÐÕýÈ·ÉèÖàaccess-control-origin¡£",
    "Please specify the protocol for": "ÇëÖ¸¶¨Ð­Ò飺",
    "Can't read swagger JSON from": "ÎÞ·¨¶ÁÈ¡ swagger JSONÓÚ",
    "Finished Loading Resource Information. Rendering Swagger UI": "ÒѼÓÔØ×ÊÔ´ÐÅÏ¢¡£ÕýÔÚäÖȾ Swagger UI",
    "Unable to read api": "ÎÞ·¨¶ÁÈ¡ api",
    "from path": "´Ó·¾¶",
    "server returned": "·þÎñÆ÷·µ»Ø"
});
$(function ()
{
    window.SwaggerTranslator.translate();
    window.SwaggerTranslator.setControllerSummary();
});