Source code for the Codeberg e.V. member registration web service. https://join.codeberg.org
  • Go 96.8%
  • Makefile 2.1%
  • Nix 1.1%
Find a file
Image Andreas Shimokawa c04e600309
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add language selector (#164)
How it works:

1) it generates a list of available locales at statup, scanning the embed fs.
2) when getting the locale from the accept header it also considers a cookie called "lang"
3) it constructs a language selector in header.tmpl by accesing the list of available languaes
4) changing the language selector triggers a submit via javascript, setting the langue in a /setlang endpoint handler

What I found weird during implementation:

1) I could not access data I tried to pass in context for the template renderer, so I make a function accessible that returns the data
2) there seems to be no way of actually getting the chosen language when calling localeDomain.Locale(localesToTry...), thats why I track the to-be-chosen language myself and make it available to the template independently (to show the currently selected language)

TODO:

- [X] Make work without javascript
- [ ] Bonus points: Don't display "de" "en" etc but "Deutsch" and "English"

Reviewed-on: #164
Co-authored-by: Andreas Shimokawa <shimokawa@fsfe.org>
Co-committed-by: Andreas Shimokawa <shimokawa@fsfe.org>
2026-04-08 15:59:29 +02:00
dataformat-workaround Change "manual" to "wire-transfer" (or wireTransfer for the legacy format) to ensure correct export with the legacy members tool 2023-10-31 20:15:20 +01:00
docs Update translation docs to point to Codeberg Translate (#118) 2025-02-27 17:28:32 +00:00
etc Revert "workaround-please-revert: allow unpatched go-gettext versions when LOCALES_PATH is set" 2023-07-30 16:44:53 +00:00
locales Mention Codeberg's working language (#165) 2026-04-07 21:38:11 +02:00
templates Add language selector (#164) 2026-04-08 15:59:29 +02:00
testdata/keyring test: add end-to-end testing for happy case 2024-01-28 17:00:39 +00:00
.envrc chore: add direnv support (#110) 2025-01-10 20:48:45 +00:00
.gitignore chore: add direnv support (#110) 2025-01-10 20:48:45 +00:00
.woodpecker.yml fix/pipeline (#152) 2026-02-08 21:39:20 +01:00
basic-swift-checks.go go run mvdan.cc/gofumpt@latest -extra -w . 2024-01-23 10:50:04 +01:00
end_to_end_test.go Add language selector (#164) 2026-04-08 15:59:29 +02:00
flake.lock fix/pipeline (#152) 2026-02-08 21:39:20 +01:00
flake.nix fix/pipeline (#152) 2026-02-08 21:39:20 +01:00
go.mod bump go to 1.22, latest availible in bookworm-backports 2024-09-03 12:53:53 +02:00
go.sum tidy go.sum 2024-10-13 14:42:26 +02:00
LICENSE.md initial commit 2019-02-14 09:24:26 +00:00
main.go Add language selector (#164) 2026-04-08 15:59:29 +02:00
main_test.go fix/154: discount membership amount validation (#155) 2026-03-21 11:20:00 +01:00
Makefile fix: deployment issues in Makefile & main.go, mainly fixing mail template with go:embed & adding a MAIL_USERNAME 2023-10-10 08:01:43 +02:00
README.md Update README description and licensing (#160) 2026-03-22 19:42:58 +01:00
validator.go fix/154: discount membership amount validation (#155) 2026-03-21 11:20:00 +01:00

registration-server by Codeberg e.V. status-badge

This is the registration server used for Codeberg e.V.'s online membership application form: join.codeberg.org

Documentation Index

License

This software (excluding bundled fonts) is licensed under the GNU Affero General Public License version 3 (GNU AGPLv3) (LICENSE or https://www.gnu.org/licenses/agpl-3.0.en.html).

The Codeberg logo is the work of @mray and licensed under CC0 1.0 Universal: https://codeberg.org/Codeberg/Design/src/branch/main/LICENSE or https://creativecommons.org/publicdomain/zero/1.0/

Codeberg and the Codeberg Logo are trademarks of Codeberg e.V.