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

Crowdin: [empty translation] is overridden by English translation #1750

Closed
HeyMyian opened this issue Mar 12, 2024 · 5 comments · Fixed by #1754
Closed

Crowdin: [empty translation] is overridden by English translation #1750

HeyMyian opened this issue Mar 12, 2024 · 5 comments · Fixed by #1754
Labels
localisation Issue: Translations and localisation
Milestone

Comments

@HeyMyian
Copy link
Contributor

There is a string Add that I translated as [empty translation] because no single word here makes sense in German. [empty translation] however did not carry over to the application, "Add" is still displayed. Is there a way to do this?

@HeyMyian HeyMyian added the bug Issue: Something isn't working label Mar 12, 2024
@vkbo
Copy link
Owner

vkbo commented Mar 12, 2024

These are the strings for adding new chapters and scenes on the Welcome dialog I assume?

There is no way to insert the number selector in {0} entry point like for other text, but I may be able to rephrase it to a single string after the number selector. I think we addressed a similar issue on the old New Project Wizard.

@vkbo vkbo added this to the Release 2.3.1 milestone Mar 12, 2024
@vkbo vkbo added localisation Issue: Translations and localisation and removed bug Issue: Something isn't working labels Mar 12, 2024
@HeyMyian
Copy link
Contributor Author

These are the strings for adding new chapters and scenes on the Welcome dialog I assume?

Yes, that's where it is.

@vkbo vkbo mentioned this issue Mar 12, 2024
6 tasks
@vkbo
Copy link
Owner

vkbo commented Mar 12, 2024

I added a custom layout box that can take a translated string with a {0} in it and insert the control widget at the {0}. It will handle any positioning in the string, so now it should behave the same way as a translated string with a value inserted.

The strings on the form are now:

  • "Add {0} chapter documents"
  • "Add {0} scene documents (to each chapter)"

You should now be able to drop the "Add" bit.

class NWrappedWidgetBox(QHBoxLayout):
"""Extension: A Text-Wrapped Widget Box
A custom layout box where a widget is wrapped within the box. The
widget is inserted at the {0} position so that it can be used for
translation strings.
"""
def __init__(self, text: str, widget: QWidget) -> None:
super().__init__()
before, _, after = text.partition(r"{0}")
if before:
self.addWidget(QLabel(before.rstrip()))
self.addWidget(widget)
if after:
self.addWidget(QLabel(after.lstrip()))
return
# END Class NWrappedWidgetBox

@HeyMyian
Copy link
Contributor Author

That works, thank you.

@vkbo vkbo added not a bug Invalid: Feature, not a bug localisation Issue: Translations and localisation and removed localisation Issue: Translations and localisation not a bug Invalid: Feature, not a bug labels Mar 12, 2024
@vkbo
Copy link
Owner

vkbo commented Mar 12, 2024

It does indeed work. Just tested with your new translation.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
localisation Issue: Translations and localisation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants