@@ -22,6 +22,8 @@ import { APIPageContext } from "./context";
22
22
import { PontUIService } from "../../service/UIService" ;
23
23
import ApiResponseDoc from "./APIDocument/ApiResponseDoc" ;
24
24
import Searcher from "../common/Searcher" ;
25
+ import I18N from "../../utils/I18N" ;
26
+ import { TableI18N } from "../../utils/utils" ;
25
27
26
28
export class APIProps {
27
29
selectedApi ?: PontSpec . PontAPI ;
@@ -48,6 +50,7 @@ export const API: React.FC<APIProps> = (props) => {
48
50
const initValue = React . useMemo ( ( ) => {
49
51
return {
50
52
schemas : definitions as any ,
53
+ I18N : new TableI18N ( ) ,
51
54
getRefSchema : getSchema ,
52
55
renderTypeColAppendix : ( node : any ) => {
53
56
if ( node ?. nodeValue ?. schema . in ) {
@@ -72,7 +75,7 @@ export const API: React.FC<APIProps> = (props) => {
72
75
return (
73
76
< tr >
74
77
< td colSpan = { 2 } style = { { padding : "15px 0" , textAlign : "center" } } >
75
- 无出参定义
78
+ { I18N . ide . main . common . noOutputParameterDefinition }
76
79
</ td >
77
80
</ tr >
78
81
) ;
@@ -122,9 +125,9 @@ export const API: React.FC<APIProps> = (props) => {
122
125
} ) ;
123
126
124
127
const tabs = [
125
- { tab : "文档" , key : "doc" } ,
126
- { tab : "调试" , key : "debug" } ,
127
- { tab : "代码示例" , key : "sdk" } ,
128
+ { tab : I18N . ide . main . home . document , key : "doc" } ,
129
+ { tab : I18N . ide . main . explorer . debug , key : "debug" } ,
130
+ { tab : I18N . ide . main . common . codeSample , key : "sdk" } ,
128
131
] ;
129
132
130
133
const [ pageEl , resizeObserverEntry ] = useResizeObserver ( ) ;
@@ -142,13 +145,13 @@ export const API: React.FC<APIProps> = (props) => {
142
145
) : null }
143
146
< div className = "mb-4 bg-[var(--vscode-editor-background)]" >
144
147
< div className = "border-t border-gray-100 px-5 py-4 text-base font-medium text-[var(--vscode-foreground)]" >
145
- 请求参数
148
+ { I18N . ide . main . explorer . requestParameter }
146
149
</ div >
147
150
< ApiParamsDoc parameters = { selectedApi ?. parameters } apiName = { selectedApi ?. name } schemas = { definitions as any } />
148
151
</ div >
149
152
< div className = "mb-4 bg-[var(--vscode-editor-background)]" >
150
153
< div className = "border-t border-gray-100 px-5 py-4 text-base font-medium text-[var(--vscode-foreground)]" >
151
- 出参
154
+ { I18N . ide . main . explorer . response }
152
155
</ div >
153
156
< ApiResponseDoc selectedApi = { selectedApi } > </ ApiResponseDoc >
154
157
</ div >
@@ -172,17 +175,17 @@ export const API: React.FC<APIProps> = (props) => {
172
175
changeMode ( key ) ;
173
176
} }
174
177
>
175
- < Tab . Item key = "debug-doc" title = "API 文档" >
178
+ < Tab . Item key = "debug-doc" title = { I18N . ide . main . notFound . APIDoc } >
176
179
< div className = "grid h-[calc(100vh_-_177px)] w-full bg-[var(--vscode-editor-background)]" >
177
180
< div className = "scrollbar-custom overflow-scroll" > { documentComp } </ div >
178
181
</ div >
179
182
</ Tab . Item >
180
- < Tab . Item key = "sdk" title = "示例代码" >
183
+ < Tab . Item key = "sdk" title = { I18N . ide . main . common . codeSample } >
181
184
< div className = "content" >
182
185
< TrySDK isExpand = { isExpand } > </ TrySDK >
183
186
</ div >
184
187
</ Tab . Item >
185
- < Tab . Item key = "debug" title = "调试结果" >
188
+ < Tab . Item key = "debug" title = { I18N . ide . main . common . debugResult } >
186
189
< div className = "content" >
187
190
< TryAPI > </ TryAPI >
188
191
</ div >
@@ -206,13 +209,15 @@ export const API: React.FC<APIProps> = (props) => {
206
209
207
210
const openNotification = ( ) => {
208
211
notification . open ( {
209
- message : "体验调研" ,
212
+ message : I18N . ide . main . common . experienceResearch ,
210
213
duration : null ,
211
214
description : (
212
215
< span >
213
- 您对插件的使用体验满意吗?点击
214
- < a href = "https://g.alicdn.com/aes/tracker-survey-preview/0.0.13/survey.html?pid=fePxMy& id = 3486 " > 体验问卷</ a >
215
- 进行吐槽或夸赞,您的反馈对我们十分重要!
216
+ { I18N . ide . main . common . noSatisfiedToClick }
217
+ < a href = "https://g.alicdn.com/aes/tracker-survey-preview/0.0.13/survey.html?pid=fePxMy& id = 3486 " >
218
+ { I18N . ide . main . common . experienceQuestionnaire }
219
+ </ a >
220
+ { I18N . ide . main . common . feedbackIsImportant }
216
221
</ span >
217
222
) ,
218
223
onClose : ( ) => {
0 commit comments