Multi-language/I18n support #22

This commit is contained in:
Proddy
2022-08-24 21:50:19 +02:00
parent 763337db3f
commit 1a4ce643fc
84 changed files with 5506 additions and 4196 deletions

View File

@@ -5,7 +5,6 @@ Import("env")
OUTPUT_DIR = "build{}".format(os.path.sep)
def bin_copy(source, target, env):
# get the build info
@@ -21,20 +20,23 @@ def bin_copy(source, target, env):
app_version = bag.get('app_version')
platform = "ESP32"
flash_size = env["PIOENV"].split('_')[1]
# print(env.Dump())
# my_flags = env.ParseFlags(env['BUILD_FLAGS'])
# defines = {k: v for (k, v) in my_flags.get("CPPDEFINES")}
# print(my_flags)
# print((my_flags.get("CPPDEFINES"))
# alternatively take platfrom from the pio target
# alternatively take platform from the pio target
# platform = str(target[0]).split(os.path.sep)[2]
print("app version: "+app_version)
print("platform: "+platform)
print("flash size: "+flash_size)
# convert . to _ so Windows doesn't complain
variant = "EMS-ESP-" + app_version.replace(".", "_") + "-" + platform
variant = "EMS-ESP-" + app_version.replace(".", "_") + "-" + platform + "_" + flash_size
# check if output directories exist and create if necessary
if not os.path.isdir(OUTPUT_DIR):
@@ -52,10 +54,9 @@ def bin_copy(source, target, env):
if os.path.isfile(f):
os.remove(f)
print("renaming file to "+bin_file)
print("Renaming file to "+bin_file)
# copy firmware.bin to firmware/<variant>.bin
shutil.copy(str(target[0]), bin_file)
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_copy])