Skip to content

Commit 2bdd21c

Browse files
Copilottakker99
andcommitted
Translate Japanese comments in API files and error types
Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
1 parent 043d152 commit 2bdd21c

File tree

8 files changed

+46
-46
lines changed

8 files changed

+46
-46
lines changed

api/page-data/export/project.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import type { BaseLine, UnixTime } from "../../../base.ts";
22
import type { Page, UserInfo } from "../../pages/project/title.ts";
33

4-
/** exportしたときのページデータ */
4+
/** page data when exported */
55
export interface ExportedPage<hasMetadata extends true | false = false>
66
extends Pick<Page, "title" | "updated" | "created" | "id" | "views"> {
7-
/** ページ本文
7+
/** page content
88
*
9-
* `hasMetadata === true`のときは行のmetadataが入る
10-
* それ以外の場合は行のテキストが入る
9+
* when `hasMetadata === true`, line metadata is included
10+
* otherwise, line text is included
1111
*/
1212
lines: hasMetadata extends true ? Omit<BaseLine, "id">[] : string[];
1313
}
@@ -20,7 +20,7 @@ export interface ExportedData<hasMetadata extends true | false = false> {
2020
/** project's display name */
2121
displayName: string;
2222

23-
/** このデータを生成した日時 (UNIX時刻) */
23+
/** date and time when this data was generated (UNIX time) */
2424
exported: UnixTime;
2525

2626
/** project members */

api/page-data/import/project.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface ImportedData<hasMetadata extends true | false = false> {
66
pages: hasMetadata extends true ? ImportedPage[] : ImportedLightPage[];
77
}
88

9-
/** メタデータ無しインポート用ページデータ */
9+
/** import page data without metadata */
1010
export interface ImportedLightPage {
1111
/** page's title
1212
*
@@ -20,18 +20,18 @@ export interface ImportedLightPage {
2020
*/
2121
lines: string[];
2222
}
23-
/** インポート用メタデータ付き行データ */
23+
/** import line data with metadata */
2424
export interface ImportedLine {
2525
/** line text */
2626
text: string;
2727

28-
/** 行の最終更新日時 (UNIX時刻) */
28+
/** line last update date and time (UNIX time) */
2929
updated?: UnixTime;
3030

31-
/** 行の最終作成日時 (UNIX時刻) */
31+
/** line last creation date and time (UNIX time) */
3232
created?: UnixTime;
3333
}
34-
/** メタデータ付きインポート用ページデータ */
34+
/** import page data with metadata */
3535
export interface ImportedPage {
3636
/** page's title
3737
*

api/page-snapshots/project/pageId/timestampId.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ export interface PageWithSnapshot extends BasePage {
1515

1616
/** a page snapshot */
1717
export interface Snapshot {
18-
/** snapshotを撮ったときのページタイトル */
18+
/** page title when the snapshot was taken */
1919
title: string;
2020

21-
/** snapshotの作成日時 */
21+
/** snapshot creation date and time */
2222
created: UnixTime;
2323

24-
/** snapshotしたページ本文 */
24+
/** page content that was snapshotted */
2525
lines: BaseLine[];
2626
}

api/pages/project.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import type { PageId, UnixTime, UserId } from "../../base.ts";
22

33
/** the response type of https://scrpabox.io/api/pages/:projectname */
44
export interface PageList {
5-
/** data取得先のproject名 */
5+
/** project name from which data was retrieved */
66
projectName: string;
77

8-
/** parameterに渡したskipと同じ */
8+
/** same as skip passed in parameter */
99
skip: number;
1010

11-
/** parameterに渡したlimitと同じ */
11+
/** same as limit passed in parameter */
1212
limit: number;
1313

14-
/** projectの全ページ数 (中身のないページを除く) */
14+
/** total number of pages in the project (excluding pages with no content) */
1515
count: number;
1616

17-
/** 取得できたページ情報 */
17+
/** page information that could be retrieved */
1818
pages: PageSummary[];
1919
}
2020

api/pages/project/search/query.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface SearchResult {
55
/** 検索したprojectの名前 */
66
projectName: string;
77

8-
/** 検索文字列 */
8+
/** search string */
99
searchQuery: string;
1010

1111
/** 検索語句 */
@@ -17,7 +17,7 @@ export interface SearchResult {
1717
/** 検索件数 */
1818
count: number;
1919

20-
/** 検索文字列と完全一致するタイトルが見つかったら`true` */
20+
/** `true` if a title with exact match to the search string is found */
2121
existsExactTitleMatch: boolean;
2222

2323
field: "title" | "helpfeels" | "lines";

api/pages/project/search/watch-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { SearchQuery } from "./query.ts";
33

44
/** the response type of /api/projects/search/query and /api/projects/search/watch-list */
55
export interface ProjectSearchResult {
6-
/** 検索文字列 */
6+
/** search string */
77
searchQuery: string;
88

99
/** 検索語句 */

api/project-backup/project/backupId.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import type { BaseLine, StringLc, UnixTime } from "../../../base.ts";
22
import type { UserForExport } from "../../page-data/export/project.ts";
33
import type { Page } from "../../pages/project/title.ts";
44

5-
/** backupされるページデータ */
5+
/** page data to be backed up */
66
export interface BackupedPage
77
extends Pick<Page, "title" | "updated" | "created" | "id" | "views"> {
8-
/** ページ本文 */
8+
/** page content */
99
lines: Pick<BaseLine, "text" | "created" | "updated" | "userId">[];
1010

11-
/** ページに含まれているリンク*/
11+
/** links contained in the page */
1212
linksLc: StringLc[];
1313
}
1414

@@ -20,7 +20,7 @@ export interface BackupData {
2020
/** project's display name */
2121
displayName: string;
2222

23-
/** このデータを生成した日時 (UNIX時刻) */
23+
/** date and time when this data was generated (UNIX time) */
2424
exported: UnixTime;
2525

2626
/** project members */

error.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/** Scrapbox REST APIが返すエラーの型
1+
/** error types returned by Scrapbox REST API
22
*
3-
* `name`はないことがある
3+
* `name` may not exist
44
*/
55
export interface ErrorLike {
66
/** error name */
@@ -9,35 +9,35 @@ export interface ErrorLike {
99
message: string;
1010
}
1111

12-
/** 参加していないprivate projectに対してAPIを叩いたときに発生するエラー */
12+
/** error that occurs when calling API on a private project you haven't joined */
1313
export interface NotMemberError extends ErrorLike {
1414
/** error name */
1515
name: "NotMemberError";
1616
}
1717

18-
/** 指定したprojectやpageが見つからないときに発生するエラー */
18+
/** error that occurs when the specified project or page is not found */
1919
export interface NotFoundError extends ErrorLike {
2020
/** error name */
2121
name: "NotFoundError";
2222
}
2323

24-
/** owner/admin権限が不足しているときに発生するエラー */
24+
/** error that occurs when owner/admin privileges are insufficient */
2525
export interface NotPrivilegeError extends ErrorLike {
2626
/** error name */
2727
name: "NotPrivilegeError";
2828
}
2929

30-
/** Loginが必要なAPIをloginせずに叩いたときに発生するエラー */
30+
/** error that occurs when calling an API that requires login without being logged in */
3131
export interface NotLoggedInError extends ErrorLike {
3232
/** error name */
3333
name: "NotLoggedInError";
3434

35-
/** 詳細情報 */
35+
/** detailed information */
3636
details: {
37-
/** 取得しようとしたprojectの名前 */
37+
/** name of the project you tried to access */
3838
project: string;
3939

40-
/** 使用できるログイン方法 */
40+
/** available login methods */
4141
loginStrategies: (
4242
| "google"
4343
| "github"
@@ -50,54 +50,54 @@ export interface NotLoggedInError extends ErrorLike {
5050
};
5151
}
5252

53-
/** CSRF tokenが不正なときに発生するエラー */
53+
/** error that occurs when CSRF token is invalid */
5454
export interface SessionError extends ErrorLike {
5555
/** error name */
5656
name: "SessionError";
5757
}
5858

59-
/** 不正なURLを渡したときに返ってくるエラー
59+
/** error returned when passing an invalid URL
6060
*
61-
* 実際のresponseではmessageしか返ってこないことに注意
61+
* note that in actual response, only message is returned
6262
*/
6363
export interface InvalidURLError extends ErrorLike {
6464
/** error name */
6565
name: "InvalidURLError";
6666
}
6767

68-
/** URL先ページから正常な応答が返ってこなかったときのエラー */
68+
/** error when normal response is not returned from the URL destination page */
6969
export interface BadRequestError extends ErrorLike {
7070
/** error name */
7171
name: "BadRequestError";
7272
}
7373

74-
/** 検索文字列を渡さないと出てくるエラー
74+
/** error that appears when you don't pass a search string
7575
*
76-
* 実際のresponseではmessageしか返ってこないことに注意
76+
* note that in actual response, only message is returned
7777
*/
7878
export interface NoQueryError extends ErrorLike {
7979
/** error name */
8080
name: "NoQueryError";
8181
}
82-
/** 不正なfollowingIdを渡されたときに発生するエラー
82+
/** error that occurs when an invalid followingId is passed
8383
*
84-
* 実際のresponseではmessageしか返ってこないことに注意
84+
* note that in actual response, only message is returned
8585
*/
8686
export interface InvalidFollowingIdError extends ErrorLike {
8787
name: "InvalidFollowingIdError";
8888
}
8989

90-
/** 容量を使い切ったときに発生するerror
90+
/** error that occurs when capacity is exhausted
9191
*
92-
* 実際のresponseではmessageしか返ってこないことに注意
92+
* note that in actual response, only message is returned
9393
*/
9494
export interface FileCapacityError extends ErrorLike {
9595
name: "FileCapacityError";
9696
}
9797

98-
/** Google Cloud Storage XML APIのerror
98+
/** Google Cloud Storage XML API error
9999
*
100-
* `message`には[この形式](https://cloud.google.com/storage/docs/xml-api/reference-status#http-status-and-error-codes)のXMLが入る
100+
* `message` contains XML in [this format](https://cloud.google.com/storage/docs/xml-api/reference-status#http-status-and-error-codes)
101101
*/
102102
export interface GCSError extends ErrorLike {
103103
name: "GCSError";

0 commit comments

Comments
 (0)