Skip to content

Commit 9d8ccc4

Browse files
committed
Merge pull request #1254 from swagger-api/develop_2.0
Merged from develop_2.0
2 parents 6f1b9b6 + 5640bf7 commit 9d8ccc4

29 files changed

+738
-254
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ swaggerUi.api.clientAuthorizations.add("key", new SwaggerClient.ApiKeyAuthorizat
131131
Note! You can pass multiple header params on a single request, just use unique names for them (`key` is used in the above example).
132132

133133
### Localization and translation
134-
The localization files are in the dist/lang directory.
134+
The localization files are in the [lang](/lang) directory. Note that language files and translator is not included in SwaggerUI by default. You need to add them manually.
135135

136136
To enable translation you should append next two lines in your Swagger's index.html (or another entry point you use)
137137
```html

dist/css/print.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@
274274
font-weight: bold;
275275
font-size: 25px;
276276
}
277+
.swagger-section .swagger-ui-wrap .footer {
278+
margin-top: 20px;
279+
}
277280
.swagger-section .swagger-ui-wrap p.big,
278281
.swagger-section .swagger-ui-wrap div.big p {
279282
font-size: 1em;

dist/css/screen.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@
274274
font-weight: bold;
275275
font-size: 25px;
276276
}
277+
.swagger-section .swagger-ui-wrap .footer {
278+
margin-top: 20px;
279+
}
277280
.swagger-section .swagger-ui-wrap p.big,
278281
.swagger-section .swagger-ui-wrap div.big p {
279282
font-size: 1em;

dist/index.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<script src='swagger-ui.js' type='text/javascript'></script>
2020
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
2121
<script src='lib/marked.js' type='text/javascript'></script>
22+
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
2223

2324
<script type="text/javascript">
2425
$(function () {
@@ -34,13 +35,11 @@
3435
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
3536
onComplete: function(swaggerApi, swaggerUi){
3637
if(typeof initOAuth == "function") {
37-
/*
3838
initOAuth({
3939
clientId: "your-client-id",
4040
realm: "your-realms",
4141
appName: "your-app-name"
4242
});
43-
*/
4443
}
4544

4645
$('pre code').each(function(i, e) {
@@ -71,7 +70,6 @@
7170
/*
7271
var apiKey = "myApiKeyXXXX123456789";
7372
$('#input_apiKey').val(apiKey);
74-
addApiKeyAuthorization();
7573
*/
7674

7775
window.swaggerUi.load();

dist/lib/swagger-oauth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,4 @@ window.onOAuthComplete = function onOAuthComplete(token) {
281281
}
282282
}
283283
}
284-
}
284+
}

dist/swagger-ui.js

Lines changed: 431 additions & 199 deletions
Large diffs are not rendered by default.

dist/swagger-ui.min.js

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var connect = require('gulp-connect');
1515
var header = require('gulp-header');
1616
var pkg = require('./package.json');
1717
var order = require('gulp-order');
18+
var jshint = require('gulp-jshint');
1819
var banner = ['/**',
1920
' * <%= pkg.name %> - <%= pkg.description %>',
2021
' * @version v<%= pkg.version %>',
@@ -48,10 +49,19 @@ function templates() {
4849
.on('error', log);
4950
}
5051

52+
/**
53+
* JShint all *.js files
54+
*/
55+
gulp.task('lint', function () {
56+
return gulp.src('./src/main/javascript/**/*.js')
57+
.pipe(jshint())
58+
.pipe(jshint.reporter('jshint-stylish'));
59+
});
60+
5161
/**
5262
* Build a distribution
5363
*/
54-
gulp.task('dist', ['clean'], function() {
64+
gulp.task('dist', ['clean','lint'], function() {
5565

5666
return es.merge(
5767
gulp.src([

lang/en.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
'use strict';
2+
3+
/* jshint quotmark: double */
4+
window.SwaggerTranslator.learn({
5+
"Warning: Deprecated":"Warning: Deprecated",
6+
"Implementation Notes":"Implementation Notes",
7+
"Response Class":"Response Class",
8+
"Status":"Status",
9+
"Parameters":"Parameters",
10+
"Parameter":"Parameter",
11+
"Value":"Value",
12+
"Description":"Description",
13+
"Parameter Type":"Parameter Type",
14+
"Data Type":"Data Type",
15+
"Response Messages":"Response Messages",
16+
"HTTP Status Code":"HTTP Status Code",
17+
"Reason":"Reason",
18+
"Response Model":"Response Model",
19+
"Request URL":"Request URL",
20+
"Response Body":"Response Body",
21+
"Response Code":"Response Code",
22+
"Response Headers":"Response Headers",
23+
"Hide Response":"Hide Response",
24+
"Try it out!":"Try it out!",
25+
"Show/Hide":"Show/Hide",
26+
"List Operations":"List Operations",
27+
"Expand Operations":"Expand Operations",
28+
"Raw":"Raw",
29+
"can't parse JSON. Raw result":"can't parse JSON. Raw result",
30+
"Model Schema":"Model Schema",
31+
"Model":"Model",
32+
"apply":"apply",
33+
"Username":"Username",
34+
"Password":"Password",
35+
"Terms of service":"Terms of service",
36+
"Created by":"Created by",
37+
"See more at":"See more at",
38+
"Contact the developer":"Contact the developer",
39+
"api version":"api version",
40+
"Response Content Type":"Response Content Type",
41+
"fetching resource":"fetching resource",
42+
"fetching resource list":"fetching resource list",
43+
"Explore":"Explore",
44+
"Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
45+
"Show Wordnik Developer Apis":"Show Wordnik Developer Apis",
46+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.",
47+
"Please specify the protocol for":"Please specify the protocol for",
48+
"Can't read swagger JSON from":"Can't read swagger JSON from",
49+
"Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI",
50+
"Unable to read api":"Unable to read api",
51+
"from path":"from path",
52+
"server returned":"server returned"
53+
});

lang/ru.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
'use strict';
2+
3+
/* jshint quotmark: double */
4+
window.SwaggerTranslator.learn({
5+
"Warning: Deprecated":"Ворнинг: Депрекейтед",
6+
"Implementation Notes":"Заметки",
7+
"Response Class":"Пример ответа",
8+
"Status":"Статус",
9+
"Parameters":"Параметры",
10+
"Parameter":"Параметр",
11+
"Value":"Значение",
12+
"Description":"Описание",
13+
"Parameter Type":"Тип параметра",
14+
"Data Type":"Тип данных",
15+
"HTTP Status Code":"HTTP код",
16+
"Reason":"Причина",
17+
"Response Model":"Структура ответа",
18+
"Request URL":"URL запроса",
19+
"Response Body":"Тело ответа",
20+
"Response Code":"HTTP код ответа",
21+
"Response Headers":"Заголовки ответа",
22+
"Hide Response":"Спрятать ответ",
23+
"Response Messages":"Что может прийти в ответ",
24+
"Try it out!":"Попробовать!",
25+
"Show/Hide":"Показать/Скрыть",
26+
"List Operations":"Операции кратко",
27+
"Expand Operations":"Операции подробно",
28+
"Raw":"В сыром виде",
29+
"can't parse JSON. Raw result":"Не удается распарсить ответ:",
30+
"Model Schema":"Структура",
31+
"Model":"Описание",
32+
"apply":"применить",
33+
"Username":"Имя пользователя",
34+
"Password":"Пароль",
35+
"Terms of service":"Условия использования",
36+
"Created by":"Разработано",
37+
"See more at":"Еще тут",
38+
"Contact the developer":"Связаться с разработчиком",
39+
"api version":"Версия API",
40+
"Response Content Type":"Content Type ответа",
41+
"fetching resource":"Получение ресурса",
42+
"fetching resource list":"Получение ресурсов",
43+
"Explore":"Поехали",
44+
"Show Swagger Petstore Example Apis":"Показать примеры АПИ",
45+
"Show Wordnik Developer Apis":"Показать АПИ Wordnik Developer",
46+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, какая-то лажа с настройками доступа",
47+
"Please specify the protocol for":"Пожалуйста, укажите протогол для",
48+
"Can't read swagger JSON from":"Не получается прочитать swagger json из",
49+
"Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим",
50+
"Unable to read api":"Не удалось прочитать api",
51+
"from path":"по адресу",
52+
"server returned":"сервер сказал"
53+
});

0 commit comments

Comments
 (0)