-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext-mapping.yml
More file actions
232 lines (209 loc) · 6.1 KB
/
context-mapping.yml
File metadata and controls
232 lines (209 loc) · 6.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# context-mapping.yml
# コンテキストマッピング設定ファイル
# このファイルではコンテキストごとにどのHTML要素に適用するかを定義します
# 基本設定
settings:
# 未知のコンテキストの処理方法
# "ignore": 未知のコンテキストは翻訳しない
# "apply": 未知のコンテキストは全ての要素に適用する
unknown_context: "ignore"
# コンテキストなし(空文字列)の処理方法
# "global": すべての要素に適用する(グローバル翻訳)
# "ignore": コンテキストなしは翻訳しない
empty_context: "global"
# コンテキストマッピング定義
contexts:
# メインナビゲーション
"メインナビゲーション":
selectors:
- ".AppHeader-globalBar a"
- ".header-nav-item"
- ".HeaderMenu-link"
- ".header-menu-wrapper a"
- ".ActionListItem-label"
description: "ヘッダー部分のナビゲーションメニュー"
# リポジトリタブ
"リポジトリタブ":
selectors:
- ".UnderlineNav-item"
- ".js-selected-navigation-item"
- ".reponav-item"
- ".pagehead-tabs-item"
- "[data-tab-item]"
description: "リポジトリページのタブメニュー"
# アクションタブ
"アクションタブ":
selectors:
- ".tabnav-tab[href*='/actions']"
- ".js-selected-navigation-item[href*='/actions']"
- ".subnav-item[href*='/actions']"
parent_context: "リポジトリタブ"
description: "アクションページのタブメニュー"
# プロジェクトタブ
"プロジェクトタブ":
selectors:
- ".tabnav-tab[href*='/projects']"
- ".js-selected-navigation-item[href*='/projects']"
- ".subnav-item[href*='/projects']"
parent_context: "リポジトリタブ"
description: "プロジェクトページのタブメニュー"
# プロフィール
"プロフィール":
selectors:
- ".js-profile-editable-area"
- ".user-profile-nav"
- ".UnderlineNav-item[href*='/tab/']"
- ".js-user-profile-sticky-bar"
- ".profile-rollup-wrapper"
description: "ユーザープロフィールページの要素"
# ボタン
"ボタン":
selectors:
- "button"
- ".btn"
- "[role='button']"
- "summary.btn"
- ".Button"
- ".prc-Button-Label-pTQ3x"
exclude_selectors:
- ".btn[data-content]" # data-content属性を持つボタンは除外
description: "各種ボタン要素"
# 特殊要素
"特殊要素":
selectors:
- "[data-content]"
- "span[data-content]"
- ".h4.mb-2"
- "h2.h4"
- "h2.f4"
- ".Link--primary"
- ".ActionListItem-label"
- "[data-view-component=true]"
description: "特別な処理が必要なUI要素"
# 課題表示
"課題表示":
selectors:
- ".issues-listing"
- ".js-issue-row"
- ".js-navigation-container[aria-label='Issues']"
- ".gh-header-meta"
- ".js-comment-container"
description: "Issue関連の表示"
# ラベル
"ラベル":
selectors:
- ".labels"
- ".IssueLabel"
- ".label-select-menu-item"
- ".labels-list-item"
parent_context: "課題表示"
description: "ラベル表示テキスト"
# 検索条件
"検索条件":
selectors:
- ".filter-item"
- ".SelectMenu-item[data-filter-value]"
- ".select-menu-item[data-filter-value]"
- ".SelectMenu-title"
- ".select-menu-title"
description: "検索フィルター関連"
# コード
"コード":
selectors:
- ".repository-content"
- ".file-navigation"
- ".Box-header"
- ".commit-tease"
- ".Box-row"
- ".k0kWgo"
- "h2.prc-Heading-Heading-6CmGO"
exclude_selectors:
- "pre"
- "code"
- ".highlight"
- ".blob-code"
- ".js-file-line"
description: "コードビュー関連(コード自体は翻訳しない)"
# コミット数
"コミット数":
selectors:
- ".commits"
- ".commit-tease-contributors"
- ".num.text-emphasized"
parent_context: "コード"
description: "コミット数表示"
# ファイルメニュー
"ファイルメニュー":
selectors:
- ".BtnGroup-item"
- ".dropdown-menu-content"
- ".file-actions"
parent_context: "コード"
description: "ファイル操作メニュー"
# 日時表示
"日時表示":
selectors:
- "relative-time"
- ".timestamp"
- "time-ago"
- "time"
description: "日付や時間の表示形式"
# 文字列
"文字列":
selectors:
- ".blankslate"
- ".Box-header-title"
- ".text-gray"
- ".text-emphasized"
description: "一般的なテキスト"
# 正規表現パターン用のコンテキスト
regex_contexts:
# 課題表示のパターン
"課題表示":
apply_to:
- ".js-issue-title"
- ".js-issue-row"
- ".issue-link"
- ".gh-header-title"
# 課題リファレンス
"課題リファレンス":
apply_to:
- ".comment-body"
- ".markdown-body"
- ".timeline-comment-body"
- ".commit-message"
exclude:
- "pre"
- "code"
# プロフィールページ
"プロフィールページ":
apply_to:
- ".js-profile-editable-area"
- ".js-user-profile-bio"
- ".contribution-activity-listing"
# プルリクエスト
"プルリクエスト":
apply_to:
- ".subnav-item"
- ".tabnav-tab"
- ".blankslate"
- ".Box-header-title"
# コード
"コード":
apply_to:
- ".repository-meta"
- ".repo-stats"
- ".file-navigation"
exclude:
- "pre"
- "code"
- ".highlight"
# フッター
"フッター":
selectors:
- ".Link--secondary.Link"
- "footer a" # フッター内のすべてのリンク
- "[data-analytics-event*='Footer']" # Footerカテゴリーのイベント属性を持つ要素
- ".footer-links a"
- ".footer a"
description: "フッター要素"