We can mark the role as translatable and use variable translation.
commitd511cd8346ab1967177b6ced903f721f5343cdf8
authorAbhilash Raj <raj.abhilash1@gmail.com>
Sat, 19 Feb 2022 06:39:15 +0000 (18 22:39 -0800)
committerAbhilash Raj <raj.abhilash1@gmail.com>
Sat, 19 Feb 2022 06:39:15 +0000 (18 22:39 -0800)
tree5d5b26fead9c3a9b55809f48e7da32ba509b7909
parent389c07021ff0bd21d50b81edfd8672d92e4a4029
We can mark the role as translatable and use variable translation.

Instead of a bunch of conditionals, we can simply pass the variable
to trans that can translate it at runtime. In order to make sure that
we mark all the values as translatable and add them to the .po files,
add a new Enum with the role values.
src/postorius/models.py
src/postorius/templates/postorius/index.html