fix(ui): hardcode sort options in search syntax hint, improve look (#11381)
Followup to https://codeberg.org/forgejo/forgejo/pulls/9109 Fix issue reported by @mahlzahn that the string was confusing translators and they translated the part that wasn't meant to be translated. Part of this fix was to replace custom IterWithTr with simple dict iteration to allow for placeholders in strings. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11381 Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org> Reviewed-by: Ellen Εμιλία Άννα Zscheile <fogti@noreply.codeberg.org>
This commit is contained in:
@@ -7,7 +7,6 @@ package translation
|
||||
import (
|
||||
"context"
|
||||
"html/template"
|
||||
"iter"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -329,16 +328,6 @@ func (l *locale) PrettyNumber(v any) string {
|
||||
return l.msgPrinter.Sprintf("%v", number.Decimal(v))
|
||||
}
|
||||
|
||||
func (l *locale) IterWithTr(kvs ...string) iter.Seq2[string, template.HTML] {
|
||||
return func(yield func(string, template.HTML) bool) {
|
||||
for i := 0; i < len(kvs); i += 2 {
|
||||
if !yield(kvs[i], l.TrHTML(kvs[i+1])) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func GetPluralRule(l Locale) int {
|
||||
return GetPluralRuleImpl(l.Language())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user