Fix localization texts that contain semicolon (#2900)

This commit is contained in:
Lauris BH 2017-11-13 09:56:10 +02:00 committed by GitHub
parent 4725f91543
commit 134958fd9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -160,6 +160,10 @@ func NewFuncMap() []template.FuncMap {
return setting.DisableGitHooks
},
"TrN": TrN,
// TODO: Remove this once go-ini parser supports unescaping comment characters
"UnescapeLocale": func(str string) string {
return strings.NewReplacer("\\;", ";", "\\#", "#").Replace(str)
},
}}
}

View File

@ -627,8 +627,8 @@ issues.label_templates.info = There are not any labels yet. You can click on the
issues.label_templates.helper = Select a label set
issues.label_templates.use = Use this label set
issues.label_templates.fail_to_load_file = Failed to load label template file '%s': %v
issues.add_label_at = `added the <div class="ui label" style="color: %s; background-color: %s">%s</div> label %s`
issues.remove_label_at = `removed the <div class="ui label" style="color: %s; background-color: %s">%s</div> label %s`
issues.add_label_at = `added the <div class="ui label" style="color: %s\; background-color: %s">%s</div> label %s`
issues.remove_label_at = `removed the <div class="ui label" style="color: %s\; background-color: %s">%s</div> label %s`
issues.add_milestone_at = `added this to the <b>%s</b> milestone %s`
issues.change_milestone_at = `modified the milestone from <b>%s</b> to <b>%s</b> %s`
issues.remove_milestone_at = `removed this from the <b>%s</b> milestone %s`

View File

@ -96,7 +96,7 @@
<img src="{{.Poster.RelAvatarLink}}">
</a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
{{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color .Label.Name $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color .Label.Name $createdStr | Safe}}{{end}}</span>
{{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color .Label.Name $createdStr | UnescapeLocale | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color .Label.Name $createdStr | UnescapeLocale | Safe}}{{end}}</span>
</div>
{{end}}
{{else if eq .Type 8}}