fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Too long text in creature info dialog

Open kitovyj opened this issue 2 years ago • 18 comments

Preliminary checks

Platform

Windows

Describe the bug

German translation in upgrade creature dialog: misaligment and too long creature trait names, please see the screenshot. Note also untranslated "exit" in the city screen. german tr

Save file

not needed

Additional info

No response

kitovyj avatar Aug 12 '23 12:08 kitovyj

Hi @kitovyj , can you please come up with another word or a shorter version of it for German translation? I believe Exit in castle window is a separate issue.

ihhub avatar Aug 19 '23 05:08 ihhub

Hi @kitovyj , can you please come up with another word or a shorter version of it for German translation? I believe Exit in castle window is a separate issue.

Maybe @Laserlicht can help here, I don't have german version of the game and I'm not a native speaker. I have the version from GOG, maybe somebody knows how to switch it to german version, then I can just look there.

kitovyj avatar Aug 20 '23 11:08 kitovyj

The official buttons: grafik

In the original resources the font space is reduced to fit into button...

Perhaps an abbreviation would also have to be used. E.g. ENTLAS. or ENTL.

@kitovyj You can simply download the german version from gog and use these resources for installing fheroes2 if you want to have the "full" german translation.

Laserlicht avatar Aug 20 '23 11:08 Laserlicht

The official buttons:

In the original resources the font space is reduced to fit into button...

Perhaps an abbreviation would also have to be used. E.g. ENTLAS. or ENTL.

Hi, everyone. I will make these buttons expand or shrink dynamically according to the text on them in a PR so we can avoid abbreviations (hopefully). Same thing I did in the campaign dialog.

zenseii avatar Aug 20 '23 11:08 zenseii

Thanks for the suggestion. Hah, I see that in the original version they also have long "Geschwindigkeit" not fitting the dialog space.

kitovyj avatar Aug 20 '23 11:08 kitovyj

Here are some other examples of buttons that suffer similar problems: image image image image

zenseii avatar Aug 20 '23 11:08 zenseii

The official buttons: In the original resources the font space is reduced to fit into button... Perhaps an abbreviation would also have to be used. E.g. ENTLAS. or ENTL.

Hi, everyone. I will make these buttons expand or shrink dynamically according to the text on them in a PR so we can avoid abbreviations (hopefully). Same thing I did in the campaign dialog.

Well, in this case it will not help, the buttons would overlay, or ENDE will become small and not convenient to use.

kitovyj avatar Aug 20 '23 11:08 kitovyj

BTW @Laserlicht, the info dialog uses "Intro ansehen" when right clicking the intro anzeigen button: image

zenseii avatar Aug 20 '23 11:08 zenseii

The official buttons: In the original resources the font space is reduced to fit into button... Perhaps an abbreviation would also have to be used. E.g. ENTLAS. or ENTL.

Hi, everyone. I will make these buttons expand or shrink dynamically according to the text on them in a PR so we can avoid abbreviations (hopefully). Same thing I did in the campaign dialog.

Well, in this case it will not help, the buttons would overlay, or ENDE will become small and not convdnient to use.

We enforce a minimum margin width on a button so ende would not become too small imo. It would leave enough space for "ABLEHNEN".

zenseii avatar Aug 20 '23 11:08 zenseii

It could be that in the original they just drew buttons individually for different language versions or added font space parameter to the text resources.

kitovyj avatar Aug 20 '23 11:08 kitovyj

It could be that in the original they just drew buttons individually for different language versions or added font space parameter to the text resources.

Yep, in the official translations they did that. However, since we are not allowed to share original resources, edited or not, we cannot do that. This is why we generate buttons on the fly temporarily.

zenseii avatar Aug 20 '23 11:08 zenseii

It could be that in the original they just drew buttons individually for different language versions or added font space parameter to the text resources.

Yep, in the official translations they did that. However, since we are not allowed to share original resources, edited or not, we cannot do that. This is why we generate buttons on the fly temporarily.

I see!

kitovyj avatar Aug 20 '23 11:08 kitovyj

I was planning on decreasing the margin for the campaign dialog to match the original game's margins, but I can see that it is still barely not enough for German's very long words: image

If we use INTRO ANSEHEN it might just reduce the width enough.

zenseii avatar Aug 20 '23 11:08 zenseii

I was planning on decreasing the margin for the campaign dialog to match the original game's margins, but I can see that it is still barely not enough for German's very long words: image

If we use INTRO ANSEHEN it might just reduce the width enough.

I wonder, how difficult is it to add a font space parameter to text resources? Maybe a good, however laborious 'first issue'.

kitovyj avatar Aug 20 '23 12:08 kitovyj

Space width is handled by int32_t FontCharHandler::_getSpaceCharWidth() const function.

ihhub avatar Feb 12 '25 14:02 ihhub

Hi @zenseii , what functionality is missing to implement this feature?

ihhub avatar Oct 02 '25 07:10 ihhub

@ihhub, the dialog needs to be re-implemented in the StandardWindow class to allow for width expansion of the dialog.

For this we need to add a method to StandardWindow which adds a vertical/hotizontal bar within the dialog (see the middle bar of the dialog in the screenshot of the issue description). We also need to be able to specify the exact offset of the bar within the window - e.g. the scenario select dialog has the horizontal bar not in the middle of the dialog.

The extra border decorations can be copy-pasted on-the-fly as usual.

Imo, this is the proper solution to this problem and similar ones like the reimplementation of the scenario select dialog.

zenseii avatar Oct 02 '25 07:10 zenseii