Auto self-translation

This commit is contained in:
Piero Toffanin 2023-01-04 15:36:26 -05:00
parent 50c9b62595
commit 3cbbd8ae16
10 changed files with 135 additions and 60 deletions

View file

@ -0,0 +1,9 @@
import os
from functools import cache
@cache
def get_available_locales():
locales_dir = os.path.join(os.path.dirname(__file__), 'locales')
dirs = [os.path.join(locales_dir, d) for d in os.listdir(locales_dir)]
return ['en'] + [os.path.basename(d) for d in dirs if os.path.isdir(os.path.join(d, 'LC_MESSAGES'))]