🎨 Bazaar i18n

This commit is contained in:
Liang Ding 2023-05-09 09:12:29 +08:00
parent eb91448934
commit b3e85eb567
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
8 changed files with 27 additions and 19 deletions

View file

@ -142,13 +142,14 @@ func InstalledIcons() (ret []*Icon) {
installSize, _ := util.SizeOfDirectory(installPath)
icon.InstallSize = installSize
icon.HInstallSize = humanize.Bytes(uint64(installSize))
readme, readErr := os.ReadFile(filepath.Join(installPath, "README.md"))
readmeFilename := getPreferredReadme(icon.Readme)
readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename))
if nil != readErr {
logging.LogWarnf("read install icon README.md failed: %s", readErr)
logging.LogWarnf("read installed README.md failed: %s", readErr)
continue
}
icon.README, _ = renderREADME(icon.URL, readme)
icon.PreferredReadme, _ = renderREADME(icon.URL, readme)
icon.Outdated = isOutdatedIcon(icon, bazaarIcons)
ret = append(ret, icon)
}