Tactiliest/Translations/generate-all.py
Ken Van Hoeylandt 8c8ccd8783
Merge develop into main (#305)
## New features

- Implement translations for apps
- Created `tt::settings::setLanguage` and `::getLanguage()`
- External app errors are now reported to the user via an AlertDialog
- Store system settings in `/data/settings.properties`
- Created a "Region & Language" app and moved the timezone setting there.

## Other changes

- Change `/data` and `/system` filesystem sector size from 4096 to 512 bytes to allow for more small files (60+ files of 4kB were over the limit of 256kB for the filesystem)
- Increased size of `/data` and `/system`
- Moved `tt::time::*` to `tt::settings`
- Removed the timezone setting from the "Time & Date" setting app
- Reverse encoder direction of Lilygo T-Lora Pager
- Improved partability of `Time.cpp` (removed separate set of functions for PC/sim)
2025-08-28 21:50:29 +02:00

38 lines
1.2 KiB
Python

import os
from pathlib import Path
def get_project_root():
return Path(__file__).parent.parent.resolve()
def generate(csv_file, header_file, header_namespace, data_path):
csv_file_path = f"{get_project_root()}/Translations/{csv_file}"
if os.path.isfile(csv_file_path):
print(f"Processing {csv_file}")
script_path = f"{get_project_root()}/Translations/generate.py"
os.system(f"python {script_path} {csv_file} {header_file} {header_namespace} {data_path}")
else:
print(f"Skipping {csv_file} (not found)")
if __name__ == "__main__":
# Core translations
generate(
"Core.csv",
"Tactility/Include/Tactility/i18n/CoreTextResources.h",
"tt::i18n::core",
"Data/system/i18n/core"
)
# Launcher app
generate(
"Launcher.csv",
"Tactility/Private/Tactility/app/launcher/TextResources.h",
"tt::app::launcher::i18n",
"Data/system/app/Launcher/i18n"
)
# LocaleSettings app
generate(
"LocaleSettings.csv",
"Tactility/Private/Tactility/app/localesettings/TextResources.h",
"tt::app::localesettings::i18n",
"Data/system/app/LocaleSettings/i18n"
)