ensure alerts_generated.h is built (#33157)

don't build alerts_generated.h in test, and ensure scons builds it more reliably + clean up support
old-commit-hash: 7de618a5cf
This commit is contained in:
Shane Smiskol 2024-07-31 16:12:37 -07:00 committed by GitHub
parent 799fabd707
commit be710ab893
2 changed files with 2 additions and 3 deletions

View File

@ -40,7 +40,7 @@ translation_sources = [f"#selfdrive/ui/translations/{l}.ts" for l in languages.v
translation_targets = [src.replace(".ts", ".qm") for src in translation_sources]
lrelease_bin = 'third_party/qt5/larch64/bin/lrelease' if arch == 'larch64' else 'lrelease'
lupdate = qt_env.Command(translation_sources, qt_src + widgets_src, "selfdrive/ui/update_translations.py")
lupdate = qt_env.Command(translation_sources + ["translations/alerts_generated.h"], qt_src + widgets_src, "selfdrive/ui/update_translations.py")
lrelease = qt_env.Command(translation_targets, translation_sources, f"{lrelease_bin} $SOURCES")
qt_env.Depends(lrelease, lupdate)
qt_env.NoClean(translation_sources)

View File

@ -25,8 +25,6 @@ def generate_translations_include():
def update_translations(vanish: bool = False, translation_files: None | list[str] = None, translations_dir: str = TRANSLATIONS_DIR):
generate_translations_include()
if translation_files is None:
with open(LANGUAGES_FILE) as f:
translation_files = json.load(f).values()
@ -48,4 +46,5 @@ if __name__ == "__main__":
parser.add_argument("--vanish", action="store_true", help="Remove translations with source text no longer found")
args = parser.parse_args()
generate_translations_include()
update_translations(args.vanish)