From f1a8d894579b77f96e333d8621fa5e9e8999e838 Mon Sep 17 00:00:00 2001 From: kwadronaut Date: Tue, 18 Jul 2023 17:06:34 +0200 Subject: Add Turkish and Dutch, fix .tx flow --- scripts/prepareForTx.py | 107 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100755 scripts/prepareForTx.py (limited to 'scripts') diff --git a/scripts/prepareForTx.py b/scripts/prepareForTx.py new file mode 100755 index 00000000..c683c84a --- /dev/null +++ b/scripts/prepareForTx.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python3 +"" +__author__ = "kwadronaut" +__copyright__ = "Copyright 2023, LEAP" +__license__ = "GPL3 or later3 or later3 or later" +__version__ = "1" + +import os +import re +import argparse +import json + +# Set the path to the res directory containing different language folders +main_res_dir = "../app/src/main/res" +custom_res_dir = "../app/src/custom/res" + +# List all valid locale folders in the res directory +def list_locales(app_type): + locales = [] + if app_type == "main": + res_dir = main_res_dir + elif app_type == "custom": + res_dir = custom_res_dir + else: + raise ValueError("Invalid app type. Use 'main' or 'custom'.") + + valid_locale_pattern = re.compile(r'^values-(?P[a-z]{2})(-(?P