Action posts can now be localised.

Tweaked the updating instructions.
This commit is contained in:
Azareal 2018-10-27 14:55:53 +10:00
parent ffe06afb1b
commit f5a0e3386b
3 changed files with 15 additions and 7 deletions

View File

@ -62,6 +62,6 @@ Once you've done that, you just need to run `./Patcher` to apply the latest patc
Dependencies are third party scripts and programs which Gosora relies on to function. The instructions here do not cover updating MySQL / MariaDB or Go.
You can update themn by running `update-deps.bat` on Windows or `./update-deps-linux` on Linux.
You can update them by running the `go get` command.
You'll need to restart the server after you change a template or update Gosora, e.g. with `run.bat` or killing the process and running `./run-linux` or via `./pre-run-linux` followed by `service gosora restart`.

View File

@ -599,6 +599,13 @@
"topic.reply_add_poll_button":"Add Poll",
"topic.reply_add_file_button":"Add File",
"topic.action_topic_lock":"This topic was locked by <a href='%s'>%s</a>",
"topic.action_topic_unlock":"This topic was reopened by <a href='%s'>%s</a>",
"topic.action_topic_stick":"This topic was pinned by <a href='%s'>%s</a>",
"topic.action_topic_unstick":"This topic was unpinned by <a href='%s'>%s</a>",
"topic.action_topic_move":"This topic was moved by <a href='%s'>%s</a>",
"topic.action_topic_default":"%s has happened",
"topic.your_information":"Your information",
"paginator_less_than":"&lt;",

View File

@ -162,21 +162,22 @@ func ViewTopic(w http.ResponseWriter, r *http.Request, user common.User, urlBit
if replyItem.ActionType != "" {
switch replyItem.ActionType {
case "lock":
replyItem.ActionType = "This topic was locked by <a href='" + replyItem.UserLink + "'>" + replyItem.CreatedByName + "</a>"
replyItem.ActionType = common.GetTmplPhrasef("topic.action_topic_lock",replyItem.UserLink,replyItem.CreatedByName)
replyItem.ActionIcon = "&#x1F512;&#xFE0E"
case "unlock":
replyItem.ActionType = "This topic was reopened by <a href='" + replyItem.UserLink + "'>" + replyItem.CreatedByName + "</a>"
replyItem.ActionType = common.GetTmplPhrasef("topic.action_topic_unlock",replyItem.UserLink,replyItem.CreatedByName)
replyItem.ActionIcon = "&#x1F513;&#xFE0E"
case "stick":
replyItem.ActionType = "This topic was pinned by <a href='" + replyItem.UserLink + "'>" + replyItem.CreatedByName + "</a>"
replyItem.ActionType = common.GetTmplPhrasef("topic.action_topic_stick",replyItem.UserLink,replyItem.CreatedByName)
replyItem.ActionIcon = "&#x1F4CC;&#xFE0E"
case "unstick":
replyItem.ActionType = "This topic was unpinned by <a href='" + replyItem.UserLink + "'>" + replyItem.CreatedByName + "</a>"
replyItem.ActionType = common.GetTmplPhrasef("topic.action_topic_unstick",replyItem.UserLink,replyItem.CreatedByName)
replyItem.ActionIcon = "&#x1F4CC;&#xFE0E"
case "move":
replyItem.ActionType = "This topic was moved by <a href='" + replyItem.UserLink + "'>" + replyItem.CreatedByName + "</a>"
replyItem.ActionType = common.GetTmplPhrasef("topic.action_topic_move",replyItem.UserLink,replyItem.CreatedByName)
// TODO: Only fire this off if a corresponding phrase for the ActionType doesn't exist? Or maybe have some sort of action registry?
default:
replyItem.ActionType = replyItem.ActionType + " has happened"
replyItem.ActionType = common.GetTmplPhrasef("topic.action_topic_default",replyItem.ActionType)
replyItem.ActionIcon = ""
}
}