Skip to content

Commit da079e1

Browse files
docs: translate Japanese comments to English
- Translated all Japanese comments to English in text.ts, title.ts, and other files - Improved documentation clarity for library users - Maintained technical accuracy in translations - No functional changes to code
1 parent 71460ef commit da079e1

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

title.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
/** 文字列をtitleLc形式に変換する
1+
/** Convert a string to titleLc format
22
*
3-
* - ` ` -> `_`
3+
* - Converts spaces (` `) to underscores (`_`)
44
*
5-
* - 大文字 -> 小文字
5+
* - Converts uppercase to lowercase
66
*
7-
* リンクの等値比較をする際に主に使われる
7+
* Primarily used for comparing links for equality
88
*
9-
* @param text 変換する文字列
10-
* @return 変換後の文字列
9+
* @param text String to convert
10+
* @return Converted string
1111
*/
1212
export const toTitleLc = (text: string): string =>
1313
text.replaceAll(" ", "_").toLowerCase();
1414

15-
/** `_`を半角スペースに変換する
15+
/** Convert underscores (`_`) to single-byte spaces
1616
*
17-
* @param text 変換する文字列
18-
* @return 変換後の文字列
17+
* @param text String to convert
18+
* @return Converted string
1919
*/
2020
export const revertTitleLc = (text: string): string =>
2121
text.replaceAll("_", " ");
2222

23-
/** titleをURIで使える形式にEncodeする
23+
/** Encode a title into a URI-safe format
2424
*
25-
* @param title 変換するtitle
26-
* @return 変換後の文字列
25+
* @param title Title to encode
26+
* @return Encoded string
2727
*/
2828
export const encodeTitleURI = (title: string): string => {
2929
return [...title].map((char, index) => {
@@ -41,10 +41,10 @@ export const encodeTitleURI = (title: string): string => {
4141
const noEncodeChars = '@$&+=:;",';
4242
const noTailChars = ':;",';
4343

44-
/** titleをできるだけpercent encodingせずにURIで使える形式にする
44+
/** Convert a title to a URI-safe format while minimizing percent encoding
4545
*
46-
* @param title 変換するtitle
47-
* @return 変換後の文字列
46+
* @param title Title to convert
47+
* @return URI-safe string with minimal percent encoding
4848
*/
4949
export const toReadableTitleURI = (title: string): string => {
5050
return title.replaceAll(" ", "_")

0 commit comments

Comments
 (0)