Skip to content

Commit

Permalink
don't build alerts_generated.h in test, and ensure scons builds it mo…
Browse files Browse the repository at this point in the history
…re reliably + clean up support
  • Loading branch information
sshane committed Jul 31, 2024
1 parent ebff7ca commit 47c3b42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion selfdrive/ui/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions selfdrive/ui/update_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)

0 comments on commit 47c3b42

Please sign in to comment.