  
  # build translation files
  translation_sources = Glob("#selfdrive/ui/translations/*.ts", strings=True)
  translation_targets = [src.replace(".ts", ".qm") for src in translation_sources]
  lrelease = 'third_party/qt5/larch64/bin/lrelease' if arch == 'larch64' else 'lrelease'
  qt_env.Command(translation_targets, translation_sources, f"{lrelease} $SOURCES")
  
  
  # setup and factory resetter
  if GetOption('extras'):
    qt_env.Program("qt/setup/reset", ["qt/setup/reset.cc"], LIBS=qt_libs)
    qt_env.Program("qt/setup/setup", ["qt/setup/setup.cc", asset_obj],
 
</s> remove translation_sources = Glob("#selfdrive/ui/translations/*.ts", strings=True)
 </s> add with open(File("translations/languages.json").abspath) as f:
  languages = json.loads(f.read())
translation_sources = [f"#selfdrive/ui/translations/{l}.ts" for l in languages.values()]
lrelease_bin = 'third_party/qt5/larch64/bin/lrelease' if arch == 'larch64' else 'lrelease'

lupdate = qt_env.Command(translation_sources, qt_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)
qt_env.Precious(translation_sources)
qt_env.NoCache(lupdate)
  
  # build translation files
  translation_sources = Glob("#selfdrive/ui/translations/*.ts", strings=True)
  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, "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)
qt_env.Precious(translation_sources)
qt_env.NoCache(lupdate)
lrelease_bin = 'third_party/qt5/larch64/bin/lrelease' if arch == 'larch64' else 'lrelease'

lupdate = qt_env.Command(translation_sources, qt_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)
qt_env.Precious(translation_sources)
qt_env.NoCache(lupdate)
lrelease_bin = 'third_party/qt5/larch64/bin/lrelease' if arch == 'larch64' else 'lrelease'

lupdate = qt_env.Command(translation_sources, qt_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)
qt_env.Precious(translation_sources)
qt_env.NoCache(lupdate)
  
  # setup and factory resetter
  if GetOption('extras'):
    qt_env.Program("qt/setup/reset", ["qt/setup/reset.cc"], LIBS=qt_libs)
    qt_env.Program("qt/setup/setup", ["qt/setup/setup.cc", asset_obj],
keep keep keep keep replace replace replace keep keep keep keep keep
 UI: update translations during scons build (#27009)

* UI: update translation during scons build

* all in scons

* debug

* precious

* debug

* add missing

* Update release/check-dirty.sh

Co-authored-by: Shane Smiskol <shane@smiskol.com> 
selfdrive/ui/SConscript