[I18N] add [common] as first line

To keep weblate happy as it would otherwise be duplicating the content
to all sections.

See https://github.com/WeblateOrg/weblate/issues/10831 for more information.

(cherry picked from commit 5ffc10a00e1ceb24755894e981d3d26d654b4b7e)
(cherry picked from commit 96d10e793b72e39656cc0df02272c7dd7632964c)
This commit is contained in:
Earl Warren 2024-01-21 19:35:58 +00:00
parent 20b5ca1e6c
commit 34d21f6bc2
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
29 changed files with 32 additions and 1 deletions

View file

@ -54,7 +54,10 @@ func (store *localeStore) AddLocaleByIni(langName, langDesc string, source, more
for _, section := range iniFile.Sections() {
for _, key := range section.Keys() {
var trKey string
if section.Name() == "" || section.Name() == "DEFAULT" {
// see https://codeberg.org/forgejo/discussions/issues/104
// https://github.com/WeblateOrg/weblate/issues/10831
// for an explanation of why "common" is an alternative
if section.Name() == "" || section.Name() == "DEFAULT" || section.Name() == "common" {
trKey = key.Name()
} else {
trKey = section.Name() + "." + key.Name()