@@ -9,13 +9,13 @@ import React from "react";
99
1010import { useDoc } from "@docusaurus/plugin-content-docs/client" ;
1111import { usePrismTheme } from "@docusaurus/theme-common" ;
12- import { translate } from "@docusaurus/Translate" ;
12+ import Translate , { translate } from "@docusaurus/Translate" ;
1313import useDocusaurusContext from "@docusaurus/useDocusaurusContext" ;
1414import ApiCodeBlock from "@theme/ApiExplorer/ApiCodeBlock" ;
1515import { useTypedDispatch , useTypedSelector } from "@theme/ApiItem/hooks" ;
1616import SchemaTabs from "@theme/SchemaTabs" ;
1717import TabItem from "@theme/TabItem" ;
18- import { OPENAPI_RESPONSE } from "@theme/translationIds" ;
18+ import { OPENAPI_REQUEST , OPENAPI_RESPONSE } from "@theme/translationIds" ;
1919import clsx from "clsx" ;
2020import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types" ;
2121import type { ThemeConfig } from "docusaurus-theme-openapi-docs/src/types" ;
@@ -126,11 +126,22 @@ function Response({ item }: { item: ApiItem }) {
126126 >
127127 { prettyResponse || (
128128 < p className = "openapi-explorer__response-placeholder-message" >
129- { translate ( {
130- id : OPENAPI_RESPONSE . PLACEHOLDER ,
131- message :
132- "Click the <code>Send API Request</code> button above and see the response here!" ,
133- } ) }
129+ < Translate
130+ id = { OPENAPI_RESPONSE . PLACEHOLDER }
131+ values = { {
132+ code : (
133+ < code >
134+ < Translate id = { OPENAPI_REQUEST . SEND_BUTTON } >
135+ Send API Request
136+ </ Translate >
137+ </ code >
138+ ) ,
139+ } }
140+ >
141+ {
142+ "Click the {code} button above and see the response here!"
143+ }
144+ </ Translate >
134145 </ p >
135146 ) }
136147 </ ApiCodeBlock >
@@ -163,11 +174,20 @@ function Response({ item }: { item: ApiItem }) {
163174 </ div >
164175 ) : (
165176 < p className = "openapi-explorer__response-placeholder-message" >
166- { translate ( {
167- id : OPENAPI_RESPONSE . PLACEHOLDER ,
168- message :
169- "Click the <code>Send API Request</code> button above and see the response here!" ,
170- } ) }
177+ < Translate
178+ id = { OPENAPI_RESPONSE . PLACEHOLDER }
179+ values = { {
180+ code : (
181+ < code >
182+ < Translate id = { OPENAPI_REQUEST . SEND_BUTTON } >
183+ Send API Request
184+ </ Translate >
185+ </ code >
186+ ) ,
187+ } }
188+ >
189+ { "Click the {code} button above and see the response here!" }
190+ </ Translate >
171191 </ p >
172192 ) }
173193 </ div >
0 commit comments