mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
Avoid defaulting to Afaraf for brand new users (Bugfix for #273)
This commit is contained in:
parent
6b1218ce02
commit
0512db7f5a
1 changed files with 8 additions and 0 deletions
|
@ -1158,6 +1158,14 @@ def languages_for_form():
|
|||
for language_id in recently_used_language_ids:
|
||||
used_languages.append((language_id, ""))
|
||||
|
||||
# use 'English' as a default for brand new users (no posts or replies yet)
|
||||
# not great, but better than them accidently using 'Afaraf' (the first in a alphabetical list of languages)
|
||||
# FIXME: use site language when it is settable by admins, or anything that avoids hardcoding 'English' in
|
||||
if not used_languages:
|
||||
id = english_language_id()
|
||||
if id:
|
||||
used_languages.append((id, ""))
|
||||
|
||||
for language in Language.query.order_by(Language.name).all():
|
||||
try:
|
||||
i = used_languages.index((language.id, ""))
|
||||
|
|
Loading…
Reference in a new issue