diff --git a/selfdrive/ui/SConscript b/selfdrive/ui/SConscript index c6b4860bf7f1c4..509f2aebd1a921 100644 --- a/selfdrive/ui/SConscript +++ b/selfdrive/ui/SConscript @@ -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) diff --git a/selfdrive/ui/update_translations.py b/selfdrive/ui/update_translations.py index 0fe0f05ac4abbc..f13c65fdaed867 100755 --- a/selfdrive/ui/update_translations.py +++ b/selfdrive/ui/update_translations.py @@ -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 @@ def update_translations(vanish: bool = False, translation_files: None | list[str 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)