fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Translate all game buttons

Open Effektus opened this issue 3 years ago • 13 comments

Your question

And what hapend with menu translation i found only "Only battle" working? image

Additional info

image

Effektus avatar Nov 06 '22 11:11 Effektus

@Effektus These buttons are images taken from the resources of the original game. If you have a localized variant of the original game, these buttons will have localized inscriptions, otherwise they will have English inscriptions. The "Battle Only" button is absent in the original resources, it is "hand-made" (generated by engine), so it's localized (sort of).

oleg-derevenetz avatar Nov 06 '22 11:11 oleg-derevenetz

I did not understand? My question is, is anyone making these translated pictures now, or is the engine generating them?

Effektus avatar Nov 06 '22 12:11 Effektus

@Effektus These translated pictures are done by the publisher of the original game a long time ago for localized distributions intended for the respective countries. There is only one (AFAIK) button image generated by the engine - for the "Battle Only" button.

oleg-derevenetz avatar Nov 06 '22 12:11 oleg-derevenetz

Yes my question is why is only one generated and where is this engine? It is build in "fheroes2" or it is outside project?

Effektus avatar Nov 06 '22 12:11 Effektus

@Effektus Because such generation is a difficult task (I suppose @zenseii would be able to describe this process in detail), and this is just for the one button. We can not just supply a "localized copies" of these images with fheroes2 due to the licensing issues.

oleg-derevenetz avatar Nov 06 '22 12:11 oleg-derevenetz

Hi, @Effektus.

As @oleg-derevenetz described thoroughly we are writing code that in runtime generates these buttons, because simply editing them in a graphics editing tool like photoshop and then distributing them with fheroes2 would lead to both licensing and copyright issues because we do not own these assets.

As for why the rest have not been translated it is because this is work in progress. I was intending to do this but right now I'm lost without a PC to develop on for an indefinite time due to unforseen events. Anyone is more than welcome to do this work and also to ask for help in achieving it. The foundaments have already been put in place to make it possible.

Also note that we have actually generated 5 buttons: Battle Only, Difficulty, Min (Recruit), Min (Fast split), Gift.

Also, @oleg-derevenetz, please note a minor typo 😅

@sensei

zenseii avatar Nov 06 '22 13:11 zenseii

@zenseii

Also, @oleg-derevenetz, please note a minor typo 😅

Yes, sorry :)

oleg-derevenetz avatar Nov 06 '22 13:11 oleg-derevenetz

OK I want to help for this job too! Please explain to me how?

Effektus avatar Nov 06 '22 13:11 Effektus

OK I want to help for this job too! Please explain to me how?

I'll explain this once I have some free time to, but you can start by looking at recent PRs where we added button generation. The relevant code lies in the source file agg_image.cpp, the fheroes2 namespace in a function for default button generation. Some button generation needs to be moved from the function called LoadModifiedICN over to generateDefaultButton() and then modified to make use of the renderTextOnButton() function.

I'm just writing this from the top of my head so please try to find one of the recent PRs I did adding MIN button generation for the fast splitting dialog.

zenseii avatar Nov 06 '22 15:11 zenseii

Hi, @Effektus.

Please have a look at this PR to see what needs to be done to make a button translateable: https://github.com/ihhub/fheroes2/pull/6031/files

There are some similar cases as MIN/MAX which can still be done, while for buttons like DISMISS more new code will have to be written.

Here are some buttons that can be done exactly like I did in the above PR for the button ICN::UNIFORM_GOOD_MIN_BUTTON. BATTLESKIP, BATTLEWAIT, BUYMAX: https://github.com/ihhub/fheroes2/blob/07319cd7b6762071d04f5d2dcec93dda2da5dbee/src/fheroes2/agg/agg_image.cpp#L961-L1003

Further down there's BTNCONFIG: https://github.com/ihhub/fheroes2/blob/07319cd7b6762071d04f5d2dcec93dda2da5dbee/src/fheroes2/agg/agg_image.cpp#L1017-L1026

Please ask if you have any questions regarding this, @Effektus.

I also suggest renaming this issue to something like "Translate game buttons".

zenseii avatar Nov 08 '22 17:11 zenseii

I'll start with a PR addressing these.

zenseii avatar Nov 15 '22 18:11 zenseii

Hi, @Effektus.

Please have a look at this PR to see what needs to be done to make a button translateable: https://github.com/ihhub/fheroes2/pull/6031/files

There are some similar cases as MIN/MAX which can still be done, while for buttons like DISMISS more new code will have to be written.

Here are some buttons that can be done exactly like I did in the above PR for the button ICN::UNIFORM_GOOD_MIN_BUTTON. BATTLESKIP, BATTLEWAIT, BUYMAX:

https://github.com/ihhub/fheroes2/blob/07319cd7b6762071d04f5d2dcec93dda2da5dbee/src/fheroes2/agg/agg_image.cpp#L961-L1003

Further down there's BTNCONFIG:

https://github.com/ihhub/fheroes2/blob/07319cd7b6762071d04f5d2dcec93dda2da5dbee/src/fheroes2/agg/agg_image.cpp#L1017-L1026

Please ask if you have any questions regarding this, @Effektus.

I also suggest renaming this issue to something like "Translate game buttons".

I will try

Effektus avatar Nov 15 '22 19:11 Effektus

I will try

@Effektus I've already made a PR with all of these buttons, so please wait until that has been merged : https://github.com/ihhub/fheroes2/issues/6105

Then we can come back to see what needs to be done.

zenseii avatar Nov 15 '22 19:11 zenseii