mirror of
https://github.com/relativemodder/aegnux.git
synced 2026-01-06 01:59:39 +05:00
initial structure
This commit is contained in:
1
translations/__init__.py
Normal file
1
translations/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from translations.helper import gls, load_strings
|
||||
7
translations/en_US.py
Normal file
7
translations/en_US.py
Normal file
@@ -0,0 +1,7 @@
|
||||
STRINGS = {
|
||||
'welcome_win_title': 'Aegnux — Welcome',
|
||||
'welcome_to_aegnux': 'Welcome to Aegnux!',
|
||||
'subtitle_text': 'A simpler way to get After Effects running on GNU/Linux',
|
||||
'install': 'Install',
|
||||
'footer_text': 'Made with 💙 by Relative'
|
||||
}
|
||||
22
translations/helper.py
Normal file
22
translations/helper.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import os
|
||||
import importlib
|
||||
from translations.en_US import STRINGS as EN_STRINGS
|
||||
|
||||
STRINGS = {}
|
||||
|
||||
def get_current_locale() -> str:
|
||||
return os.getenv('LANG', 'en_US.UTF-8').split('.')[0]
|
||||
|
||||
def load_strings():
|
||||
global STRINGS
|
||||
|
||||
locale = get_current_locale()
|
||||
|
||||
try:
|
||||
mod = importlib.import_module(f'translations.{locale}')
|
||||
STRINGS = mod.STRINGS
|
||||
except:
|
||||
STRINGS = EN_STRINGS
|
||||
|
||||
def gls(key: str) -> str:
|
||||
return STRINGS.get(key, key)
|
||||
7
translations/ru_RU.py
Normal file
7
translations/ru_RU.py
Normal file
@@ -0,0 +1,7 @@
|
||||
STRINGS = {
|
||||
'welcome_win_title': 'Aegnux — Добро пожаловать',
|
||||
'welcome_to_aegnux': 'Добро пожаловать в Aegnux!',
|
||||
'subtitle_text': 'Более простой способ заставить работать After Effects на GNU/Linux',
|
||||
'install': 'Установить',
|
||||
'footer_text': 'Сделано с любовью 💙 Relative'
|
||||
}
|
||||
Reference in New Issue
Block a user