From 34d21f6bc20648edc2033a57a9f5995af0df891c Mon Sep 17 00:00:00 2001
From: Earl Warren <contact@earl-warren.org>
Date: Sun, 21 Jan 2024 19:35:58 +0000
Subject: [PATCH] [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)
---
 modules/translation/i18n/localestore.go | 5 ++++-
 options/locale/locale_cs-CZ.ini         | 1 +
 options/locale/locale_de-DE.ini         | 1 +
 options/locale/locale_el-GR.ini         | 1 +
 options/locale/locale_en-US.ini         | 1 +
 options/locale/locale_es-ES.ini         | 1 +
 options/locale/locale_fa-IR.ini         | 1 +
 options/locale/locale_fi-FI.ini         | 1 +
 options/locale/locale_fr-FR.ini         | 1 +
 options/locale/locale_hu-HU.ini         | 1 +
 options/locale/locale_id-ID.ini         | 1 +
 options/locale/locale_is-IS.ini         | 1 +
 options/locale/locale_it-IT.ini         | 1 +
 options/locale/locale_ja-JP.ini         | 1 +
 options/locale/locale_ko-KR.ini         | 1 +
 options/locale/locale_lv-LV.ini         | 1 +
 options/locale/locale_nl-NL.ini         | 1 +
 options/locale/locale_pl-PL.ini         | 1 +
 options/locale/locale_pt-BR.ini         | 1 +
 options/locale/locale_pt-PT.ini         | 1 +
 options/locale/locale_ru-RU.ini         | 1 +
 options/locale/locale_si-LK.ini         | 1 +
 options/locale/locale_sk-SK.ini         | 1 +
 options/locale/locale_sv-SE.ini         | 1 +
 options/locale/locale_tr-TR.ini         | 1 +
 options/locale/locale_uk-UA.ini         | 1 +
 options/locale/locale_zh-CN.ini         | 1 +
 options/locale/locale_zh-HK.ini         | 1 +
 options/locale/locale_zh-TW.ini         | 1 +
 29 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/modules/translation/i18n/localestore.go b/modules/translation/i18n/localestore.go
index f5a951a79f..42b95dda54 100644
--- a/modules/translation/i18n/localestore.go
+++ b/modules/translation/i18n/localestore.go
@@ -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()
diff --git a/options/locale/locale_cs-CZ.ini b/options/locale/locale_cs-CZ.ini
index 8384f65e57..72473a8860 100644
--- a/options/locale/locale_cs-CZ.ini
+++ b/options/locale/locale_cs-CZ.ini
@@ -1,3 +1,4 @@
+[common]
 home=Domů
 dashboard=Přehled
 explore=Procházet
diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini
index 6494ff5f8a..ff9020cffa 100644
--- a/options/locale/locale_de-DE.ini
+++ b/options/locale/locale_de-DE.ini
@@ -1,3 +1,4 @@
+[common]
 home=Startseite
 dashboard=Übersicht
 explore=Erkunden
diff --git a/options/locale/locale_el-GR.ini b/options/locale/locale_el-GR.ini
index b75479c575..2af215ae41 100644
--- a/options/locale/locale_el-GR.ini
+++ b/options/locale/locale_el-GR.ini
@@ -1,3 +1,4 @@
+[common]
 home=Αρχική
 dashboard=Κεντρικός Πίνακας
 explore=Εξερεύνηση
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 6f75f4d0de..9cd2d11230 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -1,3 +1,4 @@
+[common]
 home = Home
 dashboard = Dashboard
 explore = Explore
diff --git a/options/locale/locale_es-ES.ini b/options/locale/locale_es-ES.ini
index 6b5fd6e318..4f50a1304f 100644
--- a/options/locale/locale_es-ES.ini
+++ b/options/locale/locale_es-ES.ini
@@ -1,3 +1,4 @@
+[common]
 home=Inicio
 dashboard=Panel de control
 explore=Explorar
diff --git a/options/locale/locale_fa-IR.ini b/options/locale/locale_fa-IR.ini
index c2a06ec357..fb3da145c6 100644
--- a/options/locale/locale_fa-IR.ini
+++ b/options/locale/locale_fa-IR.ini
@@ -1,3 +1,4 @@
+[common]
 home=خانه
 dashboard=میز کار
 explore=گشت‌و‌گذار
diff --git a/options/locale/locale_fi-FI.ini b/options/locale/locale_fi-FI.ini
index 3c81b8f1b0..15db7998ec 100644
--- a/options/locale/locale_fi-FI.ini
+++ b/options/locale/locale_fi-FI.ini
@@ -1,3 +1,4 @@
+[common]
 home=Etusivu
 dashboard=Kojelauta
 explore=Tutki
diff --git a/options/locale/locale_fr-FR.ini b/options/locale/locale_fr-FR.ini
index 6ae02fde42..8d64df99fd 100644
--- a/options/locale/locale_fr-FR.ini
+++ b/options/locale/locale_fr-FR.ini
@@ -1,3 +1,4 @@
+[common]
 home=Accueil
 dashboard=Tableau de bord
 explore=Explorateur
diff --git a/options/locale/locale_hu-HU.ini b/options/locale/locale_hu-HU.ini
index 19501da0af..5ecf6ebf1e 100644
--- a/options/locale/locale_hu-HU.ini
+++ b/options/locale/locale_hu-HU.ini
@@ -1,3 +1,4 @@
+[common]
 home=Főoldal
 dashboard=Műszerfal
 explore=Felfedezés
diff --git a/options/locale/locale_id-ID.ini b/options/locale/locale_id-ID.ini
index c78f8262f8..853ffde451 100644
--- a/options/locale/locale_id-ID.ini
+++ b/options/locale/locale_id-ID.ini
@@ -1,3 +1,4 @@
+[common]
 home=Beranda
 dashboard=Dasbor
 explore=Jelajahi
diff --git a/options/locale/locale_is-IS.ini b/options/locale/locale_is-IS.ini
index b54ec6249b..b50c18d6f8 100644
--- a/options/locale/locale_is-IS.ini
+++ b/options/locale/locale_is-IS.ini
@@ -1,3 +1,4 @@
+[common]
 home=Forsíða
 dashboard=Stjórnborð
 explore=Vafra
diff --git a/options/locale/locale_it-IT.ini b/options/locale/locale_it-IT.ini
index 9b24653f58..82e089111f 100644
--- a/options/locale/locale_it-IT.ini
+++ b/options/locale/locale_it-IT.ini
@@ -1,3 +1,4 @@
+[common]
 home=Home
 dashboard=Pannello di controllo
 explore=Esplora
diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini
index cbfbfc982f..2bb8f67c83 100644
--- a/options/locale/locale_ja-JP.ini
+++ b/options/locale/locale_ja-JP.ini
@@ -1,3 +1,4 @@
+[common]
 home=ホーム
 dashboard=ダッシュボード
 explore=エクスプローラー
diff --git a/options/locale/locale_ko-KR.ini b/options/locale/locale_ko-KR.ini
index b9245e9352..a64094e7da 100644
--- a/options/locale/locale_ko-KR.ini
+++ b/options/locale/locale_ko-KR.ini
@@ -1,3 +1,4 @@
+[common]
 home=홈
 dashboard=대시보드
 explore=탐색
diff --git a/options/locale/locale_lv-LV.ini b/options/locale/locale_lv-LV.ini
index 9c8dce5282..9d2f6484dc 100644
--- a/options/locale/locale_lv-LV.ini
+++ b/options/locale/locale_lv-LV.ini
@@ -1,3 +1,4 @@
+[common]
 home=Sākums
 dashboard=Infopanelis
 explore=Izpētīt
diff --git a/options/locale/locale_nl-NL.ini b/options/locale/locale_nl-NL.ini
index f86e6383e3..4e0f3ff30e 100644
--- a/options/locale/locale_nl-NL.ini
+++ b/options/locale/locale_nl-NL.ini
@@ -1,3 +1,4 @@
+[common]
 home=Beginscherm
 dashboard=Overzicht
 explore=Verkennen
diff --git a/options/locale/locale_pl-PL.ini b/options/locale/locale_pl-PL.ini
index 48ea51b2cb..e3a65a3d66 100644
--- a/options/locale/locale_pl-PL.ini
+++ b/options/locale/locale_pl-PL.ini
@@ -1,3 +1,4 @@
+[common]
 home=Strona główna
 dashboard=Pulpit
 explore=Odkrywaj
diff --git a/options/locale/locale_pt-BR.ini b/options/locale/locale_pt-BR.ini
index fc53a027b7..6e74c80186 100644
--- a/options/locale/locale_pt-BR.ini
+++ b/options/locale/locale_pt-BR.ini
@@ -1,3 +1,4 @@
+[common]
 home=Inicio
 dashboard=Painel
 explore=Explorar
diff --git a/options/locale/locale_pt-PT.ini b/options/locale/locale_pt-PT.ini
index 3ef7a22100..bf0e624502 100644
--- a/options/locale/locale_pt-PT.ini
+++ b/options/locale/locale_pt-PT.ini
@@ -1,3 +1,4 @@
+[common]
 home=Página inicial
 dashboard=Painel de controlo
 explore=Explorar
diff --git a/options/locale/locale_ru-RU.ini b/options/locale/locale_ru-RU.ini
index f42b081e85..918023dc11 100644
--- a/options/locale/locale_ru-RU.ini
+++ b/options/locale/locale_ru-RU.ini
@@ -1,3 +1,4 @@
+[common]
 home=Главная
 dashboard=Панель управления
 explore=Обзор
diff --git a/options/locale/locale_si-LK.ini b/options/locale/locale_si-LK.ini
index e06aab67f0..dc6e7c336f 100644
--- a/options/locale/locale_si-LK.ini
+++ b/options/locale/locale_si-LK.ini
@@ -1,3 +1,4 @@
+[common]
 home=මුල් පිටුව
 dashboard=උපකරණ පුවරුව
 explore=ගවේෂණය
diff --git a/options/locale/locale_sk-SK.ini b/options/locale/locale_sk-SK.ini
index 1c3c8f770b..85e0b2b93d 100644
--- a/options/locale/locale_sk-SK.ini
+++ b/options/locale/locale_sk-SK.ini
@@ -1,3 +1,4 @@
+[common]
 home=Domov
 dashboard=Nástenka
 explore=Preskúmať
diff --git a/options/locale/locale_sv-SE.ini b/options/locale/locale_sv-SE.ini
index 36d052138b..8eb27d2d6b 100644
--- a/options/locale/locale_sv-SE.ini
+++ b/options/locale/locale_sv-SE.ini
@@ -1,3 +1,4 @@
+[common]
 home=Startsida
 dashboard=Instrumentpanel
 explore=Utforska
diff --git a/options/locale/locale_tr-TR.ini b/options/locale/locale_tr-TR.ini
index 1443cb018b..59a71e9e42 100644
--- a/options/locale/locale_tr-TR.ini
+++ b/options/locale/locale_tr-TR.ini
@@ -1,3 +1,4 @@
+[common]
 home=Ana Sayfa
 dashboard=Pano
 explore=Keşfet
diff --git a/options/locale/locale_uk-UA.ini b/options/locale/locale_uk-UA.ini
index ffda1087a3..57620b4f00 100644
--- a/options/locale/locale_uk-UA.ini
+++ b/options/locale/locale_uk-UA.ini
@@ -1,3 +1,4 @@
+[common]
 home=Головна
 dashboard=Панель управління
 explore=Огляд
diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini
index 724d22132c..0ac03b6f63 100644
--- a/options/locale/locale_zh-CN.ini
+++ b/options/locale/locale_zh-CN.ini
@@ -1,3 +1,4 @@
+[common]
 home=首页
 dashboard=首页
 explore=探索
diff --git a/options/locale/locale_zh-HK.ini b/options/locale/locale_zh-HK.ini
index 8c888ed492..b00c6e6b3d 100644
--- a/options/locale/locale_zh-HK.ini
+++ b/options/locale/locale_zh-HK.ini
@@ -1,3 +1,4 @@
+[common]
 home=首頁
 dashboard=控制面版
 explore=探索
diff --git a/options/locale/locale_zh-TW.ini b/options/locale/locale_zh-TW.ini
index faefc52479..ada647bff5 100644
--- a/options/locale/locale_zh-TW.ini
+++ b/options/locale/locale_zh-TW.ini
@@ -1,3 +1,4 @@
+[common]
 home=首頁
 dashboard=資訊主頁
 explore=探索