Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calls wrapped in {{}} that contain quotes are broken when translated #727

Open
ThunderFD opened this issue Jan 18, 2025 · 1 comment · May be fixed by #729
Open

calls wrapped in {{}} that contain quotes are broken when translated #727

ThunderFD opened this issue Jan 18, 2025 · 1 comment · May be fixed by #729
Assignees
Labels
bug Something isn't working

Comments

@ThunderFD
Copy link

Describe the bug
(minimal project attached below)

consider this dialogue file:

~ this_is_a_node_title
Nathan: Hi! here is {{Globalscript.hello("Planet")}} (and its broken when translated) [ID:t48df5178b2]
Nathan: This should always work though: {{Globalscript.hello()}} [ID:tb303d056d4]
=> END

where Globalscript is a global with the following script:

extends Node

func hello(greet_at:String = "World"):
	return "Hello " + greet_at

all lines in the dialogue work fine when not translated. (here locale en)
when a translation (e.g. de) is loaded, the first line will display the raw text from the dialogue line.

Image

the second line works fine

Image

Affected version

  • Dialogue Manager version: v2.44.2
  • Godot version: 4.3 stable

To Reproduce
Steps to reproduce the behavior:

  1. download the minimal project
  2. this project doesn't contain any scenes, so open the dialogue file
  3. launch the dialogue tester via "Test Dialogue" Button
  4. you should run into the bug on the first dialogue line right away as the testing locale is set to "de" in project settings.
  5. set the testing locale setting to en (internationalization/locale/test)
  6. now launch the dialogue tester again
  7. see that without translation the content of the {{}} brackets is replaced as expected in the first dialogue line

Expected behavior
The content of the {{}} brackets is replaced as expected in any language even if it contains quotes

minimal project

  • attached as zip

dialogue-translation-bug.zip

@ThunderFD ThunderFD added the bug Something isn't working label Jan 18, 2025
@nathanhoad nathanhoad linked a pull request Jan 18, 2025 that will close this issue
@nathanhoad
Copy link
Owner

It looks like the issue was that the translation file had special quotes in it instead of regular quotes. I've added support for detecting special quotes in #729 if you wanted to give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants