1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

Make repo size style matches others (commits/branches/tags) (#24408)

The "unit" part shouldn't have bold style.
This commit is contained in:
wxiaoguang
2023-04-29 05:23:19 +08:00
committed by GitHub
parent bc784a705b
commit bc4e06109d
4 changed files with 20 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/modules/options"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/translation/i18n"
"code.gitea.io/gitea/modules/util"
"golang.org/x/text/language"
"golang.org/x/text/message"
@@ -241,5 +242,12 @@ func (l *locale) TrN(cnt any, key1, keyN string, args ...any) string {
func (l *locale) PrettyNumber(v any) string {
// TODO: this mechanism is not good enough, the complete solution is to switch the translation system to ICU message format
if s, ok := v.(string); ok {
if num, err := util.ToInt64(s); err == nil {
v = num
} else if num, err := util.ToFloat64(s); err == nil {
v = num
}
}
return l.msgPrinter.Sprintf("%v", number.Decimal(v))
}