godot icon indicating copy to clipboard operation
godot copied to clipboard

Add translation preview in editor

Open timothyqiu opened this issue 1 year ago • 1 comments

Follow-up to #96230 Closes https://github.com/godotengine/godot-proposals/issues/8171

Allow previewing the edited scene in the specified locale.

Mainly a proof-of-concept for now, marking as draft. Not thoroughly tested.

https://github.com/user-attachments/assets/4331936c-6b12-43fc-94b5-fe91a4ae8cd0

timothyqiu avatar Sep 12 '24 17:09 timothyqiu

Incredible work, truly.

One UX note that wasn't covered in the proposal: when a translation is selected, there is a discrepancy between what is in a Label's inspector and what is shown in the scene. Perhaps some sort of indication in the text field of the fact that the field is translated is in order?

For example: the text field is expanded to include a row explaining what this label translates to (ugly example incoming, but you get the point...): Screenshot 2024-09-13 at 12 21 15

AdriaandeJongh avatar Sep 13 '24 10:09 AdriaandeJongh

It would be great to see this feature in 4.5. @timothyqiu is there anything we could do to help with it? Like more testing for example.

arkology avatar May 17 '25 16:05 arkology

@arkology When refining this PR, I often encounter some other editor/engine bugs that need to be fixed first 😛

For example, after modifying a CSV file, the editor can successfully re-import but it still loads the old content; sometimes after removing items, the size of a popup menu gets broken. I am trying to fix dependencies like these first before updating this PR.

timothyqiu avatar May 19 '25 02:05 timothyqiu

  • Resolved conflicts.
  • The 2D viewport now shows "Previewing: <Language>" when translation preview is active. image
  • The locale dropdown now shows locale name when possible and keeps open when an option is selected.
  • Turns off preview when the current translation is removed from Project Settings dialog.
  • Fixed various minor bugs.

Known issues:

  • Updating CSV translations does not update preview text in the editor. This is probably due to a CSV file being imported as additional .translation files. Updating PO translations works fine.
  • After removing a translation, the "Preview Translation" submenu stays the old size: https://github.com/godotengine/godot/issues/106668

timothyqiu avatar May 21 '25 07:05 timothyqiu

The language menu should be either moved elsewhere, or duplicated in the 3D editor. It will affect 3D nodes too, like Label3D.

EDIT: Same with the "Previewing:" label I think.

https://github.com/user-attachments/assets/42b0c78e-863c-4fe3-b84a-bae5e495c8e8

KoBeWi avatar May 24 '25 22:05 KoBeWi

Both 2D & 3D views have a Preview Translation option in the View menu now.

https://github.com/user-attachments/assets/e90c0e11-e3b0-4467-82db-717079926812

timothyqiu avatar May 25 '25 12:05 timothyqiu

Thanks!

Repiteo avatar May 27 '25 14:05 Repiteo