Skip to content

Commit c04bc31

Browse files
docs: translate comments to English in rest/replaceLinks.ts and improve link replacement documentation
1 parent bf32855 commit c04bc31

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

rest/replaceLinks.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ export type ReplaceLinksError =
2222
| NotMemberError
2323
| HTTPError;
2424

25-
/** 指定したproject内の全てのリンクを書き換える
25+
/** Replaces all links within the specified project
2626
*
27-
* リンクと同一のタイトルは書き換わらないので注意
28-
* - タイトルも書き換えたいときは/browser/mod.tsの`patch()`などで書き換えること
27+
* Important: This function only replaces links, not page titles.
28+
* - If you need to replace page titles as well, use `patch()` from /browser/mod.ts
2929
*
30-
* @param project これで指定したproject内の全てのリンクが置換対象となる
31-
* @param from 置換前のリンク
32-
* @param to 置換後のリンク
33-
* @param init connect.sidなど
34-
* @return 置換されたリンクがあったページの数
30+
* @param project The project name where all links will be replaced
31+
* @param from The original link text to be replaced
32+
* @param to The new link text to replace with
33+
* @param init Options including connect.sid (session ID) and other configuration
34+
* @return The number of pages where links were replaced
3535
*/
3636
export const replaceLinks = async (
3737
project: string,
@@ -71,7 +71,7 @@ export const replaceLinks = async (
7171
])) ?? error,
7272
),
7373
async (res) => {
74-
// messageには"2 pages have been successfully updated!"というような文字列が入っているはず
74+
// message should contain a string like "2 pages have been successfully updated!"
7575
const { message } = (await res.json()) as { message: string };
7676
return parseInt(message.match(/\d+/)?.[0] ?? "0");
7777
},

0 commit comments

Comments
 (0)