Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit aaa94ea

Browse files
committed
locales,templates: translate topics
Update go-saloon/saloon#1.
1 parent 9964816 commit aaa94ea

File tree

5 files changed

+64
-12
lines changed

5 files changed

+64
-12
lines changed

locales/topics.en-us.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
- id: "topic-create"
2+
translation: "Create a new topic"
3+
- id: "topic-title"
4+
translation: "Title"
5+
- id: "topic-content"
6+
translation: "Content"
7+
- id: "topic-publish"
8+
translation: "Publish"
9+
10+
- id: "topic-subscribe"
11+
translation: "Subscribe"
12+
- id: "topic-unsubscribe"
13+
translation: "Unsubscribe"
14+
- id: "topic-delete-msg"
15+
translation: "Delete topic {{.title}} ?"
16+
- id: "topic-delete"
17+
translation: "Delete"
18+
- id: "topic-close"
19+
translation: "Close"
20+
21+
- id: "topic-edit"
22+
translation: "Edit Topic"
23+
- id: "topic-update"
24+
translation: "Update"
25+
- id: "topic-cancel"
26+
translation: "Cancel"

locales/topics.fr-fr.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
- id: "topic-create"
2+
translation: "Créer une nouvelle discussion"
3+
- id: "topic-title"
4+
translation: "Titre"
5+
- id: "topic-content"
6+
translation: "Contenu"
7+
- id: "topic-publish"
8+
translation: "Publier"
9+
10+
- id: "topic-subscribe"
11+
translation: "S'abonner"
12+
- id: "topic-unsubscribe"
13+
translation: "Se désabonner"
14+
- id: "topic-delete-msg"
15+
translation: "Supprimer {{.title}} ?"
16+
- id: "topic-delete"
17+
translation: "Supprimer"
18+
- id: "topic-close"
19+
translation: "Fermer"
20+
21+
- id: "topic-edit"
22+
translation: "Modifer la discussion"
23+
- id: "topic-update"
24+
translation: "Mise à jour"
25+
- id: "topic-cancel"
26+
translation: "Annuler"

templates/topics/create.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@
1515

1616
<div class="row mt-3 justify-content-center">
1717
<div class="col-md-8 col-sm-10">
18-
<h2>Create a new topic</h2>
18+
<h2><%= t("topic-create") %></h2>
1919
<form action="<%= topicsCreatePath({cid: category.ID}) %>" method="POST">
2020
<%= csrf() %>
2121
<div class="form-group">
22-
<label for="title">Title</label>
22+
<label for="title"><%= t("topic-title") %></label>
2323
<input type="text" name="Title" class="form-control" id="title" value="<%= topic.Title %>">
2424
</div>
2525
<div class="form-group">
26-
<label for="content">Content</label>
26+
<label for="content"><%= t("topic-content") %></label>
2727
<textarea class="form-control" name="Content" id="content" rows="20"><%= topic.Content %></textarea>
2828
</div>
29-
<button type="submit" class="btn btn-primary">Publish</button>
29+
<button type="submit" class="btn btn-primary"><%= t("topic-publish") %></button>
3030
</form>
3131
</div>
3232
</div>

templates/topics/detail.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ <h4 class="col-md-2">
88
</h4>
99
<div class="col-md-1 offset-md-7">
1010
<%= if (topic.Subscribed(current_user.ID)) { %>
11-
<a href="<%= topicsRmSubscriberPath({tid: topic.ID}) %>" class="btn btn-secondary btn-sm m-0 fa fa-volume-off"> Unsubscribe</a>
11+
<a href="<%= topicsRmSubscriberPath({tid: topic.ID}) %>" class="btn btn-secondary btn-sm m-0 fa fa-volume-off"> <%= t("topic-unsubscribe") %></a>
1212
<% } else { %>
13-
<a href="<%= topicsAddSubscriberPath({tid: topic.ID}) %>" class="btn btn-secondary btn-sm m-0 fa fa-volume-up"> Subscribe</a>
13+
<a href="<%= topicsAddSubscriberPath({tid: topic.ID}) %>" class="btn btn-secondary btn-sm m-0 fa fa-volume-up"> <%= t("topic-subscribe") %></a>
1414
<% } %>
1515
</div>
1616
</div>
@@ -43,17 +43,17 @@ <h4 class="col-md-2">
4343
<div class="modal-content">
4444
<!-- Modal Header -->
4545
<div class="modal-header">
46-
<h4 class="modal-title">Delete topic <%= topic.Title %> ?</h4>
46+
<h4 class="modal-title"><%= t("topic-delete-msg", {title: topic.Title}) %></h4>
4747
<button type="button" class="close" data-dismiss="modal">&times;</button>
4848
</div>
4949
<!-- Modal -->
5050
<div class="modal-body">
5151
<div class="row">
5252
<div class="col text-left">
53-
<a href="<%= topicsDeletePath({tid: topic.ID}) %>" class="btn btn-danger">Delete</a>
53+
<a href="<%= topicsDeletePath({tid: topic.ID}) %>" class="btn btn-danger"><%= t("topic-delete") %></a>
5454
</div>
5555
<div class="col text-right">
56-
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
56+
<button type="button" class="btn btn-secondary" data-dismiss="modal"><%= t("topic-close") %></button>
5757
</div>
5858
</div>
5959
</div>

templates/topics/edit.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
<div class="row mt-3 justify-content-center">
1717
<div class="col-md-8 col-sm-10">
18-
<h2>Edit Topic</h2>
18+
<h2><%= t("topic-edit") %></h2>
1919
<%= csrf() %>
2020
<div>
2121
<%= form_for(topic, {action: editTopicsPath({ tid: topic.ID }), method: "POST"}) { %>
2222
<%= f.InputTag("Title") %>
2323
<%= f.TextArea("Content", {rows: 20, hide_label: true}) %>
24-
<button class="btn btn-success" role="submit">Update</button>
25-
<a href="<%= topicsDetailPath({ tid: topic.ID }) %>" class="btn btn-warning">Cancel</a>
24+
<button class="btn btn-success" role="submit"><%= t("topic-update") %></button>
25+
<a href="<%= topicsDetailPath({ tid: topic.ID }) %>" class="btn btn-warning"><%= t("topic-cancel") %></a>
2626
<% } %>
2727
</div>
2828
</div>

0 commit comments

Comments
 (0)