Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localize N/A #24427

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ enable_javascript = This website requires JavaScript.
toc = Table of Contents
licenses = Licenses
return_to_gitea = Return to Gitea
abbr_not_available = N/A

username = Username
email = Email Address
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/cron.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<td>{{$.locale.Tr (printf "admin.dashboard.%s" .Name)}}</td>
<td>{{.Spec}}</td>
<td>{{DateTime "full" .Next}}</td>
<td>{{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}N/A{{end}}</td>
<td>{{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}{{$.locale.Tr "abbr_not_available"}}{{end}}</td>
<td>{{.ExecTimes}}</td>
<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>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/pulls/tab_menu.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.Issue.Link}}/commits"{{end}}>
{{svg "octicon-git-commit"}}
{{$.locale.Tr "repo.pulls.tab_commits"}}
<span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}N/A{{end}}</span>
<span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}{{$.locale.Tr "abbr_not_available"}}{{end}}</span>
</a>
<a class="item {{if .PageIsPullFiles}}active{{end}}" {{if .NumFiles}}href="{{.Issue.Link}}/files"{{end}}>
{{svg "octicon-diff"}}
{{$.locale.Tr "repo.pulls.tab_files"}}
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}N/A{{end}}</span>
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}{{$.locale.Tr "abbr_not_available"}}{{end}}</span>
</a>
</div>
2 changes: 1 addition & 1 deletion templates/repo/settings/protected_branch.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
</td>
</tr>
{{else}}
<tr><td>N/A</td></tr>
<tr><td>{{$.locale.Tr "abbr_not_available"}}</td></tr>
{{end}}
</tbody>
</table>
Expand Down
6 changes: 3 additions & 3 deletions templates/repo/settings/webhook/history.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<span class="ui red label">{{.ResponseInfo.Status}}</span>
{{end}}
{{else}}
<span class="ui label">N/A</span>
<span class="ui label">{{$.locale.Tr "abbr_not_available"}}</span>
{{end}}
</a>
{{if or $.Permission.IsAdmin $.IsOrganizationOwner $.PageIsAdmin $.PageIsUserSettings}}
Expand All @@ -59,7 +59,7 @@
<h5>{{$.locale.Tr "repo.settings.webhook.payload"}}</h5>
<pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre>
{{else}}
N/A
{{$.locale.Tr "abbr_not_available"}}
{{end}}
</div>
<div class="ui bottom attached tab segment" data-tab="response-{{.ID}}">
Expand All @@ -70,7 +70,7 @@
<h5>{{$.locale.Tr "repo.settings.webhook.body"}}</h5>
<pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre>
{{else}}
N/A
{{$.locale.Tr "abbr_not_available"}}
{{end}}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions web_src/js/features/repo-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function initRepoSettingsCollaboration() {
if ($item) {
$dropdown.dropdown('set selected', $dropdown.attr('data-last-value'));
} else {
// TODO: should use the localized key "abbr_not_available"
$text.text('(N/A)'); // prevent from misleading users when the access mode is undefined
}
}, 0);
Expand Down