mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-15 22:51:37 -07:00
LNG: moved languages.json so weblate skips it
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
$defaultLang = "en_us";
|
$defaultLang = "en_us";
|
||||||
|
|
||||||
// Load the canonical language list from languages.json — do not hardcode here.
|
// Load the canonical language list from languages.json — do not hardcode here.
|
||||||
$_langJsonPath = dirname(__FILE__) . '/languages.json';
|
$_langJsonPath = dirname(__FILE__) . '/language_definitions/languages.json';
|
||||||
$_langJson = json_decode(file_get_contents($_langJsonPath), true);
|
$_langJson = json_decode(file_get_contents($_langJsonPath), true);
|
||||||
$allLanguages = array_column($_langJson['languages'], 'code');
|
$allLanguages = array_column($_langJson['languages'], 'code');
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ def load_language_codes(languages_json_path):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
current_path = os.path.dirname(os.path.abspath(__file__))
|
current_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
# language codes are loaded from languages.json — add a new language there
|
# language codes are loaded from languages.json — add a new language there
|
||||||
languages_json = os.path.join(current_path, "languages.json")
|
languages_json = os.path.join(current_path, "language_definitions/languages.json")
|
||||||
codes = load_language_codes(languages_json)
|
codes = load_language_codes(languages_json)
|
||||||
file_paths = [os.path.join(current_path, f"{code}.json") for code in codes]
|
file_paths = [os.path.join(current_path, f"{code}.json") for code in codes]
|
||||||
merge_translations(file_paths[0], file_paths[1:])
|
merge_translations(file_paths[0], file_paths[1:])
|
||||||
|
|||||||
@@ -563,7 +563,7 @@ class Query(ObjectType):
|
|||||||
langStrings = []
|
langStrings = []
|
||||||
|
|
||||||
# --- CORE JSON FILES ---
|
# --- CORE JSON FILES ---
|
||||||
language_folder = '/app/front/php/templates/language/'
|
language_folder = '/app/front/php/templates/language/language_definitions/'
|
||||||
if os.path.exists(language_folder):
|
if os.path.exists(language_folder):
|
||||||
for filename in os.listdir(language_folder):
|
for filename in os.listdir(language_folder):
|
||||||
if filename.endswith('.json') and filename != 'languages.json':
|
if filename.endswith('.json') and filename != 'languages.json':
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from logger import mylog
|
|||||||
|
|
||||||
INSTALL_PATH = os.getenv("NETALERTX_APP", "/app")
|
INSTALL_PATH = os.getenv("NETALERTX_APP", "/app")
|
||||||
LANGUAGES_JSON_PATH = os.path.join(
|
LANGUAGES_JSON_PATH = os.path.join(
|
||||||
INSTALL_PATH, "front", "php", "templates", "language", "languages.json"
|
INSTALL_PATH, "front", "php", "templates", "language", "language_definitions", "languages.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ from messaging.in_app import write_notification
|
|||||||
# ===============================================================================
|
# ===============================================================================
|
||||||
|
|
||||||
_LANGUAGES_JSON = os.path.join(
|
_LANGUAGES_JSON = os.path.join(
|
||||||
applicationPath, "front", "php", "templates", "language", "languages.json"
|
applicationPath, "front", "php", "templates", "language", "language_definitions" ,"languages.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user