25 lines
501 B
Python
25 lines
501 B
Python
import json
|
|
import os
|
|
|
|
|
|
def scan_files(path) -> list:
|
|
"""
|
|
Scans dirs and subdirs in PATH to gind *.lua files
|
|
:param path: set path to scan
|
|
:return: list of files in dir and subdir
|
|
"""
|
|
list_files = []
|
|
for root, dirs, files in os.walk(path):
|
|
for file in files:
|
|
if '.lua' in file: list_files.append(f'{root}/{file}')
|
|
|
|
return list_files
|
|
|
|
|
|
def open_translate(lang='ru'):
|
|
with open(f'{lang}.po', 'r') as f:
|
|
_read = f.read()
|
|
return _read
|
|
|
|
|