Skip to content

Commit d6f8238

Browse files
authored
Replace N/A with - everywhere (#24474)
Followup to #24427. Reasoning is that `N/A` is specific to english while `-` is language-neutral and does not need translation. Before: <img width="891" alt="Screenshot 2023-05-01 at 20 58 20" src="https://user-images.githubusercontent.com/115237/235511592-8a36d0f2-34ff-4dbe-b642-67c0ade644fe.png"> After: <img width="901" alt="Screenshot 2023-05-01 at 20 59 59" src="https://user-images.githubusercontent.com/115237/235511594-d49f6d09-92e8-4e99-be7b-2a37f5d24129.png">
1 parent df00cca commit d6f8238

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

docs/content/doc/usage/linked-references.en-us.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -178,28 +178,28 @@ In the examples, `User1/Repo1` refers to the repository where the reference is u
178178

179179
| Reference in User1/Repo1 | Repo1 issues are external | RepoZ issues are external | Should render |
180180
| --------------------------- | :-----------------------: | :-----------------------: | ------------------------------------------------------- |
181-
| `#1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` |
182-
| `!1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` |
183-
| `#1234` | yes | N/A | A link to _external issue_ 1234 for `User1/Repo1` |
184-
| `!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` |
185-
| `User1/Repo1#1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` |
186-
| `User1/Repo1!1234` | no | N/A | A link to issue/pull 1234 in `User1/Repo1` |
187-
| `User1/Repo1#1234` | yes | N/A | A link to _external issue_ 1234 for `User1/Repo1` |
188-
| `User1/Repo1!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` |
189-
| `UserZ/RepoZ#1234` | N/A | no | A link to issue/pull 1234 in `UserZ/RepoZ` |
190-
| `UserZ/RepoZ!1234` | N/A | no | A link to issue/pull 1234 in `UserZ/RepoZ` |
191-
| `UserZ/RepoZ#1234` | N/A | yes | A link to _external issue_ 1234 for `UserZ/RepoZ` |
192-
| `UserZ/RepoZ!1234` | N/A | yes | A link to _PR_ 1234 for `UserZ/RepoZ` |
181+
| `#1234` | no | - | A link to issue/pull 1234 in `User1/Repo1` |
182+
| `!1234` | no | - | A link to issue/pull 1234 in `User1/Repo1` |
183+
| `#1234` | yes | - | A link to _external issue_ 1234 for `User1/Repo1` |
184+
| `!1234` | yes | - | A link to _PR_ 1234 for `User1/Repo1` |
185+
| `User1/Repo1#1234` | no | - | A link to issue/pull 1234 in `User1/Repo1` |
186+
| `User1/Repo1!1234` | no | - | A link to issue/pull 1234 in `User1/Repo1` |
187+
| `User1/Repo1#1234` | yes | - | A link to _external issue_ 1234 for `User1/Repo1` |
188+
| `User1/Repo1!1234` | yes | - | A link to _PR_ 1234 for `User1/Repo1` |
189+
| `UserZ/RepoZ#1234` | - | no | A link to issue/pull 1234 in `UserZ/RepoZ` |
190+
| `UserZ/RepoZ!1234` | - | no | A link to issue/pull 1234 in `UserZ/RepoZ` |
191+
| `UserZ/RepoZ#1234` | - | yes | A link to _external issue_ 1234 for `UserZ/RepoZ` |
192+
| `UserZ/RepoZ!1234` | - | yes | A link to _PR_ 1234 for `UserZ/RepoZ` |
193193
| **Alphanumeric issue IDs:** | - | - | - |
194-
| `AAA-1234` | yes | N/A | A link to _external issue_ `AAA-1234` for `User1/Repo1` |
195-
| `!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` |
196-
| `User1/Repo1!1234` | yes | N/A | A link to _PR_ 1234 for `User1/Repo1` |
197-
| _Not supported_ | N/A | yes | A link to _external issue_ `AAA-1234` for `UserZ/RepoZ` |
198-
| `UserZ/RepoZ!1234` | N/A | yes | A link to _PR_ 1234 in `UserZ/RepoZ` |
194+
| `AAA-1234` | yes | - | A link to _external issue_ `AAA-1234` for `User1/Repo1` |
195+
| `!1234` | yes | - | A link to _PR_ 1234 for `User1/Repo1` |
196+
| `User1/Repo1!1234` | yes | - | A link to _PR_ 1234 for `User1/Repo1` |
197+
| _Not supported_ | - | yes | A link to _external issue_ `AAA-1234` for `UserZ/RepoZ` |
198+
| `UserZ/RepoZ!1234` | - | yes | A link to _PR_ 1234 in `UserZ/RepoZ` |
199199

200200
_The last section is for repositories with external issue trackers that use alphanumeric format._
201201

202-
_**N/A**: not applicable._
202+
_**-**: not applicable._
203203

204204
Note: automatic references between repositories with different types of issues (external vs. internal) are not fully supported
205205
and may render invalid links.

modules/timeutil/datetime.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ func DateTime(format string, datetime any) template.HTML {
3030
var datetimeEscaped, textEscaped string
3131
switch v := datetime.(type) {
3232
case nil:
33-
return "N/A"
33+
return "-"
3434
case string:
3535
datetimeEscaped = html.EscapeString(v)
3636
textEscaped = datetimeEscaped
3737
case time.Time:
3838
if v.IsZero() || v.Unix() == 0 {
39-
return "N/A"
39+
return "-"
4040
}
4141
datetimeEscaped = html.EscapeString(v.Format(time.RFC3339))
4242
if format == "full" {

modules/timeutil/datetime_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ func TestDateTime(t *testing.T) {
2323
refTime, _ := time.Parse(time.RFC3339, refTimeStr)
2424
refTimeStamp := TimeStamp(refTime.Unix())
2525

26-
assert.EqualValues(t, "N/A", DateTime("short", nil))
27-
assert.EqualValues(t, "N/A", DateTime("short", 0))
28-
assert.EqualValues(t, "N/A", DateTime("short", time.Time{}))
29-
assert.EqualValues(t, "N/A", DateTime("short", TimeStamp(0)))
26+
assert.EqualValues(t, "-", DateTime("short", nil))
27+
assert.EqualValues(t, "-", DateTime("short", 0))
28+
assert.EqualValues(t, "-", DateTime("short", time.Time{}))
29+
assert.EqualValues(t, "-", DateTime("short", TimeStamp(0)))
3030

3131
actual := DateTime("short", "invalid")
3232
assert.EqualValues(t, `<relative-time format="datetime" year="numeric" month="short" day="numeric" weekday="" datetime="invalid">invalid</relative-time>`, actual)

templates/admin/cron.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<td>{{$.locale.Tr (printf "admin.dashboard.%s" .Name)}}</td>
2323
<td>{{.Spec}}</td>
2424
<td>{{DateTime "full" .Next}}</td>
25-
<td>{{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}N/A{{end}}</td>
25+
<td>{{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}-{{end}}</td>
2626
<td>{{.ExecTimes}}</td>
2727
<td {{if ne .Status ""}}data-tooltip-content="{{.FormatLastMessage $.locale}}"{{end}} >{{if eq .Status ""}}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td>
2828
</tr>

templates/repo/pulls/tab_menu.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.Issue.Link}}/commits"{{end}}>
88
{{svg "octicon-git-commit"}}
99
{{$.locale.Tr "repo.pulls.tab_commits"}}
10-
<span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}N/A{{end}}</span>
10+
<span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}-{{end}}</span>
1111
</a>
1212
<a class="item {{if .PageIsPullFiles}}active{{end}}" {{if .NumFiles}}href="{{.Issue.Link}}/files"{{end}}>
1313
{{svg "octicon-diff"}}
1414
{{$.locale.Tr "repo.pulls.tab_files"}}
15-
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}N/A{{end}}</span>
15+
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
1616
</a>
1717
</div>

templates/repo/settings/protected_branch.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
</td>
175175
</tr>
176176
{{else}}
177-
<tr><td>N/A</td></tr>
177+
<tr><td>-</td></tr>
178178
{{end}}
179179
</tbody>
180180
</table>

templates/repo/settings/webhook/history.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<span class="ui red label">{{.ResponseInfo.Status}}</span>
3838
{{end}}
3939
{{else}}
40-
<span class="ui label">N/A</span>
40+
<span class="ui label">-</span>
4141
{{end}}
4242
</a>
4343
{{if or $.Permission.IsAdmin $.IsOrganizationOwner $.PageIsAdmin $.PageIsUserSettings}}
@@ -59,7 +59,7 @@
5959
<h5>{{$.locale.Tr "repo.settings.webhook.payload"}}</h5>
6060
<pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre>
6161
{{else}}
62-
N/A
62+
-
6363
{{end}}
6464
</div>
6565
<div class="ui bottom attached tab segment" data-tab="response-{{.ID}}">
@@ -70,7 +70,7 @@
7070
<h5>{{$.locale.Tr "repo.settings.webhook.body"}}</h5>
7171
<pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre>
7272
{{else}}
73-
N/A
73+
-
7474
{{end}}
7575
</div>
7676
</div>

web_src/js/features/repo-settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function initRepoSettingsCollaboration() {
3232
if ($item) {
3333
$dropdown.dropdown('set selected', $dropdown.attr('data-last-value'));
3434
} else {
35-
$text.text('(N/A)'); // prevent from misleading users when the access mode is undefined
35+
$text.text('(none)'); // prevent from misleading users when the access mode is undefined
3636
}
3737
}, 0);
3838
}

0 commit comments

Comments
 (0)