mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-04 12:24:52 +00:00
Auto self-translation
This commit is contained in:
parent
50c9b62595
commit
3cbbd8ae16
10 changed files with 135 additions and 60 deletions
9
libretranslate/locales.py
Normal file
9
libretranslate/locales.py
Normal 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'))]
|
Loading…
Add table
Add a link
Reference in a new issue