From d31e4e10c8de4e8899c17a0c209dc3dea8a99197 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 29 Aug 2023 13:46:59 +0200 Subject: [PATCH 1/5] Translate pages --- pages/en/account.html | 7 ++++++ pages/en/contact.html | 5 +++++ pages/en/events.html | 1 + pages/en/index.html | 30 +++++++++++++++++++++++++ pages/en/services.html | 51 ++++++++++++++++++++++++++++++++++++++++++ pages/en/webring.html | 3 +++ 6 files changed, 97 insertions(+) create mode 100644 pages/en/account.html create mode 100644 pages/en/contact.html create mode 100644 pages/en/events.html create mode 100644 pages/en/index.html create mode 100644 pages/en/services.html create mode 100644 pages/en/webring.html diff --git a/pages/en/account.html b/pages/en/account.html new file mode 100644 index 0000000..3599186 --- /dev/null +++ b/pages/en/account.html @@ -0,0 +1,7 @@ +

If you have created an account on dmz.rs, you can use our XMPP and e-mail server, as well as other services that support LDAP login.

+

For more on XMPP see this tutorial.

+

You can see settings for the Thundebird mail client on this image.

+ +

Register

+

Delete account

+

Change password

diff --git a/pages/en/contact.html b/pages/en/contact.html new file mode 100644 index 0000000..204b45a --- /dev/null +++ b/pages/en/contact.html @@ -0,0 +1,5 @@ +

Contact

+

You can send mail to dmz@dmz.rs or you can register on the our Formu.

+

Also, we are available on the Fediversu!

+
+

If you found a on the site, please do tell us. We would be very grateful.

diff --git a/pages/en/events.html b/pages/en/events.html new file mode 100644 index 0000000..f90dc54 --- /dev/null +++ b/pages/en/events.html @@ -0,0 +1 @@ +

Events

diff --git a/pages/en/index.html b/pages/en/index.html new file mode 100644 index 0000000..e820698 --- /dev/null +++ b/pages/en/index.html @@ -0,0 +1,30 @@ +

Welcome!

+

+ We are Decentrala - a group of enthuasists gathered around idea of decentralization and knowlage sharing. Here are some more facts about us: +

+
+
Knowledge:
+
All our workshops are free and open to everyone. + Also, if you have something to share, feel free to anounce event on the Forum. +
+
Actions:
+
From time to time we organize actions, hackatons, cryptoparties, exibitons, etc..
+
Services:
+
Our servers run various services (like e-mail, git, wiki, etc...) that are open to everyone.
+
Donations:
+
+ Decentrala is open + Decentrala accepts donations exclusively from persons and without any obligations. + We are independent and we try to keep it that way. + You can donate old hardware (laptops, phones, PC components) to us, and we will find a use for it in Decentrala or give it to people who need it. + Also, you can donate bitcoin and monero by sending to the following addresses: +

Bitcoin: bc1qjhsfgq79wuzzv32yml9zglwzf9qcwfj3atuy74

+

Monero: 8BESz45LnxrgCwZP32KieiN1D4LinCfsS1YjdFHfGXrVCmPs35167QsW1gd7qbff4UAtBbT6oWrkbfZnJm71HornVRiRZFS

+
+
+

+If you are still interested, you can create an account +on our server which will enable the use of all our services. +If you want to see first how it all looks, you can come to one of our +event, and meet us there! +

diff --git a/pages/en/services.html b/pages/en/services.html new file mode 100644 index 0000000..df21d27 --- /dev/null +++ b/pages/en/services.html @@ -0,0 +1,51 @@ +

Services

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ServiceDescription
E-mailE-mail account that you can use with any e-mail client (for example, with the Thunderbird).
ForumForum for general discussion and event organization.
ChatWe have our XMPP server, on which you can make an account. + If you already have an account, you can find us in group decentrala@conference.dmz.rs. +
GitGitea instance on which we host our code and resources (including the code for this site). +
WikiWiki.js instance on which we publish documentation for our projects, + events resources, and tutorials. +
SearchSearXNG instance used for Web searching.
PastebinPrivateBin instance we use for sharing text files +
Soft ServeSoft Serve instance that we use as a replacement for the Gitea service. + Soft Serve works entirely from the terminal. +
+

These are some of the services we currently maintain on our servers. +To use these services, you can you register for each service separately, +or you can create a unique account +on our server and use all services with the same account.

diff --git a/pages/en/webring.html b/pages/en/webring.html new file mode 100644 index 0000000..03913f9 --- /dev/null +++ b/pages/en/webring.html @@ -0,0 +1,3 @@ + \ No newline at end of file From 1f5e5419223d5c004644b6b68c7eac43c0429d93 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 29 Aug 2023 13:58:50 +0200 Subject: [PATCH 2/5] Fix events script --- pages/sr/events.html | 60 +------------------------------ prep.py | 86 +++++++++++++++++++++----------------------- 2 files changed, 41 insertions(+), 105 deletions(-) diff --git a/pages/sr/events.html b/pages/sr/events.html index 21df750..c6c2c27 100644 --- a/pages/sr/events.html +++ b/pages/sr/events.html @@ -1,59 +1 @@ -

Događaji

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DatumVremeMestoTema
Ponedeljak, 7. Avgust 2023. 19:00h DC Krov Linux ricing
Utorak, 8. Avgust 2023. 19:00h DC Krov Lambda račun
Ponedeljak, 14. Avgust 2023. 19:00h DC Krov Linux distro diskusija
Utorak, 15. Avgust 2023. 19:00h DC Krov Pirati 777 mora
Ponedeljak, 21. Avgust 2023. 19:00h DC Krov Python vežbe
Utorak, 22. Avgust 2023. 19:00h DC Krov Autentifikacija na internetu
Ponedeljak, 28. Avgust 2023. 19:00h DC Krov Podešvanje Mail servera
Utorak, 29. Avgust 2023. 19:00h DC Krov Prevođenje wiki-ja
\ No newline at end of file +

Događaji

