From 13437ff5d8553244fb1f8900be3fd0a7a9daf5dc Mon Sep 17 00:00:00 2001 From: icicel Date: Wed, 4 Sep 2024 19:53:07 +0200 Subject: [PATCH 01/10] Generate sv locale --- .gitignore | 1 + locale/en/LC_MESSAGES/django.mo | Bin 6380 -> 0 bytes locale/en/LC_MESSAGES/django.po | 52 +++-- locale/sv/LC_MESSAGES/django.po | 330 ++++++++++++++++++++++++++++++++ 4 files changed, 363 insertions(+), 20 deletions(-) delete mode 100644 locale/en/LC_MESSAGES/django.mo create mode 100644 locale/sv/LC_MESSAGES/django.po diff --git a/.gitignore b/.gitignore index f3eb56f..0ca971c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__ secret-key.txt portal-env *.swp +*.mo static/* logs/* db diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo deleted file mode 100644 index 6b25439c659a63ac91920b4ee852f0ab9aaae75d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6380 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\n" "Language-Team: LANGUAGE \n" @@ -30,11 +30,11 @@ msgstr "The divison on Facebook" msgid "Mat på Campus:" msgstr "Food on campus:" -#: homepage/templates/homepage/index/welcome-box.html:10 +#: homepage/templates/homepage/index/welcome-box.html:11 msgid "Välkommen" msgstr "Welcome" -#: homepage/templates/homepage/index/welcome-box.html:14 +#: homepage/templates/homepage/index/welcome-box.html:15 msgid "" "Detta är DTEK-portalen, med ett gäng nyttiga länkar till ställen där du kan " "tänkas vilja gå." @@ -42,17 +42,28 @@ msgstr "" "This is the DTEK portal, containing a bunch of useful links to places you " "might want to go." -#: homepage/templates/homepage/index/welcome-box.html:16 +#: homepage/templates/homepage/index/welcome-box.html:17 +#, fuzzy +#| msgid "" +#| "Datateknologsektionen är en icke vinstdrivande organisation som är till " +#| "för alla studenter på civilingenjörsprogrammet Datateknik på Chalmers och " +#| "dess relaterade masterprogram. Vi ordnar mottagning för nyantagna, " +#| "arrangerar fester, bedriver studiebevakning och mycket mer." msgid "" "Datateknologsektionen är en icke vinstdrivande organisation som är till för " "alla studenter på civilingenjörsprogrammet Datateknik på Chalmers och dess " -"relaterade masterprogram. Vi ordnar mottagning för nyantagna, arrangerar fester, " -"bedriver studiebevakning och mycket mer." +"relaterade masterprogram. Vi ordnar mottagning för nyantagna, " +"arrangerar fester, bedriver studiebevakning och mycket mer." msgstr "" "The Student Division of Computer Science and Engineering,"Data" " "(officially "Datateknologsektionen" in Swedish),is a nonprofit " @@ -61,12 +72,13 @@ msgstr "" "Masterprogram\">master's programmes. We arrange receptions for " "newlyadmitted students at both the bachelor's and master's programmes, arrange parties, monitor your education " -"and much more." +"dtek.se/wiki/Main/DMNollK\">master's programmes, arrange parties, monitor your " +"education and much more." -#: homepage/templates/homepage/index/welcome-box.html:18 +#: homepage/templates/homepage/index/welcome-box.html:19 msgid "" "En del av Chalmers Studentkår " msgstr "" @@ -87,9 +99,9 @@ msgid "" "dHack \">dHack med URL-en och förklara vad du förväntade " "dig att hitta där." msgstr "" -"If you think there's an error behind the scenes, please contact \">dHack with the URL and explain what you " -"were expecting to see." +"If you think there's an error behind the scenes, please contact \">dHack with the URL and explain " +"what you were expecting to see." #: templates/footer/footer-foot.html:8 msgid "Utvecklad av " @@ -210,7 +222,7 @@ msgstr "Master Reception Committee" msgid "Matlagningskommitté" msgstr "Cooking Committee" -#: templates/footer/footer-right-col.html:142 +#: templates/footer/footer-right-col.html:144 msgid "Jämlikhetskommitté" msgstr "Equality Committee" diff --git a/locale/sv/LC_MESSAGES/django.po b/locale/sv/LC_MESSAGES/django.po new file mode 100644 index 0000000..0795bee --- /dev/null +++ b/locale/sv/LC_MESSAGES/django.po @@ -0,0 +1,330 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-04 19:59+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: homepage/templates/homepage/index/cal-box.html:5 +msgid "Arrangemangskalender" +msgstr "Arrangemangskalender" + +#: homepage/templates/homepage/index/fb-box.html:5 +msgid "Sektionen på Facebook" +msgstr "Sektionen på Facebook" + +#: homepage/templates/homepage/index/food-box.html:5 +msgid "Mat på Campus:" +msgstr "Mat på Campus:" + +#: homepage/templates/homepage/index/welcome-box.html:11 +msgid "Välkommen" +msgstr "Välkommen" + +#: homepage/templates/homepage/index/welcome-box.html:15 +msgid "" +"Detta är DTEK-portalen, med ett gäng nyttiga länkar till ställen där du kan " +"tänkas vilja gå." +msgstr "" +"Detta är DTEK-portalen, med ett gäng nyttiga länkar till ställen där du kan " +"tänkas vilja gå." + +#: homepage/templates/homepage/index/welcome-box.html:17 +msgid "" +"Datateknologsektionen är en icke vinstdrivande organisation som är till för " +"alla studenter på civilingenjörsprogrammet Datateknik på Chalmers och dess " +"relaterade masterprogram. Vi ordnar mottagning för nyantagna, " +"arrangerar fester, bedriver studiebevakning och mycket mer." +msgstr "" +"Datateknologsektionen är en icke vinstdrivande organisation som är till för " +"alla studenter på civilingenjörsprogrammet Datateknik på Chalmers och dess " +"relaterade masterprogram. Vi ordnar mottagning för nyantagna, " +"arrangerar fester, bedriver studiebevakning och mycket mer." + +#: homepage/templates/homepage/index/welcome-box.html:19 +msgid "" +"En del av Chalmers Studentkår " +msgstr "" +"En del av Chalmers Studentkår " + +#: templates/404.html:36 +msgid "Den gubben gick inte!" +msgstr "Den gubben gick inte!" + +#: templates/404.html:38 +msgid "Det här är en typisk 404-sida." +msgstr "Det här är en typisk 404-sida." + +#: templates/404.html:39 +msgid "" +"Om du tror det beror på ett tekniskt fel, vänligen kontakta \">dHack med URL-en och förklara vad du förväntade " +"dig att hitta där." +msgstr "" +"Om du tror det beror på ett tekniskt fel, vänligen kontakta \">dHack med URL-en och förklara vad du förväntade " +"dig att hitta där." + +#: templates/footer/footer-foot.html:8 +msgid "Utvecklad av " +msgstr "Utvecklad av " + +#: templates/footer/footer-foot.html:8 +msgid "stulen av" +msgstr "stulen av" + +#: templates/footer/footer-foot.html:8 +msgid "översatt av" +msgstr "översatt av" + +#: templates/footer/footer-foot.html:8 +msgid "omskriven av" +msgstr "omskriven av" + +#: templates/footer/footer-foot.html:8 +msgid "mer info" +msgstr "mer info" + +#: templates/footer/footer-foot.html:9 +msgid "licens" +msgstr "licens" + +#: templates/footer/footer-foot.html:10 +msgid "de flesta foton tillhör" +msgstr "de flesta foton tillhör" + +#: templates/footer/footer-left-col.html:13 +msgctxt "full title" +msgid "Datateknologsektionen" +msgstr "Datateknologsektionen" + +#: templates/footer/footer-left-col.html:14 +#: templates/header/header-left-box.html:13 templates/top-nav-banner.html:16 +msgid "Chalmers Studentkår" +msgstr "Chalmers Studentkår" + +#: templates/footer/footer-middle-col.html:9 +msgid "Kontakt" +msgstr "Kontakt" + +#: templates/footer/footer-middle-col.html:17 +msgid "Postadress" +msgstr "Postadress" + +#: templates/footer/footer-middle-col.html:31 +msgid "Organisationsnummer" +msgstr "Organisationsnummer" + +#: templates/footer/footer-right-col.html:8 +msgid "Styrelse" +msgstr "Styrelse" + +#: templates/footer/footer-right-col.html:16 +msgid "Studienämnd" +msgstr "Studienämnd" + +#: templates/footer/footer-right-col.html:24 +msgid "Sexmästeri" +msgstr "Sexmästeri" + +#: templates/footer/footer-right-col.html:32 +msgid "PR-kommitté" +msgstr "PR-kommitté" + +#: templates/footer/footer-right-col.html:40 +msgid "Rustmästeri" +msgstr "Rustmästeri" + +#: templates/footer/footer-right-col.html:48 +msgid "Mottagningskommitté" +msgstr "Mottagningskommitté" + +#: templates/footer/footer-right-col.html:56 +#: templates/header/header-menu-box.html:40 +msgid "Arbetsmarknadsgrupp" +msgstr "Arbetsmarknadsgrupp" + +#: templates/footer/footer-right-col.html:64 +msgid "DATA-driftsförening" +msgstr "DATA-driftsförening" + +#: templates/footer/footer-right-col.html:72 +msgid "Fanbärare" +msgstr "Fanbärare" + +#: templates/footer/footer-right-col.html:80 +msgid "Idrottsförening" +msgstr "Idrottsförening" + +#: templates/footer/footer-right-col.html:88 +msgid "Spelförening" +msgstr "Spelförening" + +#: templates/footer/footer-right-col.html:96 +msgid "Fotokommitté" +msgstr "Fotokommitté" + +#: templates/footer/footer-right-col.html:104 +msgid "Bilkommitté" +msgstr "Bilkommitté" + +#: templates/footer/footer-right-col.html:112 +msgid "Sektionstidning" +msgstr "Sektionstidning" + +#: templates/footer/footer-right-col.html:120 +msgid "Sektionens podcast" +msgstr "Sektionens podcast" + +#: templates/footer/footer-right-col.html:128 +msgid "Master Reception Committee" +msgstr "Master Reception Committee" + +#: templates/footer/footer-right-col.html:136 +msgid "Matlagningskommitté" +msgstr "Matlagningskommitté" + +#: templates/footer/footer-right-col.html:144 +msgid "Jämlikhetskommitté" +msgstr "Jämlikhetskommitté" + +#: templates/head.html:14 +msgid "Datateknologsektionen på Chalmers" +msgstr "Datateknologsektionen på Chalmers" + +#: templates/header/header-left-box.html:11 +msgid "Teknologsektionen" +msgstr "Teknologsektionen" + +#: templates/header/header-left-box.html:12 +msgid "Datateknik" +msgstr "Datateknik" + +#: templates/header/header-menu-box.html:34 templates/top-nav-banner.html:24 +msgid "Företag" +msgstr "Företag" + +#: templates/header/header-menu-box.html:50 +msgid "Wikin" +msgstr "Wikin" + +#: templates/header/header-menu-box.html:56 +msgid "DTEK-wikin, där allt kul händer!" +msgstr "DTEK-wikin, där allt kul händer!" + +#: templates/header/header-menu-box.html:66 +#: templates/header/header-menu-box.html:72 +msgid "Styrdokument" +msgstr "Styrdokument" + +#: templates/header/header-menu-box.html:82 +msgid "Databussen" +msgstr "Databussen" + +#: templates/header/header-menu-box.html:88 +msgid "Mer info om Databussen" +msgstr "Mer info om Databussen" + +#: templates/header/header-menu-box.html:98 +msgid "Schema" +msgstr "Schema" + +#: templates/header/header-menu-box.html:104 +msgid "TimeEdit" +msgstr "TimeEdit" + +#: templates/header/header-menu-box.html:114 +msgid "Grupprum" +msgstr "Grupprum" + +#: templates/header/header-menu-box.html:120 +msgid "Boka grupprum på Chalmers" +msgstr "Boka grupprum på Chalmers" + +#: templates/header/header-menu-box.html:130 +msgid "Kårkort" +msgstr "Kårkort" + +#: templates/header/header-menu-box.html:136 +msgid "Genväg för att ladda ditt kårkort" +msgstr "Genväg för att ladda ditt kårkort" + +#: templates/header/header-menu-box.html:146 +msgid "Karta" +msgstr "Karta" + +#: templates/header/header-menu-box.html:152 +msgid "Karta över Campus" +msgstr "Karta över Campus" + +#: templates/header/header-menu-box.html:162 +msgid "Veckobrev" +msgstr "Veckobrev" + +#: templates/header/header-menu-box.html:166 +msgid "" +"Anmäl dig till datas veckobrev, med alla arrangemang och annat som händer på " +"sektionen" +msgstr "" +"Anmäl dig till datas veckobrev, med alla arrangemang och annat som händer på " +"sektionen" + +#: templates/header/header-menu-box.html:174 +msgid "Studiesocial hjälp" +msgstr "Studiesocial hjälp" + +#: templates/header/header-menu-box.html:178 +msgid "" +"Om du känner att studierna går tufft,\n" +" du känner dig nere, känner dig kränkt eller " +"diskriminerad,\n" +" eller känner dig osäker finns epost och telefonnummer " +"att ringa här" +msgstr "" +"Om du känner att studierna går tufft,\n" +" du känner dig nere, känner dig kränkt eller " +"diskriminerad,\n" +" eller känner dig osäker finns epost och telefonnummer " +"att ringa här" + +#: templates/top-nav-banner.html:15 +msgid "Datateknologsektionen" +msgstr "Datateknologsektionen" + +#: templates/top-nav-banner.html:21 +msgid "Mottagning" +msgstr "Mottagning" + +#: templates/top-nav-banner.html:22 +msgid "Studier" +msgstr "Studier" + +#: templates/top-nav-banner.html:23 +msgid "Foton" +msgstr "Foton" + +#~ msgid "Projektgrupp för arbetsmarknadsmässa" +#~ msgstr "Projektgrupp för arbetsmarknadsmässa" From f70f3cdceed268bf1483157653b0a7af9ea69d9b Mon Sep 17 00:00:00 2001 From: icicel Date: Wed, 4 Sep 2024 20:10:44 +0200 Subject: [PATCH 02/10] Locale generation improvements --- Makefile | 24 +++++++++++------------- README.md | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 688d77f..79cb7a6 100644 --- a/Makefile +++ b/Makefile @@ -5,30 +5,28 @@ export $(shell sed 's/=.*//' .env) test: env +# delete this up-prod: sudo -E docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d sudo -E docker-compose exec web /bin/sh -c "python3 manage.py migrate" sudo -E docker-compose exec web /bin/sh -c "python3 manage.py compilemessages -l en" sudo -E docker-compose exec web /bin/sh -c "python3 manage.py collectstatic --noinput" +# delete this too up-develop: # sleep 5 && sudo docker-compose exec web /bin/sh -c "python3 manage.py migrate" & sudo -E docker-compose run web /bin/sh -c "python3 manage.py compilemessages -l en" sudo -E docker-compose -f docker-compose.yml -f docker-compose.develop.yml up -makemessages: - sudo -E docker-compose run web python3 manage.py makemessages -l en +refreshdb: + sudo -E docker compose exec web python3 manage.py migrate -# Use when the container is running -makemessages-exec: - sudo -E docker-compose exec web python3 manage.py makemessages -l en +makemessages: + sudo -E docker compose exec web python3 manage.py makemessages -l en + sudo -E docker compose exec web python3 manage.py makemessages -l sv + sudo -E docker compose cp web:/locale . compilemessages: - sudo -E docker-compose exec web python3 manage.py compilemessages -l en - - -build: - sudo -E docker-compose build - -down: - sudo -E docker-compose down + sudo -E docker compose cp ./locale web:. + sudo -E docker compose exec web python3 manage.py compilemessages -l en + sudo -E docker compose exec web python3 manage.py compilemessages -l sv diff --git a/README.md b/README.md index 43cea93..797e689 100644 --- a/README.md +++ b/README.md @@ -163,4 +163,4 @@ parameter in the url as defined in `urls.py`. The website is written with Swedish as its original language. In order to make a string translatable, it must be wrapped in a function. For details on how to do this in pyton code and template code respectively, see the [Django docs on translation](https://docs.djangoproject.com/en/2.1/topics/i18n/translation/). The mapping from Swedish to English lives in `locale/en/LC_MESSAGES/django.po -`. When you have edited a file and added strings that need to be created, run `make makemessages`. This will update the .po file to contain the new strings, whose translation can now be filled in. For the website to update, you need to compile the .po file. This can be done by running `make compilemessages`. If this does not work, try stopping the container using `make down` and starting it up again; the makefile is configured to compile the messages as the container starts. +`. When you have edited a file and added strings that need to be created, run `make makemessages`. This will update the .po file to contain the new strings, whose translation can now be filled in. For the website to update, you need to compile the .po file. This can be done by running `make compilemessages`. From 6bf554880d3638c0cb8c1fa9d1598d382bf7a559 Mon Sep 17 00:00:00 2001 From: icicel Date: Wed, 4 Sep 2024 20:27:57 +0200 Subject: [PATCH 03/10] Regenerate --- locale/en/LC_MESSAGES/django.po | 44 +-------------------------------- locale/sv/LC_MESSAGES/django.po | 5 +--- 2 files changed, 2 insertions(+), 47 deletions(-) diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 6ef78ff..524e52c 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-04 19:59+0200\n" +"POT-Creation-Date: 2024-09-04 20:27+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -338,45 +338,3 @@ msgstr "Studies" #: templates/top-nav-banner.html:23 msgid "Foton" msgstr "Photos" - -#~ msgid "Dbrus" -#~ msgstr "DBrus" - -#~ msgid "PingPong" -#~ msgstr "PingPong" - -#~ msgid "Chalmers Tekniska Högskola" -#~ msgstr "Chalmers University of Technology" - -#~ msgid "en del av Chalmers Studentkår" -#~ msgstr "part of Chalmers Student Union" - -#~ msgid "Jobb" -#~ msgstr "Jobs" - -#~ msgid "Twitter" -#~ msgstr "Twitter" - -#~ msgid "Twitter!" -#~ msgstr "Twitter!" - -#~ msgid "Reddit" -#~ msgstr "Reddit" - -#~ msgid "Schysst subreddit med stor potential" -#~ msgstr "Cool subreddit with huge potential" - -#~ msgid "Cremona" -#~ msgstr "Cremona" - -#~ msgid "Cremona bokhandel, numera kallat Store" -#~ msgstr "Cremona bookstore, now called Store" - -#~ msgid "IRC" -#~ msgstr "IRC" - -#~ msgid "Slack, fast utan GUI. För äkta Datateknologer!" -#~ msgstr "Slack, but without the GUI. For real computer geeks!" - -#~ msgid "Datateknologsektionen Full Title" -#~ msgstr "Student Division of Computer Science and Engineering" diff --git a/locale/sv/LC_MESSAGES/django.po b/locale/sv/LC_MESSAGES/django.po index 0795bee..227b6b9 100644 --- a/locale/sv/LC_MESSAGES/django.po +++ b/locale/sv/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-04 19:59+0200\n" +"POT-Creation-Date: 2024-09-04 20:27+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -325,6 +325,3 @@ msgstr "Studier" #: templates/top-nav-banner.html:23 msgid "Foton" msgstr "Foton" - -#~ msgid "Projektgrupp för arbetsmarknadsmässa" -#~ msgstr "Projektgrupp för arbetsmarknadsmässa" From 151980aeae1156d9a1fae19194c9964cb8141d83 Mon Sep 17 00:00:00 2001 From: icicel Date: Wed, 4 Sep 2024 20:40:35 +0200 Subject: [PATCH 04/10] Fewer commands --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 79cb7a6..ab4fcb1 100644 --- a/Makefile +++ b/Makefile @@ -22,11 +22,9 @@ refreshdb: sudo -E docker compose exec web python3 manage.py migrate makemessages: - sudo -E docker compose exec web python3 manage.py makemessages -l en - sudo -E docker compose exec web python3 manage.py makemessages -l sv + sudo -E docker compose exec web python3 manage.py makemessages -a sudo -E docker compose cp web:/locale . compilemessages: sudo -E docker compose cp ./locale web:. - sudo -E docker compose exec web python3 manage.py compilemessages -l en - sudo -E docker compose exec web python3 manage.py compilemessages -l sv + sudo -E docker compose exec web python3 manage.py compilemessages From c76d7cd0684e14508e6254037778219e848e4307 Mon Sep 17 00:00:00 2001 From: icicel Date: Wed, 4 Sep 2024 20:57:12 +0200 Subject: [PATCH 05/10] Auto-migrate and compile (?) --- Dockerfile | 4 +--- README.md | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f3925c9..e491d86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,9 +24,7 @@ ENV DB_PORT="5432" EXPOSE 80 -CMD ["uwsgi", "--socket", "0.0.0.0:3000", \ - "--protocol", "uwsgi", \ - "--module", "dtekportal.wsgi"] +CMD python3 manage.py migrate && python3 manage.py compilemessages && uwsgi --socket 0.0.0.0:3000 --protocol uwsgi --module dtekportal.wsgi #CMD /scripts/wait-for-it.sh "$DB_HOST:$DB_PORT" -- \ # uwsgi --http-socket ":$PORT" --module dtekportal.wsgi diff --git a/README.md b/README.md index 797e689..43cea93 100644 --- a/README.md +++ b/README.md @@ -163,4 +163,4 @@ parameter in the url as defined in `urls.py`. The website is written with Swedish as its original language. In order to make a string translatable, it must be wrapped in a function. For details on how to do this in pyton code and template code respectively, see the [Django docs on translation](https://docs.djangoproject.com/en/2.1/topics/i18n/translation/). The mapping from Swedish to English lives in `locale/en/LC_MESSAGES/django.po -`. When you have edited a file and added strings that need to be created, run `make makemessages`. This will update the .po file to contain the new strings, whose translation can now be filled in. For the website to update, you need to compile the .po file. This can be done by running `make compilemessages`. +`. When you have edited a file and added strings that need to be created, run `make makemessages`. This will update the .po file to contain the new strings, whose translation can now be filled in. For the website to update, you need to compile the .po file. This can be done by running `make compilemessages`. If this does not work, try stopping the container using `make down` and starting it up again; the makefile is configured to compile the messages as the container starts. From 22395423c5ad4ab6c5cb13e1ed3919d0124a3257 Mon Sep 17 00:00:00 2001 From: icicel Date: Wed, 4 Sep 2024 21:22:25 +0200 Subject: [PATCH 06/10] Remove fuzzy --- locale/en/LC_MESSAGES/django.po | 13 +------------ locale/sv/LC_MESSAGES/django.po | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 524e52c..aae659a 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-04 20:27+0200\n" +"POT-Creation-Date: 2024-09-04 21:03+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -43,17 +43,6 @@ msgstr "" "might want to go." #: homepage/templates/homepage/index/welcome-box.html:17 -#, fuzzy -#| msgid "" -#| "Datateknologsektionen är en icke vinstdrivande organisation som är till " -#| "för alla studenter på civilingenjörsprogrammet Datateknik på Chalmers och " -#| "dess relaterade masterprogram. Vi ordnar mottagning för nyantagna, " -#| "arrangerar fester, bedriver studiebevakning och mycket mer." msgid "" "Datateknologsektionen är en icke vinstdrivande organisation som är till för " "alla studenter på civilingenjörsprogrammet Datateknik på Chalmers och dess " diff --git a/locale/sv/LC_MESSAGES/django.po b/locale/sv/LC_MESSAGES/django.po index 227b6b9..ed3e476 100644 --- a/locale/sv/LC_MESSAGES/django.po +++ b/locale/sv/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-04 20:27+0200\n" +"POT-Creation-Date: 2024-09-04 21:03+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From b9b0c326b1df3c732f881f9991f7baaf8bc60736 Mon Sep 17 00:00:00 2001 From: icicel Date: Wed, 4 Sep 2024 21:29:39 +0200 Subject: [PATCH 07/10] Fuzzy docs --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 43cea93..360435e 100644 --- a/README.md +++ b/README.md @@ -162,5 +162,6 @@ parameter in the url as defined in `urls.py`. The website is written with Swedish as its original language. In order to make a string translatable, it must be wrapped in a function. For details on how to do this in pyton code and template code respectively, see the [Django docs on translation](https://docs.djangoproject.com/en/2.1/topics/i18n/translation/). -The mapping from Swedish to English lives in `locale/en/LC_MESSAGES/django.po -`. When you have edited a file and added strings that need to be created, run `make makemessages`. This will update the .po file to contain the new strings, whose translation can now be filled in. For the website to update, you need to compile the .po file. This can be done by running `make compilemessages`. If this does not work, try stopping the container using `make down` and starting it up again; the makefile is configured to compile the messages as the container starts. +The mapping from Swedish to English lives in `locale/en/LC_MESSAGES/django.po`. When you have edited a file and added strings that need to be created, run `make makemessages`. This will update the .po file to contain the new strings, whose translations can now be filled in. Any translation strings that have been marked as "fuzzy" will be ignored by Django, so make sure to clean those up before finishing. + +For the website to update, you need to compile the .po file. This can be done by running `make compilemessages`. If this does not work, try stopping the container using `make down` and starting it up again; the makefile is configured to compile the messages as the container starts. From 1c32f82cbed189200772c98f6ee395fbba0db141 Mon Sep 17 00:00:00 2001 From: icicel Date: Wed, 4 Sep 2024 21:39:29 +0200 Subject: [PATCH 08/10] Don't need that anymore --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index ab4fcb1..96e3215 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,6 @@ up-develop: sudo -E docker-compose run web /bin/sh -c "python3 manage.py compilemessages -l en" sudo -E docker-compose -f docker-compose.yml -f docker-compose.develop.yml up -refreshdb: - sudo -E docker compose exec web python3 manage.py migrate - makemessages: sudo -E docker compose exec web python3 manage.py makemessages -a sudo -E docker compose cp web:/locale . From 956b71aa908c964df8bb68fc7dd122f4541a9fdd Mon Sep 17 00:00:00 2001 From: icicel Date: Thu, 5 Sep 2024 12:37:19 +0200 Subject: [PATCH 09/10] Decleaned makefile --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 96e3215..691a020 100644 --- a/Makefile +++ b/Makefile @@ -25,3 +25,9 @@ makemessages: compilemessages: sudo -E docker compose cp ./locale web:. sudo -E docker compose exec web python3 manage.py compilemessages + +build: + sudo -E docker-compose build + +down: + sudo -E docker-compose down From 6b121032bfac4e82eec8d3fab94591223df4194f Mon Sep 17 00:00:00 2001 From: pingu Date: Thu, 5 Sep 2024 15:29:22 +0200 Subject: [PATCH 10/10] Fix make file and for develop mode --- Makefile | 24 ++++++++---------------- docker-compose.develop.yml | 5 ++++- scripts/boot.sh | 5 +++++ 3 files changed, 17 insertions(+), 17 deletions(-) create mode 100755 scripts/boot.sh diff --git a/Makefile b/Makefile index 691a020..f75448e 100644 --- a/Makefile +++ b/Makefile @@ -5,29 +5,21 @@ export $(shell sed 's/=.*//' .env) test: env -# delete this -up-prod: - sudo -E docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d - sudo -E docker-compose exec web /bin/sh -c "python3 manage.py migrate" - sudo -E docker-compose exec web /bin/sh -c "python3 manage.py compilemessages -l en" - sudo -E docker-compose exec web /bin/sh -c "python3 manage.py collectstatic --noinput" - -# delete this too up-develop: # sleep 5 && sudo docker-compose exec web /bin/sh -c "python3 manage.py migrate" & - sudo -E docker-compose run web /bin/sh -c "python3 manage.py compilemessages -l en" - sudo -E docker-compose -f docker-compose.yml -f docker-compose.develop.yml up + docker compose run web /bin/sh -c "python3 manage.py compilemessages -l en" + docker compose -f docker-compose.yml -f docker-compose.develop.yml up makemessages: - sudo -E docker compose exec web python3 manage.py makemessages -a - sudo -E docker compose cp web:/locale . + docker compose exec web python3 manage.py makemessages -a + docker compose cp web:/locale . compilemessages: - sudo -E docker compose cp ./locale web:. - sudo -E docker compose exec web python3 manage.py compilemessages + docker compose cp ./locale web:. + docker compose exec web python3 manage.py compilemessages build: - sudo -E docker-compose build + docker compose build down: - sudo -E docker-compose down + docker compose down diff --git a/docker-compose.develop.yml b/docker-compose.develop.yml index 8bc1ee5..ea93f3a 100644 --- a/docker-compose.develop.yml +++ b/docker-compose.develop.yml @@ -3,8 +3,11 @@ version: '3.7' services: web: # use wait for it script to make sure db is ready before launching - command: ["/scripts/wait-for-it.sh", "db:5432", "--", "python", "manage.py", "runserver", "0.0.0.0:8000"] + command: ["/scripts/boot.sh"] + ports: + - "8000:8000" volumes: - ./dtekportal:/code + - ./scripts:/scripts environment: - DJANGO_DEBUG=1 diff --git a/scripts/boot.sh b/scripts/boot.sh new file mode 100755 index 0000000..78aeec1 --- /dev/null +++ b/scripts/boot.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +python3 manage.py migrate +python3 manage.py compilemessages +exec /scripts/wait-for-it.sh db:5432 -- python manage.py runserver 0.0.0.0:8000