loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(i18n): use translate key as fallback (#6702)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6702
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>

Otto bd6864fe ff3f12a3

+4 -3
+1
modules/translation/i18n/i18n_test.go
··· 158 158 159 159 found := lang1.HasKey("no-such") 160 160 assert.False(t, found) 161 + assert.EqualValues(t, "no-such", lang1.TrString("no-such")) 161 162 require.NoError(t, ls.Close()) 162 163 } 163 164
+3 -3
modules/translation/i18n/localestore.go
··· 225 225 format = msg 226 226 } else { 227 227 // First fallback: old-style translation 228 - idx, ok := l.store.trKeyToIdxMap[trKey] 228 + idx, foundIndex := l.store.trKeyToIdxMap[trKey] 229 229 found := false 230 - if ok { 230 + if foundIndex { 231 231 if msg, ok := l.idxToMsgMap[idx]; ok { 232 232 format = msg // use the found translation 233 233 found = true ··· 239 239 if defaultLang, ok := l.store.localeMap[l.store.defaultLang]; ok { 240 240 if msg := defaultLang.LookupNewStyleMessage(trKey); msg != "" { 241 241 format = msg 242 - } else { 242 + } else if foundIndex { 243 243 // Third fallback: old-style default language 244 244 if msg, ok := defaultLang.idxToMsgMap[idx]; ok { 245 245 format = msg