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

Add engine option widget for language selection #2776

Merged
merged 2 commits into from Feb 18, 2021
Merged

Conversation

@criezy
Copy link
Member

@criezy criezy commented Feb 14, 2021

AGS games can have multiple languages by providing additional translations as .tra files. The language selection is done by setting the config "translation" key to the tra file name. This means that we cannot easily use the standard ScummVM language selection for this purpose as the tra file name may not map to language names easily.

Also the advanced detector does not allow specifying multiple languages for a game, and adding separate detections for all the languages by using the tra files for the detection would be cumbersome.

Instead this pull request does something similar to the original games by detecting at runtime the available .tra files, but replaces the original setup utility by a game option widget.

image

It's not ideal that we have an ineffective Language selector in the Game tab, and another one in the Engine tab. Maybe to avoid confusion we could add a GUIO_NOLANGUAGE option that would hide the Language selector in the Game tab for the games that define it.

criezy added 2 commits Feb 14, 2021
AGS games can have multiple languages by providing
additional translations as .tra files. The language
selection is done by setting the config "translation"
 key to the tra file name. This means that we cannot
easily use the standard ScummVM language selection
for this purpose as the tra file name may not map
to language names easily.

The approach in this commit does something similar
to the original games by detecting at runtime the
available tra files.
@deepcode-ci-bot
Copy link

@deepcode-ci-bot deepcode-ci-bot bot commented Feb 14, 2021

Congratulations 🎉. DeepCode analyzed your code in 2.448 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

@henke37
Copy link
Contributor

@henke37 henke37 commented Feb 14, 2021

I don't think this should be an engine specific feature, since other engines are in the same situation, such as supernova.

@criezy
Copy link
Member Author

@criezy criezy commented Feb 14, 2021

And for reference here is the original setup utility, courtesy of @SupSuper:
image

@criezy
Copy link
Member Author

@criezy criezy commented Feb 14, 2021

I don't think this should be an engine specific feature, since other engines are in the same situation, such as supernova.

Supernova is in a different situation because we do not need to detect at run time which languages are available. So this can be done in the detection. And if we wanted to remove the multiple detection entries, the solution would be to extend the advanced game detector to support having multiple languages for a game. Then the Language popup in the Game tab would let the user select the language.

@criezy
Copy link
Member Author

@criezy criezy commented Feb 18, 2021

I will merge this now. Further work on the config can then be done directly in master.

@criezy criezy merged commit 65fa2fa into scummvm:master Feb 18, 2021
3 checks passed
3 checks passed
Codacy Static Code Analysis Codacy Static Code Analysis
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deepcode-ci-bot Well done, no issues found!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants