From f9a07bcadd0e9bae90720dbb18533de77193a1ff Mon Sep 17 00:00:00 2001 From: Burer Date: Mon, 2 Mar 2026 11:09:15 +0000 Subject: [PATCH] rework and update banner on main page (#11) Refactor banner code to be more universal, and updated it's content to GSoC 2026. image.png Reviewed-on: https://git.kolibrios.org/KolibriOS/kolibrios.org/pulls/11 Reviewed-by: Gleb Zaharov Co-authored-by: Burer Co-committed-by: Burer --- configs/banner.ini | 3 ++ locales/de.ini | 7 ++-- locales/en.ini | 7 ++-- locales/es.ini | 7 ++-- locales/fr.ini | 7 ++-- locales/it.ini | 8 ++--- locales/nl.ini | 7 ++-- locales/ru.ini | 7 ++-- locales/zh-Hans.ini | 7 ++-- locales/zh-Hant.ini | 7 ++-- modules/configs.py | 50 +++++++++++++++++++++++++++++ modules/locales.py | 9 ++++++ static/img/{ => banners}/gitea.png | Bin static/img/banners/gsoc.png | Bin 0 -> 6879 bytes static/style.scss | 33 ++++++++++++------- templates/index.html | 2 +- templates/tmpl/_banner.htm | 17 ++++++++++ templates/tmpl/_git.htm | 19 ----------- 18 files changed, 138 insertions(+), 59 deletions(-) create mode 100644 configs/banner.ini create mode 100644 modules/configs.py rename static/img/{ => banners}/gitea.png (100%) create mode 100644 static/img/banners/gsoc.png create mode 100644 templates/tmpl/_banner.htm delete mode 100644 templates/tmpl/_git.htm diff --git a/configs/banner.ini b/configs/banner.ini new file mode 100644 index 0000000..4c1d396 --- /dev/null +++ b/configs/banner.ini @@ -0,0 +1,3 @@ +[banner] +url = https://summerofcode.withgoogle.com/programs/2026/organizations/kolibrios-project-team +img = gsoc.png diff --git a/locales/de.ini b/locales/de.ini index 5d547c9..fb0528b 100644 --- a/locales/de.ini +++ b/locales/de.ini @@ -14,9 +14,10 @@ forum = Forum wiki = Wiki git = Git -[git] -header = KolibriOS ist zu Git gewechselt! -text = Schau dir unsere neue entwicklerfreundliche Infrastruktur an +[banner] +header = KolibriOS wurde zu GSoC 2026 angenommen! +text = Informieren Sie sich über Programmdetails und unsere Projektideen +alt = GSoC [article] p1 = {kolibrios} ist ein winziges, aber unglaublich leistungsfähiges und diff --git a/locales/en.ini b/locales/en.ini index 99f2650..ad72b91 100644 --- a/locales/en.ini +++ b/locales/en.ini @@ -14,9 +14,10 @@ forum = Forum wiki = Wiki git = Git -[git] -header = KolibriOS moved to Git! -text = Check our new developers-friendly infrastructure +[banner] +header = KolibriOS accepted to GSoC 2026! +text = Check program details and our project ideas +alt = GSoC [article] p1 = {kolibrios} is a tiny yet incredibly powerful and fast operating system for diff --git a/locales/es.ini b/locales/es.ini index 9bcd658..b6b53e1 100644 --- a/locales/es.ini +++ b/locales/es.ini @@ -14,9 +14,10 @@ forum = Foro wiki = Wiki git = Git -[git] -header = ¡KolibriOS se ha trasladado a Git! -text = Mira nuestra nueva infraestructura amigable para desarrolladores +[banner] +header = ¡KolibriOS fue aceptado en GSoC 2026! +text = Consulta los detalles del programa y nuestras ideas de proyecto +alt = GSoC [article] p1 = {kolibrios} es un sistema operativo diminuto, pero increíblemente potente y diff --git a/locales/fr.ini b/locales/fr.ini index e349167..609b96b 100644 --- a/locales/fr.ini +++ b/locales/fr.ini @@ -14,9 +14,10 @@ forum = Forum wiki = Wiki git = Git -[git] -header = KolibriOS a déménagé sur Git ! -text = Découvrez notre nouvelle infrastructure conviviale pour les développeurs +[banner] +header = KolibriOS a été accepté au GSoC 2026 ! +text = Consultez les détails du programme et nos idées de projets +alt = GSoC [article] p1 = {kolibrios} est un système d`exploitation minuscule, mais incroyablement diff --git a/locales/it.ini b/locales/it.ini index ad9fa1d..5f691b2 100644 --- a/locales/it.ini +++ b/locales/it.ini @@ -14,10 +14,10 @@ forum = Forum wiki = Wiki git = Git -[git] -header = KolibriOS si è spostato su Git! -text = Dai un`occhiata alla nostra nuova infrastruttura pensata per gli - sviluppatori +[banner] +header = KolibriOS è stato accettato al GSoC 2026! +text = Consulta i dettagli del programma e le nostre idee di progetto +alt = GSoC [article] p1 = {kolibrios} è un sistema operativo minuscolo, ma incredibilmente potente e diff --git a/locales/nl.ini b/locales/nl.ini index 32978b1..da82371 100644 --- a/locales/nl.ini +++ b/locales/nl.ini @@ -14,9 +14,10 @@ forum = Forum wiki = Wiki git = Git -[git] -header = KolibriOS is verhuisd naar Git! -text = Bekijk onze nieuwe, ontwikkelaarsvriendelijke infrastructuur +[banner] +header = KolibriOS is geaccepteerd voor GSoC 2026! +text = Bekijk de programmadetails en onze projectideeën +alt = GSoC [article] p1 = {kolibrios} is een klein maar ongelooflijk krachtig en snel diff --git a/locales/ru.ini b/locales/ru.ini index 1eaa3ba..90f6df7 100644 --- a/locales/ru.ini +++ b/locales/ru.ini @@ -14,9 +14,10 @@ forum = Форум wiki = Вики git = Git -[git] -header = КолибриОС перешла на Git! -text = Ознакомьтесь с нашей новой, удобной для разработчиков инфраструктурой +[banner] +header = KolibriOS принята в GSoC 2026! +text = Ознакомьтесь с деталями программы и нашими идеями проектов +alt = GSoC [article] p1 = {kolibrios} — это крошечная, но невероятно мощная и быстрая операционная diff --git a/locales/zh-Hans.ini b/locales/zh-Hans.ini index c6db5f3..1b7084b 100644 --- a/locales/zh-Hans.ini +++ b/locales/zh-Hans.ini @@ -14,9 +14,10 @@ forum = 论坛 wiki = 百科 git = Git -[git] -header = KolibriOS 现已拥抱 Git! -text = 来看看我们全新又对开发者友好的代码仓库吧: +[banner] +header = KolibriOS 已被 GSoC 2026 录取! +text = 查看项目详情和我们的项目创意 +alt = GSoC [article] p1 = {kolibrios} 是一个体积微小、功能强大、响应迅速的,面向 x86 兼容机的操作系统。 diff --git a/locales/zh-Hant.ini b/locales/zh-Hant.ini index 594c3ef..2fb2796 100644 --- a/locales/zh-Hant.ini +++ b/locales/zh-Hant.ini @@ -14,9 +14,10 @@ forum = 論壇 wiki = 百科 git = Git -[git] -header = KolibriOS 現已移入 Git! -text = 來看看我們又新又友好的代碼倉庫吧: +[banner] +header = KolibriOS 已入選 GSoC 2026! +text = 查看計畫詳情和我們的專案構想 +alt = GSoC [article] p1 = {kolibrios} 是一個空間小、功能強、回應快的,面向 x86 兼容機的作業系統。 diff --git a/modules/configs.py b/modules/configs.py new file mode 100644 index 0000000..0ed6e8b --- /dev/null +++ b/modules/configs.py @@ -0,0 +1,50 @@ +from os import path, listdir +from configparser import ConfigParser +import threading + + +_configs = {} +_loaded = False +_load_lock = threading.Lock() + + +def load_all_configs(): + new_configs = {} + + configs_dir = "configs" + if not path.isdir(configs_dir): + return new_configs + + for filename in sorted(listdir(configs_dir)): + if not filename.endswith(".ini"): + continue + + file_path = path.join(configs_dir, filename) + cp = ConfigParser() + with open(file_path, encoding="utf-8") as f: + cp.read_file(f) + + for section in cp.sections(): + section_data = new_configs.setdefault(section, {}) + section_data.update(dict(cp[section])) + + return new_configs + + +def ensure_loaded(): + global _configs, _loaded + with _load_lock: + if _loaded: + return + _configs = load_all_configs() + _loaded = True + + +def get_section(name): + ensure_loaded() + return dict(_configs.get(name, {})) + + +def get_all_sections(): + ensure_loaded() + return {section: dict(values) for section, values in _configs.items()} diff --git a/modules/locales.py b/modules/locales.py index c9f698f..6ef9ba9 100644 --- a/modules/locales.py +++ b/modules/locales.py @@ -2,6 +2,8 @@ from os import path, listdir from configparser import ConfigParser import threading +from modules import configs + translations = {} locales_name = {} @@ -33,6 +35,13 @@ def load_all_locales(): section: dict(cp[section]) for section in cp.sections() } + shared_sections = configs.get_all_sections() + if shared_sections: + for locale_translation in new_translations.values(): + for section_name, section_values in shared_sections.items(): + locale_section = locale_translation.setdefault(section_name, {}) + locale_section.update(section_values) + new_locales_code = locales_code_default + tuple(sorted(locales_code_extra)) new_locales_name = { locale_code: new_translations[locale_code]["title"]["language"] diff --git a/static/img/gitea.png b/static/img/banners/gitea.png similarity index 100% rename from static/img/gitea.png rename to static/img/banners/gitea.png diff --git a/static/img/banners/gsoc.png b/static/img/banners/gsoc.png new file mode 100644 index 0000000000000000000000000000000000000000..ca348b536b2ceafef314eba63251962b842054db GIT binary patch literal 6879 zcmZ8`cQjmI)b12siJ1(tE+)&MGno&W%O$3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dVg2z(K)oM*M7nt2Cm+kg)ehWzo4e z%_)m7KXH}pS20jl#G%=Y7q5U2LgrH8UNL@bi^k~>7u1zrBCQiy-aRtaJil1jhcp&t zOshu41ITQbPhkGQmX>~>e(r?WT9Dp`J~grA&LU+mh4DFpcbVuy!v~|62x9#h1*#U2 z)Bgfuy{8pCNuN{VfJb?UU4bt~cT5Ht8HuEPwoF~k3ZSBbSi7Lu#X+o!+zQ( - {% include 'tmpl/_git.htm' %} + {% include 'tmpl/_banner.htm' %} {% include 'tmpl/_article.htm' %} diff --git a/templates/tmpl/_banner.htm b/templates/tmpl/_banner.htm new file mode 100644 index 0000000..ca32245 --- /dev/null +++ b/templates/tmpl/_banner.htm @@ -0,0 +1,17 @@ + diff --git a/templates/tmpl/_git.htm b/templates/tmpl/_git.htm deleted file mode 100644 index d244f6b..0000000 --- a/templates/tmpl/_git.htm +++ /dev/null @@ -1,19 +0,0 @@ -