Mastodon: How to configure custom signup questions
Mastodon administrators can enable manual review for signups. This blog post shows how to add a custom question to receive relevant input for this manual review.
The Mastodon instance eupolicy.social is geared towards people who identify themselves as part of the EU Bubble. Purposfully, there is no definition provided and indeed the instance is a bit flexible on what EU Bubble would mean.
To help the instance keep this focus (and avoid spam), the admins have opted for approval-based registration of signups. New users can during their signup process provide some text about themselves. To make this more relevant, eupolicy.social decided to customise the text that instructs the users to describe their relation with the instance:
Previously, the instance admins changed all language files in a source code copy of the locales folder. This was tidysome and can easily break with an update, especially when using a docker/podman-based setup that contains already all language files.
How to overwrite individual language/translation strings Permalink
The underlying Ruby on Rails loads all string (by alphabetic order) from yml
files in a folder that is by default /config/locales
. Files loaded later can overwrite strings from files loaded earlier. To overwrite a string, you have to find the identifier first, e.g. in the English language file.
en:
[…]
auth:
[…]
sign_in:
preamble_html: Login with your <strong>%{domain}</strong> credentials. If your account is hosted on a different server, you will not be able to log in here.
title: Login to %{domain}
sign_up:
manual_review: Sign-ups on %{domain} go through manual review by our moderators. To help us process your registration, write a bit about yourself and why you want an account on %{domain}.
[…]
To change the string auth.sign_up.manual_review
in all languages, I have created a new language file called zz-custom-signup-message.yml
here below. The prefix zz
puts the file at the very end given the alphabetic ordering.
If Mastodon admins use a local git clone of the Mastodon source code, this file can stay in the folder and won’t cause conflicts when language files receive updates via git.
If Mastodon admins use the Container image with Docker or Podman, they can mount this file into the setup with podman run -v ./zz-custom-signup-message.yml:/config/locales/zz-custom-signup-message.yml:z,ro […]
. With Container compose file, this would look like:
services:
web:
container_name: "mastodon-web"
image: ghcr.io/mastodon/mastodon:$MASTODON_VERSION
restart: always
[…]
volumes:
- ./container-volumes/mastodon/public/system:/mastodon/public/system
- ./zz-custom-signup-message.yml:/opt/mastodon/config/locales/zz-custom-signup-message.yml:z,ro
[…]
---
en:
auth:
sign_up:
manual_review: |
Please describe how you are part of the EU policy bubble. If you are not sure what to write here, maybe another Mastodon server might suit you better.
de:
auth:
sign_up:
manual_review: |
Auf welche Weise sind Sie mit der EU-Politik-Bubble verbunden? Wenn Sie nicht sicher sind, was in dieses Feld soll, möchten Sie sich vielleicht einen anderen Mastodon-Server aussuchen.
fr:
auth:
sign_up:
manual_review: |
Comment faites-vous parti de la bulle politique européenne? Si vous n'êtes pas sûr quoi répondre, peut-être un autre serveur Mastodon sera plus approprié pour vous.
es:
auth:
sign_up:
manual_review: |
Por favor, describa cómo forma parte de la burbuja política de la UE. Si no está seguro de qué escribir aquí, quizá otro servidor de Mastodon le venga mejor.
bg:
auth:
sign_up:
manual_review: |
Моля, опишете по какъв начин сте част от политическия балон на ЕС. Ако не сте сигурни какво да напишете тук, може би друг сървър на Мастодон ще ви подхожда повече.
cz:
auth:
sign_up:
manual_review: |
Popište, jak jste součástí politické bubliny EU. Pokud si nejste jisti, co sem napsat, možná by vám lépe vyhovoval jiný server Mastodon.
dk:
auth:
sign_up:
manual_review: |
Beskriv venligst, hvordan du er en del af EU's politiske boble. Hvis du ikke er sikker på, hvad du skal skrive her, passer en anden Mastodon-server måske bedre til dig.
nl:
auth:
sign_up:
manual_review: |
Beschrijf alsjeblieft hoe je deel uitmaakt van de EU-beleidsbel. Als je niet zeker weet wat je hier moet schrijven, misschien past een andere Mastodon server beter bij je.
et:
auth:
sign_up:
manual_review: |
Palun kirjeldage, kuidas te olete osa ELi poliitikamullist. Kui te ei ole kindel, mida siia kirjutada, siis võib-olla sobib teile paremini mõni teine Mastodoni server.
fi:
auth:
sign_up:
manual_review: |
Kuvailkaa, miten olette osa EU:n poliittista kuplaa. Jos et ole varma, mitä kirjoittaa tänne, ehkä toinen Mastodon-palvelin voisi sopia sinulle paremmin.
gr:
auth:
sign_up:
manual_review: |
Περιγράψτε τον τρόπο με τον οποίο συμμετέχετε στην πολιτική φούσκα της ΕΕ. Αν δεν είστε σίγουροι για το τι να γράψετε εδώ, ίσως ένας άλλος διακομιστής Mastodon να σας ταιριάζει καλύτερα.
hu:
auth:
sign_up:
manual_review: |
Kérjük, írd le, hogy milyen szerepet töltesz be az uniós szakpolitikákban. Ha nem tudod, mit írj ide, talán egy másik Mastodon-szerver jobban megfelelne neked.
it:
auth:
sign_up:
manual_review: |
Descrivi come fai parte della bolla politica dell'UE. Se non sei sicuro di cosa scrivere qui, forse un altro server Mastodon potrebbe essere più adatto a te.
pl:
auth:
sign_up:
manual_review: |
Wyjaśnij, na czym polega twój związek ze środowiskiem politycznym Unii Europejskiej. Jeśli nie wiesz, co tu napisać, być może inna instancja Mastodona będzie dla Ciebie bardziej odpowiednia.
lv:
auth:
sign_up:
manual_review: |
Lūdzu, aprakstiet, kā jūs esat daļa no ES politikas burbuļa. Ja neesat pārliecināts, ko šeit rakstīt, varbūt cits Mastodon serveris varētu būt jums piemērotāks.
lt:
auth:
sign_up:
manual_review: |
Apibūdinkite, kaip dalyvaujate ES politikos burbule. Jei nežinote, ką čia rašyti, galbūt jums labiau tiktų kitas Mastodono serveris.
pt:
auth:
sign_up:
manual_review: |
Descreva de que forma faz parte da bolha política da UE. Se não tem a certeza do que escrever aqui, talvez outro servidor Mastodon seja mais adequado para si.
ro:
auth:
sign_up:
manual_review: |
Vă rugăm să descrieți modul în care faceți parte din comunitatea politicilor europene. Dacă nu sunteți sigur ce să scrieți aici, poate că un alt server Mastodon vi s-ar potrivi mai bine.
sk:
auth:
sign_up:
manual_review: |
Opíšte, ako ste súčasťou politickej bubliny EÚ. Ak si nie ste istí, čo sem napísať, možno by vám viac vyhovoval iný server Mastodon.
sl:
auth:
sign_up:
manual_review: |
Opišite, kako ste del političnega mehurčka EU. Če niste prepričani, kaj bi napisali tukaj, vam bo morda bolj ustrezal drug Mastodonov strežnik.
se:
auth:
sign_up:
manual_review: |
Beskriv hur du är en del av EU-bubblan. Om du inte är säker på vad du ska skriva här, kanske en annan Mastodon-server passar dig bättre.
uk:
auth:
sign_up:
manual_review: |
Будь ласка, опишіть, яким чином ви є частиною мильної бульбашки політики ЄС. Якщо ви не знаєте, що тут писати, можливо, вам більше підійде інший сервер Mastodon.
no:
auth:
sign_up:
manual_review: |
Beskriv hvordan du er en del av EUs politiske boble. Hvis du ikke er sikker på hva du skal skrive her, passer kanskje en annen Mastodon-server bedre.
References: Permalink
- internationalisation in Rails https://guides.rubyonrails.org/i18n.html
- how merging and as such overwriting works in Rails language files https://stackoverflow.com/a/1840077/1407622