|
@@ -12,7 +12,7 @@
|
|
|
{!! Parsedown::instance()->text($endpoint->metadata->description ?: '') !!}
|
|
|
|
|
|
<span id="example-requests-{!! $endpoint->endpointId() !!}">
|
|
|
-<blockquote>Example request:</blockquote>
|
|
|
+<blockquote>{{ __("scribe::example_request") }}:</blockquote>
|
|
|
|
|
|
@foreach($metadata['example_languages'] as $language)
|
|
|
|
|
@@ -27,7 +27,7 @@
|
|
|
@if($endpoint->isGet() || $endpoint->hasResponses())
|
|
|
@foreach($endpoint->responses as $response)
|
|
|
<blockquote>
|
|
|
- <p>Example response ({{ $response->fullDescription() }}):</p>
|
|
|
+ <p>{{ __("scribe::example_response") }} ({{ $response->fullDescription() }}):</p>
|
|
|
</blockquote>
|
|
|
@if(count($response->headers))
|
|
|
<details class="annotation">
|
|
@@ -39,9 +39,9 @@
|
|
|
@endforeach </code></pre></details> @endif
|
|
|
<pre>
|
|
|
@if(is_string($response->content) && Str::startsWith($response->content, "<<binary>>"))
|
|
|
-<code>[Binary data] - {{ htmlentities(str_replace("<<binary>>", "", $response->content)) }}</code>
|
|
|
+<code>{!! __("scribe::example_response.binary") !!} - {{ htmlentities(str_replace("<<binary>>", "", $response->content)) }}</code>
|
|
|
@elseif($response->status == 204)
|
|
|
-<code>[Empty response]</code>
|
|
|
+<code>{!! __("scribe::example_response.empty") !!}</code>
|
|
|
@else
|
|
|
@php($parsed = json_decode($response->content))
|
|
|
{{-- If response is a JSON string, prettify it. Otherwise, just print it --}}
|
|
@@ -51,14 +51,15 @@
|
|
|
@endif
|
|
|
</span>
|
|
|
<span id="execution-results-{{ $endpoint->endpointId() }}" hidden>
|
|
|
- <blockquote>Received response<span
|
|
|
+ <blockquote>{{ __("scribe::try_it_out.received_response") }}<span
|
|
|
id="execution-response-status-{{ $endpoint->endpointId() }}"></span>:
|
|
|
</blockquote>
|
|
|
- <pre class="json"><code id="execution-response-content-{{ $endpoint->endpointId() }}" style="max-height: 400px;"></code></pre>
|
|
|
+ <pre class="json"><code id="execution-response-content-{{ $endpoint->endpointId() }}"
|
|
|
+ data-empty-response-text="<{{ __("scribe::example_response.empty") }}>" style="max-height: 400px;"></code></pre>
|
|
|
</span>
|
|
|
<span id="execution-error-{{ $endpoint->endpointId() }}" hidden>
|
|
|
- <blockquote>Request failed with error:</blockquote>
|
|
|
- <pre><code id="execution-error-message-{{ $endpoint->endpointId() }}"></code></pre>
|
|
|
+ <blockquote>{{ __("scribe::try_it_out.request_failed") }}:</blockquote>
|
|
|
+ <pre><code id="execution-error-message-{{ $endpoint->endpointId() }}">{{ "\n\n".__("scribe::try_it_out.error_help") }}</code></pre>
|
|
|
</span>
|
|
|
<form id="form-{{ $endpoint->endpointId() }}" data-method="{{ $endpoint->httpMethods[0] }}"
|
|
|
data-path="{{ $endpoint->uri }}"
|
|
@@ -68,21 +69,24 @@
|
|
|
autocomplete="off"
|
|
|
onsubmit="event.preventDefault(); executeTryOut('{{ $endpoint->endpointId() }}', this);">
|
|
|
<h3>
|
|
|
- Request
|
|
|
+ {{ __("scribe::endpoint.request") }}
|
|
|
@if($metadata['try_it_out']['enabled'] ?? false)
|
|
|
<button type="button"
|
|
|
style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
id="btn-tryout-{{ $endpoint->endpointId() }}"
|
|
|
- onclick="tryItOut('{{ $endpoint->endpointId() }}');">Try it out ⚡
|
|
|
+ onclick="tryItOut('{{ $endpoint->endpointId() }}');">{{ __("scribe::try_it_out.open") }}
|
|
|
</button>
|
|
|
<button type="button"
|
|
|
style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
id="btn-canceltryout-{{ $endpoint->endpointId() }}"
|
|
|
- onclick="cancelTryOut('{{ $endpoint->endpointId() }}');" hidden>Cancel 🛑
|
|
|
+ onclick="cancelTryOut('{{ $endpoint->endpointId() }}');" hidden>{{ __("scribe::try_it_out.cancel") }}
|
|
|
</button>
|
|
|
<button type="submit"
|
|
|
style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
|
- id="btn-executetryout-{{ $endpoint->endpointId() }}" hidden>Send Request 💥
|
|
|
+ id="btn-executetryout-{{ $endpoint->endpointId() }}"
|
|
|
+ data-initial-text="{{ __("scribe::try_it_out.send") }}"
|
|
|
+ data-loading-text="{{ __("scribe::try_it_out.loading") }}"
|
|
|
+ hidden>{{ __("scribe::try_it_out.send") }}
|
|
|
</button>
|
|
|
@endif
|
|
|
</h3>
|
|
@@ -93,7 +97,7 @@
|
|
|
</p>
|
|
|
@endforeach
|
|
|
@if(count($endpoint->headers))
|
|
|
- <h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
|
+ <h4 class="fancy-heading-panel"><b>{{ __("scribe::endpoint.headers") }}</b></h4>
|
|
|
@foreach($endpoint->headers as $name => $example)
|
|
|
<?php
|
|
|
$htmlOptions = [];
|
|
@@ -118,7 +122,7 @@
|
|
|
@endforeach
|
|
|
@endif
|
|
|
@if(count($endpoint->urlParameters))
|
|
|
- <h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
|
|
|
+ <h4 class="fancy-heading-panel"><b>{{ __("scribe::endpoint.url_parameters") }}</b></h4>
|
|
|
@foreach($endpoint->urlParameters as $attribute => $parameter)
|
|
|
<div style="padding-left: 28px; clear: unset;">
|
|
|
@component('scribe::components.field-details', [
|
|
@@ -136,7 +140,7 @@
|
|
|
@endforeach
|
|
|
@endif
|
|
|
@if(count($endpoint->queryParameters))
|
|
|
- <h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
|
|
|
+ <h4 class="fancy-heading-panel"><b>{{ __("scribe::endpoint.query_parameters") }}</b></h4>
|
|
|
@foreach($endpoint->queryParameters as $attribute => $parameter)
|
|
|
<?php
|
|
|
$htmlOptions = [];
|
|
@@ -161,7 +165,7 @@
|
|
|
@endforeach
|
|
|
@endif
|
|
|
@if(count($endpoint->nestedBodyParameters))
|
|
|
- <h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
|
|
|
+ <h4 class="fancy-heading-panel"><b>{{ __("scribe::endpoint.body_parameters") }}</b></h4>
|
|
|
<x-scribe::nested-fields
|
|
|
:fields="$endpoint->nestedBodyParameters" :endpointId="$endpoint->endpointId()"
|
|
|
/>
|
|
@@ -169,8 +173,8 @@
|
|
|
</form>
|
|
|
|
|
|
@if(count($endpoint->responseFields))
|
|
|
- <h3>Response</h3>
|
|
|
- <h4 class="fancy-heading-panel"><b>Response Fields</b></h4>
|
|
|
+ <h3>{{ __("scribe::endpoint.response") }}</h3>
|
|
|
+ <h4 class="fancy-heading-panel"><b>{{ __("scribe::endpoint.response_fields") }}</b></h4>
|
|
|
<x-scribe::nested-fields
|
|
|
:fields="$endpoint->nestedResponseFields" :endpointId="$endpoint->endpointId()"
|
|
|
:isInput="false"
|