Browse Source

Make strings translatable (#1188) (#1198)

* Add strings to ini

* Make strings translatable (#1188)
Patrick G 2 years ago
parent
commit
ccc15b9e1a
2 changed files with 8 additions and 7 deletions
  1. 3 0
      options/locale/locale_en-US.ini
  2. 5 7
      templates/repo/settings/branches.tmpl

+ 3 - 0
options/locale/locale_en-US.ini

@@ -837,6 +837,9 @@ settings.add_protected_branch_failed= %s Locked failed
837 837
 settings.remove_protected_branch_success=%s Unlocked successfully
838 838
 settings.protected_branch_deletion=To delete a protected branch
839 839
 settings.protected_branch_deletion_desc=Anyone with write permissions will be able to push directly to this branch. Are you sure?
840
+settings.default_branch_desc = The default branch is considered the "base" branch in your repository against which all pull requests and code commits are automatically made, unless you specify a different branch.
841
+settings.choose_branch = Choose a branch...
842
+settings.no_protected_branch = There are no protected branches
840 843
 
841 844
 diff.browse_source = Browse Source
842 845
 diff.parent = parent

+ 5 - 7
templates/repo/settings/branches.tmpl

@@ -14,9 +14,7 @@
14 14
 						{{.CsrfTokenHtml}}
15 15
 						<input type="hidden" name="action" value="default_branch">
16 16
 						<div class="item">
17
-							The default branch is considered the "base" branch in your repository,
18
-							against which all pull requests and code commits are automatically made,
19
-							unless you specify a different branch.
17
+							{{.i18n.Tr "settings.default_branch_desc"}}
20 18
 						</div>
21 19
 						{{if not .Repository.IsBare}}
22 20
 						<div class="ui grid padded">
@@ -53,11 +51,11 @@
53 51
 							<div class="ui fluid dropdown selection visible" tabindex="0">
54 52
 								<select id="protectedBranch" name="branch" data-url="{{.Repository.Link}}/settings/branches?action=protected_branch">
55 53
 									{{range .LeftBranches}}
56
-										<option value="">Choose a branch...</option>
54
+										<option value="">{{.i18n.Tr "settings.choose_branch"}}</option>
57 55
 										<option value="{{.}}">{{.}}</option>
58 56
 									{{end}}
59 57
 								</select><i class="dropdown icon"></i>
60
-								<div class="default text">Choose a branch...</div>
58
+								<div class="default text">{{.i18n.Tr "settings.choose_branch"}}</div>
61 59
 								<div class="menu transition hidden" tabindex="-1" style="display: block !important;">
62 60
 									{{range .LeftBranches}}
63 61
 										<div class="item" data-value="{{.}}">{{.}}</div>
@@ -77,7 +75,7 @@
77 75
 											<td class="right aligned"><button class="rm ui red button" data-url="{{$.Repository.Link}}/settings/branches?action=protected_branch&id={{.ID}}" data-val="{{.BranchName}}">Delete</button></td>
78 76
 										</tr>
79 77
 									{{else}}
80
-										<tr class="center aligned"><td>There is no protected branch</td></tr>
78
+										<tr class="center aligned"><td>{{.i18n.Tr "settings.no_protected_branch"}}</td></tr>
81 79
 									{{end}}
82 80
 								</tbody>
83 81
 							</table>
@@ -88,4 +86,4 @@
88 86
 		</div>
89 87
 	</div>
90 88
 </div>
91
-{{template "base/footer" .}}
89
+{{template "base/footer" .}}