supersplat icon indicating copy to clipboard operation
supersplat copied to clipboard

Consider automated checking of localization.ts

Open johnbanq opened this issue 9 months ago • 2 comments

Manually checking localization.ts is very painful!

So I whipped out this hacky script that automatically checks it: https://github.com/johnbanq/supersplat-i18n-check.

It automatically finds:

  • untranslated keys
  • unused keys
  • undefined keys

by analyzing all localize() call sites in the codebase.

Putting this here just for the record. We can add it to CI if we are OK with this (quite complicated) approach.

johnbanq avatar Jul 11 '25 06:07 johnbanq

Also, here is the result of running this script against the current latest commit on main (commit 9437889b85b33ae52b88d9f9c35a1a9fc1e5dec4):

UNUSED localisation keys -------------------------------------

   camera
   camera.add-pose
   camera.clear-poses
   camera.next-pose
   camera.play-poses
   camera.prev-pose
   file.load-all-data
   timeline.add-key
   timeline.frame-rate
   timeline.next-key
   timeline.play
   timeline.prev-key
   timeline.remove-key
   timeline.total-frames

UNDEFINED localisation keys ----------------------------------

   render.failed

INCOMPLETE localisation keys ------------------------------

  'colors.saturation' is missing in: ko
  'file.export.ply' is missing in: de, fr, ja, ko, zh-CN
  'options.tonemapping' is missing in: de, fr, ja, ko, zh-CN
  'options.tonemapping-none' is missing in: de, fr, ja, ko, zh-CN
  'options.tonemapping-linear' is missing in: de, fr, ja, ko, zh-CN
  'options.tonemapping-neutral' is missing in: de, fr, ja, ko, zh-CN
  'options.tonemapping-aces' is missing in: de, fr, ja, ko, zh-CN
  'options.tonemapping-aces2' is missing in: de, fr, ja, ko, zh-CN
  'options.tonemapping-filmic' is missing in: de, fr, ja, ko, zh-CN
  'options.tonemapping-hejl' is missing in: de, fr, ja, ko, zh-CN
  'image.header' is missing in: de, fr, ja, ko, zh-CN
  'image.preset' is missing in: de, fr, ja, ko, zh-CN
  'image.resolution' is missing in: de, fr, ja, ko, zh-CN
  'image.transparentBg' is missing in: de, fr, ja, ko, zh-CN
  'image.showDebug' is missing in: de, fr, ja, ko, zh-CN
  'image.resolutionCurrent' is missing in: de, fr, ja, ko, zh-CN
  'image.resolutionCustom' is missing in: de, fr, ja, ko, zh-CN

johnbanq avatar Jul 11 '25 06:07 johnbanq

At first, I thought this sounded like overkill, but I did just use your script to generate this PR. So thanks for that! I'm fine running this manually for now, but open to integrating it into this repo at some point if it turns out to be a net win...

willeastcott avatar Oct 21 '25 15:10 willeastcott