[I18N] Allow custom repo size format

Following https://codeberg.org/forgejo/forgejo/pulls/2528#issuecomment-1721846

- simplify the code
- allow to have custom format in translations
- provide proper Russian translation because test depends on it
This commit is contained in:
0ko 2024-04-02 18:43:12 +05:00
parent 7e575603ee
commit 2f38c2220f
4 changed files with 6 additions and 11 deletions

View file

@ -87,7 +87,7 @@ func TestDataSizeTranslation(t *testing.T) {
fullSize, exists := repo.Attr("data-tooltip-content")
assert.True(t, exists)
fullSize = noDigits.ReplaceAllString(fullSize, "")
assert.Equal(t, "git: КиБ, lfs: Б", fullSize)
assert.Equal(t, "git: КиБ; lfs: Б", fullSize)
// Check if file sizes are correclty translated
testFileSizeTranslated(t, session, path.Join(testUser, testRepoName, "src/branch/main/137byteFile.txt"), "137 Б")