mirror of
https://github.com/go-gitea/gitea
synced 2025-08-21 17:08:27 +00:00
Only en-US has complete translations. When use other language as default, the en-US should still be used as fallback. Backport #21200, Close #21199
This commit is contained in:
@@ -41,14 +41,14 @@ func NewLocaleStore() *LocaleStore {
|
||||
}
|
||||
|
||||
// AddLocaleByIni adds locale by ini into the store
|
||||
func (ls *LocaleStore) AddLocaleByIni(langName, langDesc string, localeFile interface{}, otherLocaleFiles ...interface{}) error {
|
||||
func (ls *LocaleStore) AddLocaleByIni(langName, langDesc string, source, moreSource []byte) error {
|
||||
if _, ok := ls.localeMap[langName]; ok {
|
||||
return ErrLocaleAlreadyExist
|
||||
}
|
||||
iniFile, err := ini.LoadSources(ini.LoadOptions{
|
||||
IgnoreInlineComment: true,
|
||||
UnescapeValueCommentSymbols: true,
|
||||
}, localeFile, otherLocaleFiles...)
|
||||
}, source, moreSource)
|
||||
if err == nil {
|
||||
iniFile.BlockMode = false
|
||||
lc := &locale{store: ls, langName: langName, langDesc: langDesc, messages: iniFile}
|
||||
|
Reference in New Issue
Block a user