From eafc9ab658d7c7f3b306acf1ea5a8f7f9db44c90 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 16 Nov 2020 12:30:06 +0100 Subject: [PATCH 001/159] Hide tokens inside logs Especially from Websockets logs which contains auth token Signed-off-by: Thomas Citharel --- config/config.exs | 1 + 1 file changed, 1 insertion(+) diff --git a/config/config.exs b/config/config.exs index 6f7490ec2..01cd4e484 100644 --- a/config/config.exs +++ b/config/config.exs @@ -170,6 +170,7 @@ config :tesla, adapter: Tesla.Adapter.Hackney config :phoenix, :format_encoders, json: Jason, "activity-json": Jason config :phoenix, :json_library, Jason +config :phoenix, :filter_parameters, ["password", "token"] config :ex_cldr, default_locale: "en", From a7d78da3f8e3e179f9621e9f9de0c40589c39a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Miko=C5=82ajczak?= Date: Mon, 16 Nov 2020 12:48:34 +0000 Subject: [PATCH 002/159] Translated using Weblate (Polish) Currently translated at 69.7% (166 of 238 strings) Translation: Mobilizon/Backend Translate-URL: https://weblate.framasoft.org/projects/mobilizon/backend/pl/ --- priv/gettext/pl/LC_MESSAGES/default.po | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/priv/gettext/pl/LC_MESSAGES/default.po b/priv/gettext/pl/LC_MESSAGES/default.po index a11cef7e6..cc7adf1f8 100644 --- a/priv/gettext/pl/LC_MESSAGES/default.po +++ b/priv/gettext/pl/LC_MESSAGES/default.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-24 14:40+0000\n" -"PO-Revision-Date: 2020-11-13 13:00+0000\n" +"PO-Revision-Date: 2020-11-16 14:47+0000\n" "Last-Translator: Marcin Mikołajczak \n" "Language-Team: Polish \n" @@ -430,9 +430,13 @@ msgstr[2] "%{nb_events} wydarzeń zaplanowanych na ten tydzień" #, elixir-format msgid "One participation request for event %{title} to process" msgid_plural "%{number_participation_requests} participation requests for event %{title} to process" -msgstr[0] "" +msgstr[0] "Jedno zgłoszenie uczestnictwa dla wydarzenia %{title} do zatwierdzenia" msgstr[1] "" +"%{number_participation_requests} zgłoszenia uczestnictwa dla wydarzenia " +"%{title} do zatwierdzenia" msgstr[2] "" +"%{number_participation_requests} zgłoszeń uczestnictwa dla wydarzenia " +"%{title} do zatwierdzenia" #: lib/web/templates/email/notification_each_week.html.eex:38 #: lib/web/templates/email/notification_each_week.text.eex:4 @@ -939,6 +943,10 @@ msgstr "" #, elixir-format msgid "If you did not trigger this change yourself, it is likely that someone has gained access to your %{host} account. Please log in and change your password immediately. If you cannot login, contact the admin on %{host}." msgstr "" +"Jeżeli to nie Ty dokonałeś(-aś) tej zmiany, prawdopodobnie ktoś uzyskał " +"dostęp do Twojego konta na %{host}. Zaloguj się i natychmiastowo zmień " +"hasło. Jeżeli nie możesz się zalogować, skontaktuj się z administratorem " +"%{host}." #: lib/web/templates/email/password_reset.text.eex:12 #, elixir-format @@ -968,7 +976,7 @@ msgstr "Dowiedz się więcej o Mobilizon." #: lib/web/templates/email/event_updated.html.eex:94 #, elixir-format msgid "Location" -msgstr "" +msgstr "Miejsce" #: lib/web/templates/email/event_updated.html.eex:104 #, elixir-format @@ -1041,6 +1049,8 @@ msgstr "Potwierdzono wydarzenie" #, elixir-format msgid "This event has yet to be confirmed: organizers will let you know if they do confirm it." msgstr "" +"Wydarzenie nie zostało jeszcze potwierdzone, organizatorzy poinformują Cię " +"jeżeli zostanie potwierdzone." #: lib/web/templates/email/event_participation_rejected.html.eex:45 #: lib/web/templates/email/event_participation_rejected.text.eex:7 @@ -1244,7 +1254,7 @@ msgstr "" #, elixir-format msgctxt "terms" msgid "If you delete this information, you need to login again." -msgstr "" +msgstr "Jeżeli usuniesz te informacje, musisz zalogować się ponownie." #: lib/web/templates/api/privacy.html.eex:80 #, elixir-format From f598ab20000abd120eaabe28bb2abc51cd26e162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20=C3=98deg=C3=A5rd?= Date: Sun, 15 Nov 2020 20:36:20 +0000 Subject: [PATCH 003/159] Translated using Weblate (Norwegian Nynorsk) Currently translated at 100.0% (802 of 802 strings) Translation: Mobilizon/Frontend Translate-URL: https://weblate.framasoft.org/projects/mobilizon/frontend/nn/ --- js/src/i18n/nn.json | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/js/src/i18n/nn.json b/js/src/i18n/nn.json index 457b1208b..d67a8065b 100644 --- a/js/src/i18n/nn.json +++ b/js/src/i18n/nn.json @@ -21,11 +21,12 @@ "A user-friendly, emancipatory and ethical tool for gathering, organising, and mobilising.": "Eit brukarvenleg, frigjerande og etisk verktøy for å samla, organisera og mobilisera.", "A validation email was sent to {email}": "Ein stadfestingsepost er sendt til {email}", "API": "API", + "Abandon editing": "Avbryt redigeringa", "Abandon edition": "Forkast utgåve", "About": "Om", "About Mobilizon": "Om Mobilizon", "About this event": "Om dette arrangementet", - "About this instance": "Om denne instansen", + "About this instance": "Om denne nettstaden", "About {instance}": "Om {instance}", "Accept": "Godta", "Accepted": "Akseptert", @@ -84,7 +85,7 @@ "Back to previous page": "Tilbake til førre sida", "Banner": "Banner", "Before you can login, you need to click on the link inside it to validate your account.": "Før du kan logga inn, må du klikka på lenka der for å stadfesta brukarkontoen din.", - "Begins on": "Byrjar den", + "Begins on": "Byrjar", "Bold": "Halvfeit", "By @{group}": "Av @{group}", "By @{username}": "Av @{username}", @@ -118,7 +119,7 @@ "Confirm my participation": "Stadfest at eg deltek", "Confirm my particpation": "Stadfest at eg deltek", "Confirmed": "Stadfesta", - "Confirmed at": "Stadfesta den", + "Confirmed at": "Stadfesta", "Confirmed: Will happen": "Stadfesta: Kjem til å skje", "Congratulations, your account is now created!": "Gratulerer, kontoen din er ferdig!", "Contact": "Kontakt", @@ -194,7 +195,7 @@ "Don't show @{organizer} as event host alongside @{group}": "Ikkje syn @{organizer} som vert ved sidan av @{group}", "Draft": "Kladd", "Drafts": "Kladdar", - "Due on": "Forfell den", + "Due on": "Forfell", "Duplicate": "Kopier", "Edit": "Rediger", "Edit post": "Rediger innlegget", @@ -296,6 +297,7 @@ "If allowed by organizer": "Viss tilskiparen tillèt det", "If an account with this email exists, we just sent another confirmation email to {email}": "Viss det finst ein brukarkonto med denne epostadressa, har me akkurat sendt ein ny stadfestingsepost til {email}", "If this identity is the only administrator of some groups, you need to delete them before being able to delete this identity.": "Viss denne identiteten er den einaste administratoren for nokon grupper, må du sletta dei før du slettar identiteten.", + "If you are being asked for your federated indentity, it's composed of your username and your instance. For instance, the federated identity for your first profile is:": "Viss du blir spurt om den spreidde identiteten din, er den brukarnamnet og nettstaden din. Som døme viser me deg den spreidde identiteten for den fyrste profilen din, som er:", "If you have opted for manual validation of participants, Mobilizon will send you an email to inform you of new participations to be processed. You can choose the frequency of these notifications below.": "Viss du har skrudd på manuell godkjenning av deltakarar, vil Mobilizon senda deg ein epost når det kjem nye påmeldingar du må godkjenna. Du kan velja kor ofte desse epostane kjem under.", "If you want, you may send a message to the event organizer here.": "Viss du vil, kan du senda ei melding til arrangøren her.", "In the following context, an application is a software, either provided by the Mobilizon team or by a 3rd-party, used to interact with your instance.": "I denne samanhengen tyder \"program\" ei programvare, anten utvila av Mobilizon-laget eller ein tredjepart, som blir brukt for å samhandla med nettstaden din.", @@ -366,9 +368,11 @@ "Message": "Melding", "Mobilizon": "Mobilizon", "Mobilizon is a federated network. You can interact with this event from a different server.": "Mobilizon er eit spreidd nettverk. Du kan samhandla med denne hendinga frå ein annan tenar.", + "Mobilizon is a federated software, meaning you can interact - depending on your admin's federation settings - with content from other instances, such as joining groups or events that were created elsewhere.": "Mobilizon er spreidd programvare. Det tyder at du kan samhandla med innhald frå andre nettstader, til dømes bli med i grupper eller hendingar som vart oppretta andre stader. Dette kjem an på korleis styraren på nettstaden din har sett opp spreiing til andre nettstader.", "Mobilizon is a tool that helps you find, create and organise events.": "Mobilizon er eit verkty som hjelper deg å finna, oppretta og organisera hendingar.", "Mobilizon is not a giant platform, but a multitude of interconnected Mobilizon websites.": "Mobilizon er ikkje ein svær plattform, men ei mengd samankopla Mobilizon-nettstader.", "Mobilizon software": "Mobilizon-programvara", + "Mobilizon uses a system of profiles to compartiment your activities. You will be able to create as many profiles as you want.": "Mobilizon bruker ulike profilar for å skilja dei ulike aktivitetane dine. Du kan laga så mange profilar du vil.", "Mobilizon version": "Mobilizon-versjon", "Mobilizon will send you an email when the events you are attending have important changes: date and time, address, confirmation or cancellation, etc.": "Mobilizon sender deg ein epost dersom hendingane du deltek på har viktige endringar: dato og tid, adresse, stadfesting eller avlysing osb.", "Moderated comments (shown after approval)": "Kommentarar under gjennomsyn (blir synlege etter godkjenning)", @@ -392,6 +396,7 @@ "New note": "Nytt notat", "New password": "Nytt passord", "New profile": "Ny profil", + "Next": "Neste", "Next month": "Neste månad", "Next page": "Neste sida", "Next week": "Neste veka", @@ -440,10 +445,10 @@ "Number of places": "Tal plassar", "OK": "OK", "Old password": "Gamalt passord", - "On {date}": "Den {date}", - "On {date} ending at {endTime}": "Den {date}, slutt klokka {endTime}", - "On {date} from {startTime} to {endTime}": "Den {date} frå kl. {startTime} til {endTime}", - "On {date} starting at {startTime}": "Den {date}, startar klokka {startTime}", + "On {date}": "{date}", + "On {date} ending at {endTime}": "{date}, slutt klokka {endTime}", + "On {date} from {startTime} to {endTime}": "{date} frå kl. {startTime} til {endTime}", + "On {date} starting at {startTime}": "{date}, startar klokka {startTime}", "Only accessible through link": "Berre tilgjengeleg med denne lenka", "Only accessible through link (private)": "Berre tilgjengeleg med lenka (private)", "Only accessible to members of the group": "Berre tilgjengeleg for gruppemedlemer", @@ -497,12 +502,14 @@ "Posts": "Innlegg", "Powered by {mobilizon}. © 2018 - {date} The Mobilizon Contributors - Made with the financial support of {contributors}.": "Drive av {mobilizon}. © 2018 - {date} Mobilizon-bidragsytarane - laga med økonomisk støtte frå {contributors}.", "Preferences": "Innstillingar", + "Previous": "Førre", "Previous page": "Førre sida", "Privacy Policy": "Personvern", "Privacy policy": "Personvern", "Private event": "Privat hending", "Private feeds": "Private straumar", "Profiles": "Profilar", + "Profiles and federation": "Profilar og spreiing", "Promote": "Framhev", "Public": "Offentleg", "Public RSS/Atom Feed": "Offentleg RSS/Atom-straum", @@ -637,9 +644,11 @@ "This identity is not a member of any group.": "Denne identiteten er ikkje medlem av noka gruppe.", "This information is saved only on your computer. Click for details": "Desse opplysingane blir berre lagra på datamaskina di. Klikk for meir info", "This instance isn't opened to registrations, but you can register on other instances.": "Denne nettstaden tillèt ikkje nye registreringar, men du kan bli med på andre nettstader.", + "This instance, {instanceName} ({domain}), hosts your profile, so remember its name.": "Denne nettstaden, {instanceName} ({domain}), er vertskap for profilen din, så du bør hugsa kva han heiter.", "This is a demonstration site to test Mobilizon.": "Dette er ei demoside for å prøva ut Mobilizon.", "This is like your federated username ({username}) for groups. It will allow the group to be found on the federation, and is guaranteed to be unique.": "Dette er som det spreidde brukarnamnet ({username}) for grupper. Det gjer det mogleg å finna gruppa på heile nettverket, og vil garantert vera unikt.", "This month": "Denne månaden", + "This setting will be used to display the website and send you emails in the correct language.": "Denne innstillinga blir brukt til å visa nettsida og senda deg epostar på rett språk.", "This website isn't moderated and the data that you enter will be automatically destroyed every day at 00:01 (Paris timezone).": "Denne nettstaden er ikkje styrt, og alt du skriv her vil bli automatisk sletta kvar dag kl. 00:01 (Paris-tid).", "This week": "Denne veka", "This weekend": "I helga", @@ -756,6 +765,7 @@ "Your profile will be shown as contact.": "Profilen din blir vist som kontakt.", "Your timezone is currently set to {timezone}.": "Tidssonen din er {timezone}.", "Your timezone was detected as {timezone}.": "Me fann tidssonen {timezone}.", + "Your timezone {timezone} isn't supported.": "Tidssonen din {timezone} er ikkje støtta.", "[This comment has been deleted by it's author]": "[Skribenten har sletta denne kommentaren]", "[This comment has been deleted]": "[Denne kommentaren er sletta]", "[deleted]": "[sletta]", From e503330d67a0f5bd89bb675d6585616d50b0c17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20=C3=9Ar?= Date: Mon, 16 Nov 2020 00:48:16 +0000 Subject: [PATCH 004/159] Translated using Weblate (Hungarian) Currently translated at 100.0% (802 of 802 strings) Translation: Mobilizon/Frontend Translate-URL: https://weblate.framasoft.org/projects/mobilizon/frontend/hu/ --- js/src/i18n/hu.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/js/src/i18n/hu.json b/js/src/i18n/hu.json index 32e5fb1b1..4c9b5e858 100644 --- a/js/src/i18n/hu.json +++ b/js/src/i18n/hu.json @@ -49,10 +49,10 @@ "Add some tags": "Címkék hozzáadása", "Add to my calendar": "Hozzáadás a naptáramhoz", "Additional comments": "További hozzászólások", - "Admin": "Rendszergazda", - "Admin settings successfully saved.": "A rendszergazdai beállítások sikeresen mentve.", + "Admin": "Adminisztrátor", + "Admin settings successfully saved.": "Az adminisztrátori beállítások sikeresen mentve.", "Administration": "Adminisztráció", - "Administrator": "Rendszergazda", + "Administrator": "Adminisztrátor", "All good, let's continue!": "Minden rendben, menjünk tovább!", "All group members and other eventual server admins will still be able to view this information.": "Az összes csoporttag és más végleges kiszolgáló rendszergazdák továbbra is képesek lesznek megtekinteni ezt az információt.", "All the places have already been taken": "Az összes hely elfogyott|Egy hely még elérhető|{places} hely még elérhető", @@ -110,7 +110,7 @@ "Click to select": "Kattintson a kijelöléshez", "Click to upload": "Kattintson a feltöltéshez", "Close": "Lezárás", - "Close comments for all (except for admins)": "Hozzászólások lezárása mindenkinél (kivéve a rendszergazdáknál)", + "Close comments for all (except for admins)": "Hozzászólások lezárása mindenkinél (kivéve az adminisztrátoroknál)", "Closed": "Lezárva", "Comment deleted": "Hozzászólás törölve", "Comment from @{username} reported": "@{username} felhasználótól érkezett hozzászólás jelentve", @@ -240,7 +240,7 @@ "Exclude": "Kizárás", "Explore": "Felfedezés", "Explore events": "Események felfedezése", - "Failed to save admin settings": "Nem sikerült elmenteni a rendszergazdai beállításokat", + "Failed to save admin settings": "Nem sikerült elmenteni az adminisztrátori beállításokat", "Featured events": "Kiemelt események", "Federated Group Name": "Föderált csoportnév", "Federation": "Föderáció", @@ -296,7 +296,7 @@ "Identity {displayName} updated": "A(z) {displayName} személyazonosság frissítve", "If allowed by organizer": "Ha a szervező engedélyezi", "If an account with this email exists, we just sent another confirmation email to {email}": "Ha létezik fiók ezzel az e-mail-címmel, akkor elküldtünk egy másik megerősítő e-mailt erre a címre: {email}", - "If this identity is the only administrator of some groups, you need to delete them before being able to delete this identity.": "Ha ez a személyazonosság az egyetlen rendszergazdája néhány csoportnak, akkor törölnie kell azokat, mielőtt képes lenne törölni ezt a személyazonosságot.", + "If this identity is the only administrator of some groups, you need to delete them before being able to delete this identity.": "Ha ez a személyazonosság az egyetlen adminisztrátora néhány csoportnak, akkor törölnie kell azokat, mielőtt képes lenne törölni ezt a személyazonosságot.", "If you are being asked for your federated indentity, it's composed of your username and your instance. For instance, the federated identity for your first profile is:": "Ha a föderált személyazonosságáról kérdezik, akkor az a felhasználónevéből és a példányából tevődik össze. Például az első profiljának föderált személyazonossága:", "If you have opted for manual validation of participants, Mobilizon will send you an email to inform you of new participations to be processed. You can choose the frequency of these notifications below.": "Ha a résztvevők kézi ellenőrzését választotta, akkor a Mobilizon küldeni fog Önnek egy e-mailt, hogy tájékoztassa Önt a feldolgozandó új részvételekről. Alább kiválaszthatja ezen értesítések gyakoriságát.", "If you want, you may send a message to the event organizer here.": "Ha szeretné, itt küldhet üzenetet az esemény szervezőjének.", @@ -313,7 +313,7 @@ "Instance Terms": "Példány használati feltételei", "Instance Terms Source": "Példány használati feltételeinek forrása", "Instance Terms URL": "Példány használati feltételeinek URL-e", - "Instance administrator": "Példány rendszergazdája", + "Instance administrator": "Példány adminisztrátora", "Instance configuration": "Példány beállítása", "Instance languages": "Példány nyelvei", "Instance rules": "Példány szabályai", @@ -368,7 +368,7 @@ "Message": "Üzenet", "Mobilizon": "Mobilizon", "Mobilizon is a federated network. You can interact with this event from a different server.": "A Mobilizon egy föderált hálózat. Interakcióba léphet ezzel az eseménnyel egy eltérő kiszolgálóról is.", - "Mobilizon is a federated software, meaning you can interact - depending on your admin's federation settings - with content from other instances, such as joining groups or events that were created elsewhere.": "A Mobilizon egy föderált szoftver, ami azt jelenti, hogy a rendszergazda föderációs beállításaitól függően interakcióba léphet más példányokról származó tartalommal, vagyis csatlakozhat olyan csoportokhoz vagy eseményekhez, amelyeket máshol hoztak létre.", + "Mobilizon is a federated software, meaning you can interact - depending on your admin's federation settings - with content from other instances, such as joining groups or events that were created elsewhere.": "A Mobilizon egy föderált szoftver, ami azt jelenti, hogy az adminisztrátor föderációs beállításaitól függően interakcióba léphet más példányokról származó tartalommal, vagyis csatlakozhat olyan csoportokhoz vagy eseményekhez, amelyeket máshol hoztak létre.", "Mobilizon is a tool that helps you find, create and organise events.": "A Mobilizon egy olyan eszköz, amely segít Önnek eseményeket keresni, létrehozni és szervezni.", "Mobilizon is not a giant platform, but a multitude of interconnected Mobilizon websites.": "A Mobilizon nem egy hatalmas platform, hanem kölcsönösen összekapcsolt Mobilizon weboldalak sokasága.", "Mobilizon software": "Mobilizon szoftver", @@ -386,7 +386,7 @@ "My events": "Saját események", "My groups": "Saját csoportok", "My identities": "Saját személyazonosságok", - "NOTE! The default terms have not been checked over by a lawyer and thus are unlikely to provide full legal protection for all situations for an instance admin using them. They are also not specific to all countries and jurisdictions. If you are unsure, please check with a lawyer.": "MEGJEGYZÉS! Az alapértelmezett használati feltételek nem lettek jogász által ellenőrizve, és ennélfogva nem valószínű, hogy minden helyzetben teljes jogi védelmet biztosít az azt használó példány rendszergazdájának. Továbbá nem tér ki az összes országra és igazságszolgáltatásra. Ha nem biztos a dolgában, akkor ellenőriztesse egy jogásszal.", + "NOTE! The default terms have not been checked over by a lawyer and thus are unlikely to provide full legal protection for all situations for an instance admin using them. They are also not specific to all countries and jurisdictions. If you are unsure, please check with a lawyer.": "MEGJEGYZÉS! Az alapértelmezett használati feltételek nem lettek jogász által ellenőrizve, és ennélfogva nem valószínű, hogy minden helyzetben teljes jogi védelmet biztosít az azt használó példány adminisztrátorának. Továbbá nem tér ki az összes országra és igazságszolgáltatásra. Ha nem biztos a dolgában, akkor ellenőriztesse egy jogásszal.", "Name": "Név", "New discussion": "Új megbeszélés", "New email": "Új e-mail", @@ -466,7 +466,7 @@ "Other": "Egyéb", "Other notification options:": "Egyéb értesítési lehetőségek:", "Other software may also support this.": "Más szoftverek is támogathatják ezt.", - "Otherwise this identity will just be removed from the group administrators.": "Egyébként ez a személyazonosság el lesz távolítva a csoport rendszergazdáiból.", + "Otherwise this identity will just be removed from the group administrators.": "Egyébként ez a személyazonosság el lesz távolítva a csoport adminisztrátoraiból.", "Page": "Oldal", "Page limited to my group (asks for auth)": "Az oldal korlátozva van a csoportomra (hitelesítést kér)", "Parent folder": "Szülőmappa", @@ -490,11 +490,11 @@ "Pick an identity": "Válasszon személyazonosságot", "Pick an instance": "Válasszon példányt", "Please check your spam folder if you didn't receive the email.": "Nézze meg a levélszemét mappát, ha nem kapta meg az e-mailt.", - "Please contact this instance's Mobilizon admin if you think this is a mistake.": "Vegye fel a kapcsolatot a példány Mobilizon rendszergazdájával, ha úgy gondolja, hogy ez hiba.", + "Please contact this instance's Mobilizon admin if you think this is a mistake.": "Vegye fel a kapcsolatot a példány Mobilizon adminisztrátorával, ha úgy gondolja, hogy ez hiba.", "Please do not use it in any real way.": "Ne használja semmilyen valódi módon.", "Please enter your password to confirm this action.": "Adja meg a jelszavát a művelet megerősítéséhez.", "Please make sure the address is correct and that the page hasn't been moved.": "Győződjön meg arról, hogy a cím helyes és hogy az oldalt nem helyezték át.", - "Please read the {fullRules} published by {instance}'s administrators.": "Olvassa el a(z) {instance} rendszergazdái által közzétett {fullRules}.", + "Please read the {fullRules} published by {instance}'s administrators.": "Olvassa el a(z) {instance} adminisztrátorai által közzétett {fullRules}.", "Post": "Hozzászólás", "Post a comment": "Hozzászólás beküldése", "Post a reply": "Válasz beküldése", @@ -622,9 +622,9 @@ "The event will show as attributed to your personal profile.": "Az esemény az Ön személyes profiljának tulajdonítva lesz megjelenítve.", "The event will show the group as organizer.": "Az esemény szervezőként fogja megjeleníteni a csoportot.", "The group will be publicly listed in search results and may be suggested in the explore section. Only public informations will be shown on it's page.": "A csoport nyilvánosan fel lesz sorolva a keresési eredményekben, és ajánlva is lehet a felfedezés szakaszban. Csak nyilvános információk lesznek megjelenítve az oldalán.", - "The instance administrator is the person or entity that runs this Mobilizon instance.": "A példány rendszergazdája az a személy vagy jogi személy, aki ezt a Mobilizon példányt futtatja.", + "The instance administrator is the person or entity that runs this Mobilizon instance.": "A példány adminisztrátora az a személy vagy jogi személy, aki ezt a Mobilizon példányt futtatja.", "The member was removed from the group {group}": "A tag el lett távolítva ebből a csoportból: {group}", - "The only way for your group to get new members is if an admininistrator invites them.": "Az egyetlen mód a csoportja számára, hogy új tagokat szerezzen, ha egy rendszergazda meghívja őket.", + "The only way for your group to get new members is if an admininistrator invites them.": "Az egyetlen mód a csoportja számára, hogy új tagokat szerezzen, ha egy adminisztrátor meghívja őket.", "The organiser has chosen to close comments.": "A szervező azt választotta, hogy lezárja a hozzászólásokat.", "The page you're looking for doesn't exist.": "A keresett oldal nem létezik.", "The password was successfully changed": "A jelszó sikeresen meg lett változtatva", @@ -719,7 +719,7 @@ "Why create an account?": "Miért hozzon létre fiókot?", "Will allow to display and manage your participation status on the event page when using this device. Uncheck if you're using a public device.": "Lehetővé fogja tenni a részvételi állapotának megjelenítést és kezelését az esemény oldalán, ha ezt az eszközt használja. Törölje a bejelölést, ha nyilvános eszközt használ.", "Write something…": "Írjon valamit…", - "You are not an administrator for this group.": "Ön nem rendszergazda ennél a csoportnál.", + "You are not an administrator for this group.": "Ön nem adminisztrátor ennél a csoportnál.", "You are participating in this event anonymously": "Névtelenül vesz részt ezen az eseményen", "You are participating in this event anonymously but didn't confirm participation": "Névtelenül vesz részt ezen az eseményen, de nem erősítette meg a részvételét", "You can add tags by hitting the Enter key or by adding a comma": "Hozzáadhat címkéket az Enter billentyű lenyomásával vagy egy vessző hozzáadásával", From ad2577e988937c8d7ad0d42cd88ed4a47e714b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20=C3=9Ar?= Date: Mon, 16 Nov 2020 00:48:45 +0000 Subject: [PATCH 005/159] Translated using Weblate (Hungarian) Currently translated at 100.0% (170 of 170 strings) Translation: Mobilizon/Backend errors Translate-URL: https://weblate.framasoft.org/projects/mobilizon/backend-errors/hu/ --- priv/gettext/hu/LC_MESSAGES/errors.po | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/priv/gettext/hu/LC_MESSAGES/errors.po b/priv/gettext/hu/LC_MESSAGES/errors.po index 68aacb782..f6dcc3e86 100644 --- a/priv/gettext/hu/LC_MESSAGES/errors.po +++ b/priv/gettext/hu/LC_MESSAGES/errors.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-06 00:33+0000\n" -"PO-Revision-Date: 2020-11-06 07:28+0000\n" +"PO-Revision-Date: 2020-11-16 14:47+0000\n" "Last-Translator: Balázs Úr \n" "Language-Team: Hungarian \n" @@ -127,7 +127,7 @@ msgstr "A jelenlegi profil nem tagja ennek a csoportnak" #: lib/graphql/resolvers/group.ex:207 #, elixir-format msgid "Current profile is not an administrator of the selected group" -msgstr "A jelenlegi profil nem rendszergazdája a kijelölt csoportnak" +msgstr "A jelenlegi profil nem adminisztrátora a kijelölt csoportnak" #: lib/graphql/resolvers/user.ex:512 #, elixir-format @@ -254,7 +254,7 @@ msgstr "Már tagja ennek a csoportnak" #: lib/graphql/resolvers/group.ex:287 #, elixir-format msgid "You can't leave this group because you are the only administrator" -msgstr "Nem hagyhatja el ezt a csoportot, mert Ön az egyedüli rendszergazda" +msgstr "Nem hagyhatja el ezt a csoportot, mert Ön az egyedüli adminisztrátor" #: lib/graphql/resolvers/group.ex:251 #, elixir-format @@ -304,7 +304,7 @@ msgstr "Bejelentkezve kell lennie egy csoport frissítéséhez" #: lib/graphql/resolvers/user.ex:58 #, elixir-format msgid "You need to have admin access to list users" -msgstr "Rendszergazdai hozzáférésre van szüksége a felhasználók felsorolásához" +msgstr "Adminisztrátori hozzáférésre van szüksége a felhasználók felsorolásához" #: lib/graphql/resolvers/user.ex:108 #, elixir-format @@ -339,13 +339,13 @@ msgstr "Nem található távoli profil ezzel az azonosítóval" #: lib/graphql/resolvers/actor.ex:69 #, elixir-format msgid "Only moderators and administrators can suspend a profile" -msgstr "Csak moderátorok és rendszergazdák függeszthetnek fel egy profilt" +msgstr "Csak moderátorok és adminisztrátorok függeszthetnek fel egy profilt" #: lib/graphql/resolvers/actor.ex:99 #, elixir-format msgid "Only moderators and administrators can unsuspend a profile" msgstr "" -"Csak moderátorok és rendszergazdák szüntethetik meg egy profil " +"Csak moderátorok és adminisztrátorok szüntethetik meg egy profil " "felfüggesztését" #: lib/graphql/resolvers/actor.ex:24 @@ -371,7 +371,7 @@ msgstr "A névtelen részvétel nincs engedélyezve" #: lib/graphql/resolvers/person.ex:188 #, elixir-format msgid "Cannot remove the last administrator of a group" -msgstr "Nem lehet eltávolítani egy csoport utolsó rendszergazdáját" +msgstr "Nem lehet eltávolítani egy csoport utolsó adminisztrátorát" #: lib/graphql/resolvers/person.ex:185 #, elixir-format @@ -580,7 +580,7 @@ msgstr "Nem tagja ennek a csoportnak" #: lib/graphql/resolvers/member.ex:154 #, elixir-format msgid "You are not a moderator or admin for this group" -msgstr "Nem moderátor vagy rendszergazda ennél a csoportnál" +msgstr "Nem moderátor vagy adminisztrátor ennél a csoportnál" #: lib/graphql/resolvers/comment.ex:55 #, elixir-format @@ -619,7 +619,7 @@ msgstr "" msgid "You can't set yourself to a lower member role for this group because you are the only administrator" msgstr "" "Nem állíthatja magát alacsonyabb tagszerepre ennél a csoportnál, mert Ön az " -"egyedüli rendszergazda" +"egyedüli adminisztrátor" #: lib/graphql/resolvers/comment.ex:105 #, elixir-format @@ -673,22 +673,22 @@ msgstr "" #, elixir-format msgid "You need to be logged-in and an administrator to access admin settings" msgstr "" -"Bejelentkezve kell lennie és rendszergazdának kell lennie a rendszergazdai " -"beállításokhoz való hozzáféréshez" +"Bejelentkezve kell lennie és adminisztrátornak kell lennie az " +"adminisztrátori beállításokhoz való hozzáféréshez" #: lib/graphql/resolvers/admin.ex:205 #, elixir-format msgid "You need to be logged-in and an administrator to access dashboard statistics" msgstr "" -"Bejelentkezve kell lennie és rendszergazdának kell lennie a vezérlőpulti " +"Bejelentkezve kell lennie és adminisztrátornak kell lennie a vezérlőpulti " "statisztikákhoz való hozzáféréshez" #: lib/graphql/resolvers/admin.ex:244 #, elixir-format msgid "You need to be logged-in and an administrator to save admin settings" msgstr "" -"Bejelentkezve kell lennie és rendszergazdának kell lennie a rendszergazdai " -"beállítások mentéséhez" +"Bejelentkezve kell lennie és adminisztrátornak kell lennie az " +"adminisztrátori beállítások mentéséhez" #: lib/graphql/resolvers/discussion.ex:66 #, elixir-format @@ -869,7 +869,7 @@ msgstr "A fájl nem rendelkezik engedélyezett MIME-típussal." #: lib/graphql/resolvers/group.ex:172 #, elixir-format msgid "Profile is not administrator for the group" -msgstr "A profil nem rendszergazda ennél a csoportnál" +msgstr "A profil nem adminisztrátor ennél a csoportnál" #: lib/graphql/resolvers/event.ex:241 #, elixir-format From c06fe5e686025d13b76a29695376c1c3263bea35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20=C3=98deg=C3=A5rd?= Date: Mon, 16 Nov 2020 14:09:46 +0000 Subject: [PATCH 006/159] Translated using Weblate (Norwegian Nynorsk) Currently translated at 31.1% (53 of 170 strings) Translation: Mobilizon/Backend errors Translate-URL: https://weblate.framasoft.org/projects/mobilizon/backend-errors/nn/ --- priv/gettext/nn/LC_MESSAGES/errors.po | 92 +++++++++++++-------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/priv/gettext/nn/LC_MESSAGES/errors.po b/priv/gettext/nn/LC_MESSAGES/errors.po index 2cc5edc4c..e31708ba7 100644 --- a/priv/gettext/nn/LC_MESSAGES/errors.po +++ b/priv/gettext/nn/LC_MESSAGES/errors.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-11-14 11:02+0000\n" -"PO-Revision-Date: 2020-11-14 11:53+0000\n" +"PO-Revision-Date: 2020-11-16 14:47+0000\n" "Last-Translator: Eivind Ødegård \n" "Language-Team: Norwegian Nynorsk \n" @@ -75,102 +75,102 @@ msgstr[1] "skal ha %{count} einingar" msgid "should be at least %{count} character(s)" msgid_plural "should be at least %{count} character(s)" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "må vera minst %{count} teikn" +msgstr[1] "må vera minst %{count} teikn" msgid "should have at least %{count} item(s)" msgid_plural "should have at least %{count} item(s)" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "må ha minst %{count} oppføring" +msgstr[1] "må ha minst %{count} oppføringar" msgid "should be at most %{count} character(s)" msgid_plural "should be at most %{count} character(s)" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "kan ikkje ha meir enn %{count} teikn" +msgstr[1] "kan ikkje ha meir enn %{count} teikn" msgid "should have at most %{count} item(s)" msgid_plural "should have at most %{count} item(s)" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "kan ikkje ha meir enn %{count} oppføring" +msgstr[1] "kan ikkje ha meir enn %{count} oppføringar" ## From Ecto.Changeset.validate_number/3 msgid "must be less than %{number}" -msgstr "" +msgstr "må vera mindre enn %{number}" msgid "must be greater than %{number}" -msgstr "" +msgstr "må vera større enn %{number}" msgid "must be less than or equal to %{number}" -msgstr "" +msgstr "må vera mindre enn eller lik %{number}" msgid "must be greater than or equal to %{number}" -msgstr "" +msgstr "må vera større enn eller lik %{number}" msgid "must be equal to %{number}" -msgstr "" +msgstr "må vera lik %{number}" #: lib/graphql/resolvers/user.ex:103 #, elixir-format msgid "Cannot refresh the token" -msgstr "" +msgstr "Kan ikkje fornya teiknet" #: lib/graphql/resolvers/group.ex:139 #, elixir-format msgid "Creator profile is not owned by the current user" -msgstr "" +msgstr "Denne brukaren eig ikkje opphavsprofilen" #: lib/graphql/resolvers/group.ex:203 #, elixir-format msgid "Current profile is not a member of this group" -msgstr "" +msgstr "Denne brukaren er ikkje medlem av gruppa" #: lib/graphql/resolvers/group.ex:207 #, elixir-format msgid "Current profile is not an administrator of the selected group" -msgstr "" +msgstr "Denne brukaren er ikkje styrar av gruppa" #: lib/graphql/resolvers/user.ex:512 #, elixir-format msgid "Error while saving user settings" -msgstr "" +msgstr "Greidde ikkje lagra brukarinnstillingane" #: lib/graphql/error.ex:90 lib/graphql/resolvers/group.ex:200 #: lib/graphql/resolvers/group.ex:248 lib/graphql/resolvers/group.ex:283 lib/graphql/resolvers/member.ex:83 #, elixir-format msgid "Group not found" -msgstr "" +msgstr "Fann ikkje gruppa" #: lib/graphql/resolvers/group.ex:69 #, elixir-format msgid "Group with ID %{id} not found" -msgstr "" +msgstr "Fann ikkje gruppa med ID %{id}" #: lib/graphql/resolvers/user.ex:83 #, elixir-format msgid "Impossible to authenticate, either your email or password are invalid." -msgstr "" +msgstr "Greier ikkje å logga inn. Epostadressa eller passordet ditt er feil." #: lib/graphql/resolvers/group.ex:280 #, elixir-format msgid "Member not found" -msgstr "" +msgstr "Fann ikkje medlemen" #: lib/graphql/resolvers/actor.ex:58 lib/graphql/resolvers/actor.ex:88 #: lib/graphql/resolvers/user.ex:417 #, elixir-format msgid "No profile found for the moderator user" -msgstr "" +msgstr "Fann ingen profil for moderator-brukaren" #: lib/graphql/resolvers/user.ex:195 #, elixir-format msgid "No user to validate with this email was found" -msgstr "" +msgstr "Fann ingen brukar med denne eposten å godkjenna" #: lib/graphql/resolvers/person.ex:232 lib/graphql/resolvers/user.ex:76 #: lib/graphql/resolvers/user.ex:219 #, elixir-format msgid "No user with this email was found" -msgstr "" +msgstr "Fann ingen brukar med denne eposten" #: lib/graphql/resolvers/comment.ex:50 lib/graphql/resolvers/comment.ex:112 #: lib/graphql/resolvers/event.ex:286 lib/graphql/resolvers/feed_token.ex:28 lib/graphql/resolvers/group.ex:245 @@ -181,103 +181,103 @@ msgstr "" #: lib/graphql/resolvers/todos.ex:57 #, elixir-format msgid "Profile is not owned by authenticated user" -msgstr "" +msgstr "Ingen godkjent brukar eig denne profilen" #: lib/graphql/resolvers/user.ex:125 #, elixir-format msgid "Registrations are not open" -msgstr "" +msgstr "Det er ikkje opna for å registrera seg" #: lib/graphql/resolvers/user.ex:330 #, elixir-format msgid "The current password is invalid" -msgstr "" +msgstr "Dette passordet er ugyldig" #: lib/graphql/resolvers/user.ex:382 #, elixir-format msgid "The new email doesn't seem to be valid" -msgstr "" +msgstr "Den nye epostadressa ser ut til å vera feil" #: lib/graphql/resolvers/user.ex:379 #, elixir-format msgid "The new email must be different" -msgstr "" +msgstr "Den nye epostadressa må vera annleis" #: lib/graphql/resolvers/user.ex:333 #, elixir-format msgid "The new password must be different" -msgstr "" +msgstr "Det nye passordet må vera annleis" #: lib/graphql/resolvers/user.ex:376 lib/graphql/resolvers/user.ex:439 #: lib/graphql/resolvers/user.ex:442 #, elixir-format msgid "The password provided is invalid" -msgstr "" +msgstr "Dette passordet er ugyldig" #: lib/graphql/resolvers/user.ex:337 #, elixir-format msgid "The password you have chosen is too short. Please make sure your password contains at least 6 characters." -msgstr "" +msgstr "Dette passordet er for kort. Passord må ha minst 6 teikn." #: lib/graphql/resolvers/user.ex:215 #, elixir-format msgid "This user can't reset their password" -msgstr "" +msgstr "Denne brukaren kan ikkje nullstilla passordet sitt" #: lib/graphql/resolvers/user.ex:79 #, elixir-format msgid "This user has been disabled" -msgstr "" +msgstr "Denne brukaren er avskrudd" #: lib/graphql/resolvers/user.ex:179 #, elixir-format msgid "Unable to validate user" -msgstr "" +msgstr "Greier ikkje godkjenna brukaren" #: lib/graphql/resolvers/user.ex:420 #, elixir-format msgid "User already disabled" -msgstr "" +msgstr "Brukaren er allereie inaktiv" #: lib/graphql/resolvers/user.ex:487 #, elixir-format msgid "User requested is not logged-in" -msgstr "" +msgstr "Den førespurte brukaren er ikkje innlogga" #: lib/graphql/resolvers/group.ex:254 #, elixir-format msgid "You are already a member of this group" -msgstr "" +msgstr "Du er allereie medlem av denne gruppa" #: lib/graphql/resolvers/group.ex:287 #, elixir-format msgid "You can't leave this group because you are the only administrator" -msgstr "" +msgstr "Du kan ikkje forlata denne gruppa, fordi du er den einaste styraren" #: lib/graphql/resolvers/group.ex:251 #, elixir-format msgid "You cannot join this group" -msgstr "" +msgstr "Du kan ikkje bli med i denne gruppa" #: lib/graphql/resolvers/group.ex:97 #, elixir-format msgid "You may not list groups unless moderator." -msgstr "" +msgstr "Du kan ikkje lista opp grupper med mindre du er moderator." #: lib/graphql/resolvers/user.ex:387 #, elixir-format msgid "You need to be logged-in to change your email" -msgstr "" +msgstr "Du må vera innlogga for å endra epostadressa di" #: lib/graphql/resolvers/user.ex:345 #, elixir-format msgid "You need to be logged-in to change your password" -msgstr "" +msgstr "Du må vera innlogga for å endra passordet ditt" #: lib/graphql/resolvers/group.ex:212 #, elixir-format msgid "You need to be logged-in to delete a group" -msgstr "" +msgstr "Du må vera innlogga for å sletta ei gruppe" #: lib/graphql/resolvers/user.ex:447 #, elixir-format From 13fb242c82eafa550b76099af1565b9a4f43514f Mon Sep 17 00:00:00 2001 From: Ivan Vandot Date: Mon, 16 Nov 2020 23:28:29 +0100 Subject: [PATCH 007/159] set permissions for /app/uploads for volume mount --- docker/production/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 71b3e4e57..cc67e3f16 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -33,6 +33,8 @@ FROM alpine RUN apk add --no-cache openssl ncurses-libs file postgresql-client +RUN mkdir -p /app/uploads && chown nobody:nobody /app/uploads + USER nobody EXPOSE 4000 From fdc8536c6f362526d435525a5480244b67aed520 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 16 Nov 2020 18:28:52 +0100 Subject: [PATCH 008/159] Use user timezone in emails Signed-off-by: Thomas Citharel --- lib/mobilizon/events/events.ex | 10 +++- lib/web/email/event.ex | 60 ++++++++++++++++--- .../templates/email/event_updated.html.eex | 4 +- .../templates/email/event_updated.text.eex | 4 +- .../email/notification_each_week.html.eex | 4 +- .../email/notification_each_week.text.eex | 7 +-- lib/web/views/email_view.ex | 11 ++++ 7 files changed, 80 insertions(+), 20 deletions(-) diff --git a/lib/mobilizon/events/events.ex b/lib/mobilizon/events/events.ex index d5dfb9b52..38d10dcb1 100644 --- a/lib/mobilizon/events/events.ex +++ b/lib/mobilizon/events/events.ex @@ -30,7 +30,7 @@ defmodule Mobilizon.Events do alias Mobilizon.Service.Workers alias Mobilizon.Share alias Mobilizon.Storage.{Page, Repo} - alias Mobilizon.Users.User + alias Mobilizon.Users.{Setting, User} alias Mobilizon.Web.Email @@ -1587,16 +1587,22 @@ defmodule Mobilizon.Events do ) end + @doc """ + List emails for local users (including anonymous ones) participating to an event + + Returns {participation, actor, user, user_settings} + """ @spec list_local_emails_user_participants_for_event_query(String.t()) :: Ecto.Query.t() def list_local_emails_user_participants_for_event_query(event_id) do Participant |> join(:inner, [p], a in Actor, on: p.actor_id == a.id and is_nil(a.domain)) |> join(:left, [_p, a], u in User, on: a.user_id == u.id) + |> join(:left, [_p, _a, u], s in Setting, on: s.user_id == u.id) |> where( [p], p.event_id == ^event_id and p.role not in [^:not_approved, ^:not_confirmed, ^:rejected] ) - |> select([p, a, u], {p, a, u}) + |> select([p, a, u, s], {p, a, u, s}) end @spec list_participations_for_user_query(integer()) :: Ecto.Query.t() diff --git a/lib/web/email/event.ex b/lib/web/email/event.ex index b4cd2e0ee..b7b36e481 100644 --- a/lib/web/email/event.ex +++ b/lib/web/email/event.ex @@ -13,7 +13,7 @@ defmodule Mobilizon.Web.Email.Event do alias Mobilizon.Events alias Mobilizon.Events.{Event, Participant} alias Mobilizon.Storage.Repo - alias Mobilizon.Users.User + alias Mobilizon.Users.{Setting, User} alias Mobilizon.Web.Email alias Mobilizon.Web.Gettext, as: GettextBackend @@ -28,6 +28,7 @@ defmodule Mobilizon.Web.Email.Event do %Event{} = old_event, %Event{} = event, changes, + timezone \\ "Etc/UTC", locale \\ "en" ) do GettextBackend.put_locale(locale) @@ -44,6 +45,7 @@ defmodule Mobilizon.Web.Email.Event do |> assign(:old_event, old_event) |> assign(:changes, changes) |> assign(:subject, subject) + |> assign(:timezone, timezone) |> render(:event_updated) end @@ -75,18 +77,42 @@ defmodule Mobilizon.Web.Email.Event do defp send_notification_for_event_update_to_participant( {%Participant{} = _participant, %Actor{} = actor, - %User{locale: locale, email: email} = _user}, + %User{locale: locale, email: email} = _user, %Setting{timezone: timezone}}, %Event{} = old_event, %Event{} = event, diff ) do - email - |> Email.Event.event_updated(actor, old_event, event, diff, locale) - |> Email.Mailer.deliver_later() + do_send_notification_for_event_update_to_participant( + email, + actor, + old_event, + event, + diff, + timezone, + locale + ) end defp send_notification_for_event_update_to_participant( - {%Participant{metadata: %{email: email}} = _participant, %Actor{} = actor, nil}, + {%Participant{} = _participant, %Actor{} = actor, + %User{locale: locale, email: email} = _user, nil}, + %Event{} = old_event, + %Event{} = event, + diff + ) do + do_send_notification_for_event_update_to_participant( + email, + actor, + old_event, + event, + diff, + "Etc/UTC", + locale + ) + end + + defp send_notification_for_event_update_to_participant( + {%Participant{metadata: %{email: email}} = _participant, %Actor{} = actor, nil, nil}, %Event{} = old_event, %Event{} = event, diff @@ -94,8 +120,28 @@ defmodule Mobilizon.Web.Email.Event do when not is_nil(email) do locale = Gettext.get_locale() + do_send_notification_for_event_update_to_participant( + email, + actor, + old_event, + event, + diff, + "Etc/UTC", + locale + ) + end + + defp do_send_notification_for_event_update_to_participant( + email, + actor, + old_event, + event, + diff, + timezone, + locale + ) do email - |> Email.Event.event_updated(actor, old_event, event, diff, locale) + |> Email.Event.event_updated(actor, old_event, event, diff, timezone, locale) |> Email.Mailer.deliver_later() end end diff --git a/lib/web/templates/email/event_updated.html.eex b/lib/web/templates/email/event_updated.html.eex index a58ec69b7..f6539b2e8 100644 --- a/lib/web/templates/email/event_updated.html.eex +++ b/lib/web/templates/email/event_updated.html.eex @@ -74,7 +74,7 @@ <%= gettext "Start" %> - <%= datetime_to_string(@event.begins_on, @locale) %> + <%= @event.begins_on |> datetime_tz_convert(@timezone) |> datetime_to_string(@locale) %> <% end %> @@ -84,7 +84,7 @@ <%= gettext "End" %> - <%= datetime_to_string(@event.ends_on, @locale) %> + <%= @event.ends_on |> datetime_tz_convert(@timezone) |> datetime_to_string(@locale) %> <% end %> diff --git a/lib/web/templates/email/event_updated.text.eex b/lib/web/templates/email/event_updated.text.eex index ae6137975..d65225f13 100644 --- a/lib/web/templates/email/event_updated.text.eex +++ b/lib/web/templates/email/event_updated.text.eex @@ -15,10 +15,10 @@ <%= gettext "New title: %{title}", title: @event.title %> <% end %> <%= if MapSet.member?(@changes, :begins_on) do %> - <%= gettext "Start %{begins_on}", begins_on: datetime_to_string(@event.begins_on, @locale) %> + <%= gettext "Start %{begins_on}", begins_on: @event.begins_on |> datetime_tz_convert(@timezone) |> datetime_to_string(@locale) %> <% end %> <%= if MapSet.member?(@changes, :ends_on) && !is_nil(@event.ends_on) do %> - <%= gettext "End %{ends_on}", ends_on: datetime_to_string(@event.ends_on, @locale) %> + <%= gettext "End %{ends_on}", ends_on: @event.ends_on |> datetime_tz_convert(@timezone) |> datetime_to_string(@locale) %> <% end %> <%= gettext "Visit the updated event page: %{link}", link: page_url(Mobilizon.Web.Endpoint, :event, @event.uuid) %> <%= ngettext "Would you wish to cancel your attendance, visit the event page through the link above and click the « Attending » button.", "Would you wish to cancel your attendance to one or several events, visit the event pages through the links above and click the « Attending » button.", 1 %> diff --git a/lib/web/templates/email/notification_each_week.html.eex b/lib/web/templates/email/notification_each_week.html.eex index a1349e15c..c27c23018 100644 --- a/lib/web/templates/email/notification_each_week.html.eex +++ b/lib/web/templates/email/notification_each_week.html.eex @@ -46,7 +46,7 @@ <%= for participation <- @participations do %>
  • - <%= participation.event.begins_on |> DateTime.shift_zone!(@timezone) |> datetime_to_string(@locale) %> + <%= participation.event.begins_on |> datetime_tz_convert(@timezone) |> datetime_to_string(@locale) %> <%= participation.event.title %> @@ -56,7 +56,7 @@ <% else %> - <%= @participation.event.begins_on |> DateTime.shift_zone!(@timezone) |> datetime_to_string(@locale) %> + <%= @participation.event.begins_on |> datetime_tz_convert(@timezone) |> datetime_to_string(@locale) %> <%= @participation.event.title %> diff --git a/lib/web/templates/email/notification_each_week.text.eex b/lib/web/templates/email/notification_each_week.text.eex index 2721442ca..e0c2c3cbe 100644 --- a/lib/web/templates/email/notification_each_week.text.eex +++ b/lib/web/templates/email/notification_each_week.text.eex @@ -1,14 +1,11 @@ <%= gettext "What's up this week?" %> == - <%= ngettext "You have one event this week:", "You have %{total} events this week:", @total, total: @total %> - <%= if @total > 1 do %> <%= for participation <- @participations do %> - - <%= participation.event.begins_on |> DateTime.shift_zone!(@timezone) |> datetime_to_string(@locale) %> - <%= participation.event.title %> <%= page_url(Mobilizon.Web.Endpoint, :event, participation.event.uuid) %> + - <%= participation.event.begins_on |> datetime_tz_convert(@timezone) |> datetime_to_string(@locale) %> - <%= participation.event.title %> <%= page_url(Mobilizon.Web.Endpoint, :event, participation.event.uuid) %> <% end %> <% else %> - <%= DateTime.shift_zone!(@participation.event.begins_on, @timezone) |> datetime_to_string(@locale) %> - <%= @participation.event.title %> <%= page_url(Mobilizon.Web.Endpoint, :event, @participation.event.uuid) %> + <%= @participation.event.begins_on |> datetime_tz_convert(@timezone) |> datetime_to_string(@locale) %> - <%= @participation.event.title %> <%= page_url(Mobilizon.Web.Endpoint, :event, @participation.event.uuid) %> <% end %> - <%= ngettext "Would you wish to cancel your attendance, visit the event page through the link above and click the « Attending » button.", "Would you wish to cancel your attendance to one or several events, visit the event pages through the links above and click the « Attending » button.", @total %> diff --git a/lib/web/views/email_view.ex b/lib/web/views/email_view.ex index 74fada640..fb3d6141c 100644 --- a/lib/web/views/email_view.ex +++ b/lib/web/views/email_view.ex @@ -16,4 +16,15 @@ defmodule Mobilizon.Web.EmailView do string end end + + @spec datetime_tz_convert(DateTime.t(), String.t()) :: DateTime.t() + def datetime_tz_convert(%DateTime{} = datetime, timezone) do + case DateTime.shift_zone(datetime, timezone) do + {:ok, datetime_with_user_tz} -> + datetime_with_user_tz + + _ -> + datetime + end + end end From 5d9a36917d0ee8fb039672792aad0af94fc39356 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 17 Nov 2020 10:57:04 +0100 Subject: [PATCH 009/159] Fix register sentense string See https://framacolibri.org/t/sinscrire-sur-mobilizon-affiche-au-lieu-du-nom-de-linstance/9838 Signed-off-by: Thomas Citharel --- js/src/i18n/en_US.json | 1 - js/src/i18n/fr_FR.json | 1 - js/src/mixins/identityEdition.ts | 4 ++-- js/src/views/Account/Register.vue | 14 ++++++++++++-- js/src/views/User/Register.vue | 13 ++++++++++++- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 67a625d7e..bfe0ce95f 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -277,7 +277,6 @@ "Published events with {comments} comments and {participations} confirmed participations": "Published events with {comments} comments and {participations} confirmed participations", "RSS/Atom Feed": "RSS/Atom Feed", "Region": "Region", - "Register an account on Mobilizon!": "Register an account on Mobilizon!", "Registration is allowed, anyone can register.": "Registration is allowed, anyone can register.", "Registration is closed.": "Registration is closed.", "Registration is currently closed.": "Registration is currently closed.", diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index a38dadceb..5dda93cf1 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -563,7 +563,6 @@ "Refresh profile": "Rafraîchir le profil", "Region": "Région", "Register": "S'inscrire", - "Register an account on Mobilizon!": "S'inscrire sur Mobilizon !", "Register an account on {instanceName}!": "S'inscrire sur {instanceName} !", "Register for an event by choosing one of your identities": "S'inscrire à un évènement en choisissant une de vos identités", "Register on this instance": "S'inscrire sur cette instance", diff --git a/js/src/mixins/identityEdition.ts b/js/src/mixins/identityEdition.ts index e3ecd5f04..0669e99a1 100644 --- a/js/src/mixins/identityEdition.ts +++ b/js/src/mixins/identityEdition.ts @@ -8,7 +8,7 @@ export default class IdentityEditionMixin extends Mixins(Vue) { oldDisplayName: string | null = null; - autoUpdateUsername(newDisplayName: string | null) { + autoUpdateUsername(newDisplayName: string | null): void { const oldUsername = IdentityEditionMixin.convertToUsername(this.oldDisplayName); if (this.identity.preferredUsername === oldUsername) { @@ -30,7 +30,7 @@ export default class IdentityEditionMixin extends Mixins(Vue) { .replace(/[^a-z0-9_]/g, ""); } - validateUsername() { + validateUsername(): boolean { return ( this.identity.preferredUsername === IdentityEditionMixin.convertToUsername(this.identity.preferredUsername) diff --git a/js/src/views/Account/Register.vue b/js/src/views/Account/Register.vue index 926b190d0..fcb1fd319 100644 --- a/js/src/views/Account/Register.vue +++ b/js/src/views/Account/Register.vue @@ -5,7 +5,9 @@

    {{ $t("Congratulations, your account is now created!") }}

    -

    {{ $t("Register an account on Mobilizon!") }}

    +

    + {{ $t("Register an account on {instanceName}!", { instanceName: config.name }) }} +

    {{ $t("Now, create your first profile:") }}

    @@ -92,6 +94,8 @@ } |> HTML.raw()] end - defp maybe_add_group_schema(tags, _), do: tags - # Insert JSON-LD schema by hand because Tag.content_tag wants to escape it defp json(%Actor{} = group) do "group.json" diff --git a/lib/service/metadata/instance.ex b/lib/service/metadata/instance.ex index aef15f862..5c88e4478 100644 --- a/lib/service/metadata/instance.ex +++ b/lib/service/metadata/instance.ex @@ -7,11 +7,15 @@ defmodule Mobilizon.Service.Metadata.Instance do alias Phoenix.HTML.Tag alias Mobilizon.Config - alias Mobilizon.Service.Formatter.HTML, as: HTMLFormatter + alias Mobilizon.Service.Metadata.Utils alias Mobilizon.Web.Endpoint + @doc """ + Build the list of tags for the instance + """ + @spec build_tags() :: list(Phoenix.HTML.safe()) def build_tags do - description = process_description(Config.instance_description()) + description = Utils.process_description(Config.instance_description()) title = "#{Config.instance_name()} - Mobilizon" instance_json_ld = """ @@ -38,11 +42,4 @@ defmodule Mobilizon.Service.Metadata.Instance do HTML.raw(instance_json_ld) ] end - - defp process_description(description) do - description - |> HTMLFormatter.strip_tags() - |> String.slice(0..200) - |> (&"#{&1}…").() - end end diff --git a/lib/service/metadata/metadata.ex b/lib/service/metadata/metadata.ex index eb58edb70..01def810f 100644 --- a/lib/service/metadata/metadata.ex +++ b/lib/service/metadata/metadata.ex @@ -1,7 +1,13 @@ defprotocol Mobilizon.Service.Metadata do - @doc """ - Build tags + @moduledoc """ + Service that allows producing metadata HTML tags about content """ + @doc """ + Build tags for an entity. Returns a list of `t:Phoenix.HTML.safe/0` tags. + + Locale can be provided to generate fallback descriptions. + """ + @spec build_tags(any(), String.t()) :: list(Phoenix.HTML.safe()) def build_tags(entity, locale \\ "en") end diff --git a/lib/service/metadata/utils.ex b/lib/service/metadata/utils.ex index f2c25bdf4..1fddcba1f 100644 --- a/lib/service/metadata/utils.ex +++ b/lib/service/metadata/utils.ex @@ -9,28 +9,63 @@ defmodule Mobilizon.Service.Metadata.Utils do @slice_limit 200 - @spec stringify_tags(Enum.t()) :: String.t() + @doc """ + Converts list of tags, containing either `t:Phoenix.HTML.safe/0` or strings, to a concatenated string listing the tags + """ + @spec stringify_tags(list(Phoenix.HTML.safe() | String.t())) :: String.t() def stringify_tags(tags), do: Enum.reduce(tags, "", &stringify_tag/2) - defp stringify_tag(tag, acc) when is_tuple(tag), do: acc <> HTML.safe_to_string(tag) - defp stringify_tag(tag, acc) when is_binary(tag), do: acc <> tag - + @doc """ + Removes the HTML tags from a text + """ @spec strip_tags(String.t()) :: String.t() - def strip_tags(text), do: HTMLFormatter.strip_tags(text) + def strip_tags(text), do: HTMLFormatter.strip_tags_and_insert_spaces(text) + @doc """ + Processes a text and limits it. + + * Removes the HTML tags from a text + * Slices it to a limit and add an ellipsis character + * Returns a default description if text is empty + """ @spec process_description(String.t(), String.t(), integer()) :: String.t() def process_description(description, locale \\ "en", limit \\ @slice_limit) def process_description(nil, locale, limit), do: process_description("", locale, limit) def process_description("", locale, _limit) do - Gettext.put_locale(locale) - gettext("The event organizer didn't add any description.") + default_description(locale) end def process_description(description, _locale, limit) do description - |> HTMLFormatter.strip_tags() - |> String.slice(0..limit) - |> (&"#{&1}…").() + |> HTMLFormatter.strip_tags_and_insert_spaces() + |> String.trim() + |> maybe_slice(limit) end + + @doc """ + Returns the default description for a text + """ + @spec default_description(String.t()) :: String.t() + def default_description(locale \\ "en") do + Gettext.put_locale(locale) + gettext("The event organizer didn't add any description.") + end + + defp maybe_slice(description, limit) do + if String.length(description) > limit do + description + |> String.slice(0..limit) + |> String.trim() + |> (&"#{&1}…").() + else + description + end + end + + @spec stringify_tag(Phoenix.HTML.safe(), String.t()) :: String.t() + defp stringify_tag(tag, acc) when is_tuple(tag), do: acc <> HTML.safe_to_string(tag) + + @spec stringify_tag(String.t(), String.t()) :: String.t() + defp stringify_tag(tag, acc) when is_binary(tag), do: acc <> tag end From 72cd3e688d705e17c5dfed9a10c45156c7d502a0 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 17 Nov 2020 15:45:42 +0100 Subject: [PATCH 015/159] Add tests for metadata Signed-off-by: Thomas Citharel --- test/service/metadata/instance_test.exs | 24 ++++ test/service/metadata/metadata_test.exs | 143 ++++++++++++++++++++++++ test/service/metadata/utils_test.exs | 60 ++++++++++ 3 files changed, 227 insertions(+) create mode 100644 test/service/metadata/instance_test.exs create mode 100644 test/service/metadata/metadata_test.exs create mode 100644 test/service/metadata/utils_test.exs diff --git a/test/service/metadata/instance_test.exs b/test/service/metadata/instance_test.exs new file mode 100644 index 000000000..8e7033e80 --- /dev/null +++ b/test/service/metadata/instance_test.exs @@ -0,0 +1,24 @@ +defmodule Mobilizon.Service.Metadata.InstanceTest do + alias Mobilizon.Config + alias Mobilizon.Service.Metadata.{Instance, Utils} + alias Mobilizon.Web.Endpoint + use Mobilizon.DataCase + + describe "build_tags/0 for the instance" do + test "gives tags" do + title = "#{Config.instance_name()} - Mobilizon" + description = Utils.process_description(Config.instance_description()) + + assert Instance.build_tags() |> Utils.stringify_tags() == + "#{title}\n" + end + end +end diff --git a/test/service/metadata/metadata_test.exs b/test/service/metadata/metadata_test.exs new file mode 100644 index 000000000..478d2f0a5 --- /dev/null +++ b/test/service/metadata/metadata_test.exs @@ -0,0 +1,143 @@ +defmodule Mobilizon.Service.MetadataTest do + alias Mobilizon.Actors.Actor + alias Mobilizon.Discussions.Comment + alias Mobilizon.Events.Event + alias Mobilizon.Posts.Post + alias Mobilizon.Service.Metadata + alias Mobilizon.Tombstone + use Mobilizon.DataCase + import Mobilizon.Factory + + describe "build_tags/2 for an actor" do + test "that is a group gives tags" do + %Actor{} = group = insert(:group, name: "My group") + + assert group |> Metadata.build_tags() |> Metadata.Utils.stringify_tags() == + "" + + assert group + |> Map.put(:avatar, nil) + |> Metadata.build_tags() + |> Metadata.Utils.stringify_tags() == + "" + end + + test "that is not a group doesn't give anything" do + %Actor{} = person = insert(:actor) + + assert person |> Metadata.build_tags() |> Metadata.Utils.stringify_tags() == "" + assert person |> Metadata.build_tags("fr") |> Metadata.Utils.stringify_tags() == "" + end + end + + describe "build_tags/2 for an event" do + test "gives tags" do + alias Mobilizon.Web.Endpoint + + %Event{} = event = insert(:event) + + # Because the description in Schema.org data is double-escaped + a = "\n" + b = "\\n" + + assert event + |> Metadata.build_tags() + |> Metadata.Utils.stringify_tags() == + "#{event.title} - Mobilizon" + + assert event + |> Map.put(:picture, nil) + |> Metadata.build_tags() + |> Metadata.Utils.stringify_tags() == + "#{event.title} - Mobilizon" + end + end + + describe "build_tags/2 for a post" do + test "gives tags" do + %Post{} = post = insert(:post) + + assert post + |> Metadata.build_tags() + |> Metadata.Utils.stringify_tags() == + "" + end + end + + describe "build_tags/2 for a comment" do + test "gives tags" do + %Comment{} = comment = insert(:comment) + + assert comment + |> Metadata.build_tags() + |> Metadata.Utils.stringify_tags() == + "" + end + end + + describe "build_tags/2 for a tombstone" do + test "gives nothing" do + %Tombstone{} = tombstone = insert(:tombstone) + + assert tombstone + |> Metadata.build_tags() + |> Metadata.Utils.stringify_tags() == "" + end + end +end diff --git a/test/service/metadata/utils_test.exs b/test/service/metadata/utils_test.exs new file mode 100644 index 000000000..9ba6742ae --- /dev/null +++ b/test/service/metadata/utils_test.exs @@ -0,0 +1,60 @@ +defmodule Mobilizon.Service.Metadata.UtilsTest do + alias Mobilizon.Service.Metadata.Utils + use Mobilizon.DataCase + + describe "process_description/3" do + test "process_description/3 strip tags" do + assert Utils.process_description("

    This is my biography

    ") == "This is my biography" + end + + test "process_description/3 cuts after a limit" do + assert Utils.process_description("

    This is my biography

    ", "fr", 10) == + "This is my…" + end + + test "process_description/3 cuts after the default limit" do + assert Utils.process_description( + "

    Biography

    It all started when someone wanted a very long string to be cut. However it's difficult to invent things to write when you've got nothing to say. Anyway, what's the deal here. We just need to reach 200 characters.", + "fr" + ) == + "Biography It all started when someone wanted a very long string to be cut. However it's difficult to invent things to write when you've got nothing to say. Anyway, what's the deal here. We…" + end + + test "process_description/3 returns default if no description is provided" do + assert Utils.process_description(nil) == + "The event organizer didn't add any description." + + assert Utils.process_description("", "en") == + "The event organizer didn't add any description." + end + end + + describe "default_description/1" do + test "returns default description with a correct locale" do + assert Utils.default_description("en") == "The event organizer didn't add any description." + end + + test "returns default description with no locale provided" do + assert Utils.default_description() == "The event organizer didn't add any description." + end + end + + describe "stringify_tags/1" do + test "converts tags to string" do + alias Phoenix.HTML.Tag + + tag_1 = Tag.tag(:meta, property: "og:url", content: "one") + tag_2 = "" + tag_3 = Tag.tag(:meta, property: "og:url", content: "three") + + assert Utils.stringify_tags([tag_1, tag_2, tag_3]) == + "" + end + end + + describe "strip_tags/1" do + test "removes tags from string" do + assert Utils.strip_tags("

    Hello

    How are you

    ") == "Hello How are you" + end + end +end From e6077d0dc3e2426d771cf81ed5e2e387c2348649 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 17 Nov 2020 19:14:55 +0100 Subject: [PATCH 016/159] Forbid creating usernames with uppercase characters We don't actually enforce anything on the ActivityPub level, only user-facing interfaces Signed-off-by: Thomas Citharel --- js/src/i18n/en_US.json | 2 +- js/src/i18n/fr_FR.json | 2 +- js/src/views/Account/Register.vue | 13 +- .../views/Account/children/EditIdentity.vue | 4 +- js/src/views/Group/Create.vue | 25 +- js/tests/e2e/specs/login.js | 2 +- lib/graphql/resolvers/group.ex | 1 + lib/graphql/resolvers/person.ex | 4 +- lib/mobilizon/actors/actor.ex | 7 +- priv/gettext/ar/LC_MESSAGES/default.po | 18 +- priv/gettext/ar/LC_MESSAGES/errors.po | 138 +- priv/gettext/be/LC_MESSAGES/default.po | 18 +- priv/gettext/be/LC_MESSAGES/errors.po | 138 +- priv/gettext/ca/LC_MESSAGES/default.po | 480 +++--- priv/gettext/ca/LC_MESSAGES/errors.po | 326 ++-- priv/gettext/cs/LC_MESSAGES/default.po | 18 +- priv/gettext/cs/LC_MESSAGES/errors.po | 138 +- priv/gettext/de/LC_MESSAGES/default.po | 18 +- priv/gettext/de/LC_MESSAGES/errors.po | 138 +- priv/gettext/default.pot | 16 +- priv/gettext/en/LC_MESSAGES/default.po | 18 +- priv/gettext/en/LC_MESSAGES/errors.po | 138 +- priv/gettext/errors.pot | 138 +- priv/gettext/es/LC_MESSAGES/default.po | 480 +++--- priv/gettext/es/LC_MESSAGES/errors.po | 326 ++-- priv/gettext/fi/LC_MESSAGES/default.po | 480 +++--- priv/gettext/fi/LC_MESSAGES/errors.po | 326 ++-- priv/gettext/fr/LC_MESSAGES/default.po | 426 ++++- priv/gettext/fr/LC_MESSAGES/errors.po | 134 +- priv/gettext/gl/LC_MESSAGES/default.po | 480 +++--- priv/gettext/gl/LC_MESSAGES/errors.po | 326 ++-- priv/gettext/hu/LC_MESSAGES/default.po | 1369 +++++++++++++++++ priv/gettext/hu/LC_MESSAGES/errors.po | 326 ++-- priv/gettext/it/LC_MESSAGES/default.po | 480 +++--- priv/gettext/it/LC_MESSAGES/errors.po | 326 ++-- priv/gettext/ja/LC_MESSAGES/default.po | 18 +- priv/gettext/ja/LC_MESSAGES/errors.po | 138 +- priv/gettext/nl/LC_MESSAGES/default.po | 18 +- priv/gettext/nl/LC_MESSAGES/errors.po | 138 +- priv/gettext/nn/LC_MESSAGES/default.po | 480 +++--- priv/gettext/nn/LC_MESSAGES/errors.po | 326 ++-- priv/gettext/oc/LC_MESSAGES/default.po | 480 +++--- priv/gettext/oc/LC_MESSAGES/errors.po | 326 ++-- priv/gettext/pl/LC_MESSAGES/default.po | 480 +++--- priv/gettext/pl/LC_MESSAGES/errors.po | 326 ++-- priv/gettext/pt/LC_MESSAGES/default.po | 18 +- priv/gettext/pt/LC_MESSAGES/errors.po | 138 +- priv/gettext/pt_BR/LC_MESSAGES/default.po | 18 +- priv/gettext/pt_BR/LC_MESSAGES/errors.po | 138 +- priv/gettext/ru/LC_MESSAGES/default.po | 18 +- priv/gettext/ru/LC_MESSAGES/errors.po | 138 +- priv/gettext/sv/LC_MESSAGES/default.po | 18 +- priv/gettext/sv/LC_MESSAGES/errors.po | 138 +- test/graphql/resolvers/user_test.exs | 601 +++----- test/mobilizon/actors/actors_test.exs | 10 +- 55 files changed, 6436 insertions(+), 4808 deletions(-) create mode 100644 priv/gettext/hu/LC_MESSAGES/default.po diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index bfe0ce95f..918c1a7d6 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -231,7 +231,7 @@ "On {date} starting at {startTime}": "On {date} starting at {startTime}", "On {date}": "On {date}", "Only accessible through link (private)": "Only accessible through link (private)", - "Only alphanumeric characters and underscores are supported.": "Only alphanumeric characters and underscores are supported.", + "Only alphanumeric lowercased characters and underscores are supported.": "Only alphanumeric lowercased characters and underscores are supported.", "Open": "Open", "Opened reports": "Opened reports", "Or": "Or", diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 5dda93cf1..34663c42c 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -480,7 +480,7 @@ "Only accessible through link": "Accessible uniquement par le lien", "Only accessible through link (private)": "Uniquement accessible par lien (privé)", "Only accessible to members of the group": "Accessible uniquement aux membres du groupe", - "Only alphanumeric characters and underscores are supported.": "Seuls les caractères alphanumériques et les tirets bas sont acceptés.", + "Only alphanumeric lowercased characters and underscores are supported.": "Seuls les caractères alphanumériques minuscules et les tirets bas sont acceptés.", "Only group moderators can create, edit and delete posts.": "Seul·e·s les modérateur·rice·s du groupe peuvent créer, éditer et supprimer des billets.", "Open": "Ouvert", "Opened reports": "Signalements ouverts", diff --git a/js/src/views/Account/Register.vue b/js/src/views/Account/Register.vue index fcb1fd319..3d60c96bc 100644 --- a/js/src/views/Account/Register.vue +++ b/js/src/views/Account/Register.vue @@ -26,12 +26,21 @@ :type="errors.preferred_username ? 'is-danger' : null" :message="errors.preferred_username" > - +

    @{{ host }} @@ -164,7 +173,7 @@ export default class Register extends mixins(identityEditionMixin) { } catch (errorCatched) { this.errors = errorCatched.graphQLErrors.reduce( (acc: { [key: string]: string }, error: any) => { - acc[error.details] = error.message; + acc[error.details || error.field] = error.message; return acc; }, {} diff --git a/js/src/views/Account/children/EditIdentity.vue b/js/src/views/Account/children/EditIdentity.vue index dcb45e14f..6054c1e22 100644 --- a/js/src/views/Account/children/EditIdentity.vue +++ b/js/src/views/Account/children/EditIdentity.vue @@ -181,7 +181,9 @@ export default class EditIdentity extends mixins(identityEditionMixin) { get message(): string | null { if (this.isUpdate) return null; - return this.$t("Only alphanumeric characters and underscores are supported.") as string; + return this.$t( + "Only alphanumeric lowercased characters and underscores are supported." + ) as string; } get avatarUrl(): string | null { diff --git a/js/src/views/Group/Create.vue b/js/src/views/Group/Create.vue index 7ac235de1..b6ae99f40 100644 --- a/js/src/views/Group/Create.vue +++ b/js/src/views/Group/Create.vue @@ -1,6 +1,6 @@ diff --git a/js/src/components/Group/GroupMemberCard.vue b/js/src/components/Group/GroupMemberCard.vue index f00689077..0b94eacdd 100644 --- a/js/src/components/Group/GroupMemberCard.vue +++ b/js/src/components/Group/GroupMemberCard.vue @@ -54,7 +54,9 @@ diff --git a/js/src/components/Map/Vue2LeafletLocateControl.vue b/js/src/components/Map/Vue2LeafletLocateControl.vue index 9a69db9f0..df2de381e 100644 --- a/js/src/components/Map/Vue2LeafletLocateControl.vue +++ b/js/src/components/Map/Vue2LeafletLocateControl.vue @@ -17,13 +17,13 @@ import { Component, Prop, Vue } from "vue-property-decorator"; @Component({ beforeDestroy() { - // eslint-disable-next-line @typescript-eslint/ban-ts-ignore + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore this.parentContainer.removeLayer(this); }, }) export default class Vue2LeafletLocateControl extends Vue { - @Prop({ type: Object, default: () => ({}) }) options!: object; + @Prop({ type: Object, default: () => ({}) }) options!: Record; @Prop({ type: Boolean, default: true }) visible = true; @@ -33,7 +33,7 @@ export default class Vue2LeafletLocateControl extends Vue { parentContainer: any; - mounted() { + mounted(): void { this.mapObject = L.control.locate(this.options); DomEvent.on(this.mapObject, this.$listeners as any); propsBinder(this, this.mapObject, this.$props); @@ -42,7 +42,7 @@ export default class Vue2LeafletLocateControl extends Vue { this.mapObject.addTo(this.parentContainer.mapObject, !this.visible); } - public locate() { + public locate(): void { this.mapObject.start(); } } diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue index 5af8b3f00..6846f78eb 100644 --- a/js/src/components/NavBar.vue +++ b/js/src/components/NavBar.vue @@ -109,13 +109,14 @@ import { Component, Vue, Watch } from "vue-property-decorator"; import Logo from "@/components/Logo.vue"; import { GraphQLError } from "graphql"; import { loadLanguageAsync } from "@/utils/i18n"; +import { ICurrentUserRole } from "@/types/enums"; import { CURRENT_USER_CLIENT, USER_SETTINGS } from "../graphql/user"; import { changeIdentity, logout } from "../utils/auth"; import { CURRENT_ACTOR_CLIENT, IDENTITIES, UPDATE_DEFAULT_ACTOR } from "../graphql/actor"; import { IPerson, Person } from "../types/actor"; import { CONFIG } from "../graphql/config"; import { IConfig } from "../types/config.model"; -import { ICurrentUser, ICurrentUserRole, IUser } from "../types/current-user.model"; +import { ICurrentUser, IUser } from "../types/current-user.model"; import SearchField from "./SearchField.vue"; import RouteName from "../router/name"; diff --git a/js/src/components/Participation/ConfirmParticipation.vue b/js/src/components/Participation/ConfirmParticipation.vue index 8630e0362..a72c8d4d6 100644 --- a/js/src/components/Participation/ConfirmParticipation.vue +++ b/js/src/components/Participation/ConfirmParticipation.vue @@ -38,9 +38,9 @@ diff --git a/js/src/views/Moderation/Logs.vue b/js/src/views/Moderation/Logs.vue index c5369f9ec..b0cc89c6f 100644 --- a/js/src/views/Moderation/Logs.vue +++ b/js/src/views/Moderation/Logs.vue @@ -158,9 +158,10 @@ diff --git a/js/src/components/Map.vue b/js/src/components/Map.vue index 00ebaa3a3..0d52fd943 100644 --- a/js/src/components/Map.vue +++ b/js/src/components/Map.vue @@ -8,7 +8,11 @@ @click="clickMap" @update:zoom="updateZoom" > - + + - {{ line }}
    + {{ line }}
    @@ -51,7 +57,10 @@ export default class Map extends Vue { @Prop({ type: String, required: true }) coords!: string; - @Prop({ type: Object, required: false }) marker!: { text: string | string[]; icon: string }; + @Prop({ type: Object, required: false }) marker!: { + text: string | string[]; + icon: string; + }; @Prop({ type: Object, required: false }) options!: Record; @@ -125,7 +134,8 @@ export default class Map extends Vue { get attribution(): string { return ( - this.config.maps.tiles.attribution || (this.$t("© The OpenStreetMap Contributors") as string) + this.config.maps.tiles.attribution || + (this.$t("© The OpenStreetMap Contributors") as string) ); } } diff --git a/js/src/components/Map/Vue2LeafletLocateControl.vue b/js/src/components/Map/Vue2LeafletLocateControl.vue index df2de381e..c7afaad7e 100644 --- a/js/src/components/Map/Vue2LeafletLocateControl.vue +++ b/js/src/components/Map/Vue2LeafletLocateControl.vue @@ -23,7 +23,10 @@ import { Component, Prop, Vue } from "vue-property-decorator"; }, }) export default class Vue2LeafletLocateControl extends Vue { - @Prop({ type: Object, default: () => ({}) }) options!: Record; + @Prop({ type: Object, default: () => ({}) }) options!: Record< + string, + unknown + >; @Prop({ type: Boolean, default: true }) visible = true; diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue index 6846f78eb..53fdfcfc4 100644 --- a/js/src/components/NavBar.vue +++ b/js/src/components/NavBar.vue @@ -1,7 +1,15 @@ @@ -187,7 +195,9 @@ export default class CreateGroup extends mixins(IdentityEditionMixin) { } private handleError(err: any) { - this.errors.push(...err.graphQLErrors.map(({ message }: { message: string }) => message)); + this.errors.push( + ...err.graphQLErrors.map(({ message }: { message: string }) => message) + ); } } diff --git a/js/src/views/Group/Group.vue b/js/src/views/Group/Group.vue index 858ef5827..616a494dd 100644 --- a/js/src/views/Group/Group.vue +++ b/js/src/views/Group/Group.vue @@ -4,7 +4,9 @@