mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-01-26 19:29:56 +00:00
17 lines
415 B
Python
17 lines
415 B
Python
import os
|
|
import json
|
|
|
|
i18n = {}
|
|
|
|
|
|
def get_i18n(reload=False):
|
|
global i18n
|
|
if reload or not i18n:
|
|
i18n = {}
|
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
config_file = os.path.join(current_dir, '../../i18n.json')
|
|
config_file = os.path.normpath(config_file)
|
|
with open(config_file, 'r', encoding='utf8') as f:
|
|
i18n = json.load(f)
|
|
return i18n
|