\ No newline at end of file diff --git a/prep.py b/prep.py index 8cfd463..4a41c98 100644 --- a/prep.py +++ b/prep.py @@ -3,30 +3,16 @@ from datetime import datetime from functools import cmp_to_key -days = [ - "Ponedeljak", - "Utorak", - "Sreda", - "Četvrtak", - "Petak", - "Subota", - "Nedelja", -] - -months = [ - "Januar", - "Februar", - "Mart", - "April", - "Maj", - "Jun", - "Jul", - "Avgust", - "Septembar", - "Oktobar", - "Novembar", - "Decembar", -] +DAYS_SR = ["Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota", "Nedelja"] +DAYS_EN = ["Monday ", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] +MONTHS_SR = [ + "Januar", "Februar", "Mart", "April", "Maj", "Jun", + "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar", + ] +MONTHS_EN = [ + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December", + ] today = datetime.today().date() @@ -66,36 +52,44 @@ def sort_events(events): return sorted(events, key = cmp_to_key(compare_events)) +def build_html(events, dayNames, monthNames): + newevents = [] + for event in events: + date, time, location, title = event.split(", ") + date = parse_date(date) + if is_past_event(date): + continue + date = dayNames[date.weekday()]+", "+str(date.day)+". "+monthNames[date.month-1]+" "+str(date.year)+"." + time = time+"h" + future_event = [] + future_event.append(" "+date+" ") + future_event.append(" "+time+" ") + if "https://" in location: + place,link = location.split("https://") + future_event.append(" "+place.strip()+" ") + else: + future_event.append(" "+location.strip()+" ") + future_event.append(" "+title+" ") + newevents.append("\n"+"\n".join(future_event)+"\n") + return newevents + events = load_events() events = sort_events(events) write_events(events) -newevents = [] +print(events) -for event in events: - date, time, location, title = event.split(", ") - date = parse_date(date) - if is_past_event(date): - continue - date = days[date.weekday()]+", "+str(date.day)+". "+months[date.month-1]+" "+str(date.year)+"." - time = time+"h" - future_event = [] - future_event.append(" "+date+" ") - future_event.append(" "+time+" ") - if "https://" in location: - place,link = location.split("https://") - future_event.append(" "+place.strip()+" ") - else: - future_event.append(" "+location.strip()+" ") - future_event.append(" "+title+" ") - newevents.append("\n"+"\n".join(future_event)+"\n") +newevents = build_html(events, DAYS_SR, MONTHS_SR) +print(newevents) with open("pages/sr/events.html","wt") as file: file.writelines(["

Događaji

\n", "\n", "\n"]) file.writelines(newevents) file.writelines(["
DatumVremeMestoTema
"]) -#with open("pages/en/events.html","wt") as file: -# file.writelines(["

Events

", "", "\n\n\n\n\n"]) -# file.writelines(events) -# file.writelines(["
DateTimePlaceTheme
"]) +newevents = build_html(events, DAYS_EN, MONTHS_EN) + +with open("pages/en/events.html","wt") as file: + file.writelines(["

Events

\n", "\n", ""]) + file.writelines(newevents) + file.writelines(["
DateTimePlaceTopic
"]) From 221dff13dd69a573755cfc779eb46377d17e2b4d Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 29 Aug 2023 15:01:45 +0200 Subject: [PATCH 3/5] Spelling --- pages/en/contact.html | 6 +++--- pages/en/index.html | 18 ++++++++++-------- pages/en/services.html | 21 ++++++++++++--------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/pages/en/contact.html b/pages/en/contact.html index 204b45a..866a0cf 100644 --- a/pages/en/contact.html +++ b/pages/en/contact.html @@ -1,5 +1,5 @@

Contact

-

You can send mail to dmz@dmz.rs or you can register on the our Formu.

-

Also, we are available on the Fediversu!

+

You can send mail to dmz@dmz.rs or you can register on our Forum.

+

Also, we are available on the Fediverse!


-

If you found a on the site, please do tell us. We would be very grateful.

+

If you find a bug on the site, please do tell us. We would be very grateful.

diff --git a/pages/en/index.html b/pages/en/index.html index e820698..f2a1dbe 100644 --- a/pages/en/index.html +++ b/pages/en/index.html @@ -1,14 +1,16 @@

Welcome!

- We are Decentrala - a group of enthuasists gathered around idea of decentralization and knowlage sharing. Here are some more facts about us: + We are Decentrala - a group of enthusiasts gathered around the idea of decentralization and knowledge sharing. + Here are some more facts about us:

Knowledge:
-
All our workshops are free and open to everyone. - Also, if you have something to share, feel free to anounce event on the Forum. +
+ All our workshops are free and open to everyone. + Also, if you have something to share, feel free to announce the event on the Forum.
Actions:
-
From time to time we organize actions, hackatons, cryptoparties, exibitons, etc..
+
From time to time we organize actions, hackathons, crypto parties, exhibitions, etc.
Services:
Our servers run various services (like e-mail, git, wiki, etc...) that are open to everyone.
Donations:
@@ -23,8 +25,8 @@

-If you are still interested, you can create an account -on our server which will enable the use of all our services. -If you want to see first how it all looks, you can come to one of our -event, and meet us there! + If you are still interested, you can create an account + on our server which will enable the use of all our services. + If you want to see first how it all looks, you can come to one of our + event, and meet us there!

diff --git a/pages/en/services.html b/pages/en/services.html index df21d27..0ba634a 100644 --- a/pages/en/services.html +++ b/pages/en/services.html @@ -14,8 +14,9 @@ Chat - We have our XMPP server, on which you can make an account. - If you already have an account, you can find us in group decentrala@conference.dmz.rs. + + We have our XMPP server, on which you can make an account. + If you already have an account, you can find us at group decentrala@conference.dmz.rs. @@ -35,17 +36,19 @@ Pastebin - PrivateBin instance we use for sharing text files - + PrivateBin instance we use for sharing text files Soft Serve - Soft Serve instance that we use as a replacement for the Gitea service. + + Soft Serve instance that we use as a replacement for the Gitea service. Soft Serve works entirely from the terminal. -

These are some of the services we currently maintain on our servers. -To use these services, you can you register for each service separately, -or you can create a unique account -on our server and use all services with the same account.

+

+ These are some of the services we currently maintain on our servers. + To use these services, you can register for each service separately, + or you can create a unique account + on our server and use all services with the same account. +

From 6671fb1547b4cd5adfd4b3c5628a77cc0d542c49 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 29 Aug 2023 15:25:20 +0200 Subject: [PATCH 4/5] Implement page builder for English --- .gitignore | 1 + build_pages.py | 11 +++++++++-- prep.py | 3 --- site/styles/style.css | 6 +----- template/page-en.html | 12 +++++++----- template/page-sr.html | 4 +++- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 86197ef..09d3036 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ venv/ site/*.html +site/en/*.html site/atom_blog.xml site/atom_events.xml poster.html diff --git a/build_pages.py b/build_pages.py index d82a109..edda7fd 100644 --- a/build_pages.py +++ b/build_pages.py @@ -9,10 +9,11 @@ PAGES = [ {'name': 'webring', 'titleSR': 'Webring', 'titleEN': 'Webring', 'style': ''}, ] -def buildPage(pageTitle: str, pageHtml: str, pageStyle: str, template: str) -> str: +def buildPage(filename: str, pageTitle: str, pageHtml: str, pageStyle: str, template: str) -> str: template = template.replace('', pageTitle) style = '' if not pageStyle else f'' template = template.replace('', style) + template = template.replace('PAGE_NAME', filename) template = template.replace('', pageHtml) return template @@ -24,10 +25,16 @@ def main(): for page in PAGES: with open(f'pages/sr/{page["name"]}.html') as f: pageHtml = f.read() - html = buildPage(page['titleSR'], pageHtml, page['style'], templateSR) + html = buildPage(page['name'], page['titleSR'], pageHtml, page['style'], templateSR) f = open(f'site/{page["name"]}.html', 'w') f.write(html) f.close() + with open(f'pages/en/{page["name"]}.html') as f: + pageHtml = f.read() + html = buildPage(page['name'], page['titleEN'], pageHtml, page['style'], templateEN) + f = open(f'site/en/{page["name"]}.html', 'w') + f.write(html) + f.close() if __name__ == '__main__': main() \ No newline at end of file diff --git a/prep.py b/prep.py index 4a41c98..0d12672 100644 --- a/prep.py +++ b/prep.py @@ -77,10 +77,7 @@ events = load_events() events = sort_events(events) write_events(events) -print(events) - newevents = build_html(events, DAYS_SR, MONTHS_SR) -print(newevents) with open("pages/sr/events.html","wt") as file: file.writelines(["

Događaji

\n", "\n", "\n"]) diff --git a/site/styles/style.css b/site/styles/style.css index 25a9752..cbd8559 100644 --- a/site/styles/style.css +++ b/site/styles/style.css @@ -111,7 +111,7 @@ a:focus { background: linear-gradient(90deg, var(--hightlight) 0%, var(--hightlight) 50%, var(--bg) 51%, var(--bg) 100%); } -.account { +.lang { font-size: 2rem; } @@ -210,8 +210,4 @@ screen and (max-width: 1500px) { #theme-switcher { margin-right: 1rem; } - - .account { - font-size: 1rem; - } } \ No newline at end of file diff --git a/template/page-en.html b/template/page-en.html index 843fb18..330afa7 100644 --- a/template/page-en.html +++ b/template/page-en.html @@ -9,12 +9,13 @@ <!--TITLE--> Decentrala +
- + - + SR
@@ -22,9 +23,10 @@
CreativeCommons diff --git a/template/page-sr.html b/template/page-sr.html index 1105d58..db6bda3 100644 --- a/template/page-sr.html +++ b/template/page-sr.html @@ -9,12 +9,13 @@ <!--TITLE--> Decentrala +
- + EN
@@ -25,6 +26,7 @@ Događaji Servisi Kontakt + CreativeCommons From 05c11219d260374051e6597a8691e42e2a6931bd Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 30 Aug 2023 10:08:34 +0200 Subject: [PATCH 5/5] Wording --- pages/en/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/en/index.html b/pages/en/index.html index f2a1dbe..fc16149 100644 --- a/pages/en/index.html +++ b/pages/en/index.html @@ -15,7 +15,6 @@
Our servers run various services (like e-mail, git, wiki, etc...) that are open to everyone.
Donations:
- Decentrala is open Decentrala accepts donations exclusively from persons and without any obligations. We are independent and we try to keep it that way. You can donate old hardware (laptops, phones, PC components) to us, and we will find a use for it in Decentrala or give it to people who need it.
DatumVremeMestoTema