-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
TETRAEDGE: Support Hebrew fan translation #4914
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
Conversation
|
On a related note, I think the behaviour that the game language is determined (also) by the help files is unexpected. index a5fa3ac1889..09da6e84d33 100644
--- a/engines/tetraedge/game/application.cpp
+++ b/engines/tetraedge/game/application.cpp
@@ -176,17 +176,16 @@ void Application::create() {
if (g_engine->gameType() != TetraedgeEngine::kAmerzone) {
const Common::Path helpMenuPath("menus/help/help_");
- Common::Path helpMenuFilePath;
- i = 0;
- while (i < ARRAYSIZE(allLangs)) {
- helpMenuFilePath = helpMenuPath.append(core->language() + ".xml");
- if (Common::File::exists(helpMenuFilePath))
- break;
- core->language(allLangs[i]);
- i++;
- }
- if (i == ARRAYSIZE(allLangs)) {
- error("Couldn't find menus/help/help_[lang].xml for any language.");
+ const Common::String &lang = g_engine->getCore()->language();
+ Common::Path helpMenuFilePath = helpMenuPath.append(lang).appendInPlace(".xml");
+ if (!Common::File::exists(helpMenuFilePath)) {
+ helpMenuFilePath = helpMenuPath.append(".xml");
+ if (!Common::File::exists(helpMenuFilePath)) {
+ helpMenuFilePath = helpMenuPath.append("en.xml");
+ if (!Common::File::exists(helpMenuFilePath)) {
+ error("Couldn't find menus/help/help_[lang].xml for selected language.");
+ }
+ }
}
_helpGui.load(helpMenuFilePath);(based on the implementation for inventory objects... https://github.com/blooperz/scummvm/blob/18cd31fa010cc0af8d4210add4228c3b010a252f/engines/tetraedge/game/inventory.cpp#L108-L119 |
engines/tetraedge/detection.cpp
Outdated
| Common::IT_ITA, | ||
| Common::ES_ESP, | ||
| Common::RU_RUS, | ||
| Common::HE_ISR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to note it's an optional fan translation in a comment here.
For the other languages, the data is in the standard game package so it makes sense to offer all options. If this requires a patch first then if the files aren't available then maybe we shouldn't offer this option? I'm wondering if something can be done in TetraedgeMetaEngineDetection::toDetectedGame to check for the availability before adding it to the list. That may not be the best place to do it though, not sure how other engines handle this.
Either way it would be good to test that the game correctly falls back to English if the files are not available. If it doesn't make sense to test for the data in the detector, we could do a toast on startup saying the chosen language is not available and it fell back to English, then translate that string. There may even already be an equivalent string elsewhere in scummvm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, added a comment about the addtional patch... it does falls back to english if the files are not available
This is done by the check for the main language file: https://github.com/blooperz/scummvm/blob/9735eb9daa85f49398fbe3c6bb6fad0af28b3cd7/engines/tetraedge/game/application.cpp#L160-L172
(and currently also by the help file which is astonishing IMO)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at other engines, it seems they just print a warning (in console, not translated) that the language falling back to english automatically. (I think this behaviour makes sense)
The original idea there was to have the language fall back to one that's available and I basically copied it from the original - but looking again I think the implementation may be wrong, so I'd be happy to take a patch that does it correctly :) |
9735eb9 to
d1e16ef
Compare
|
Thank you, the suggested implementation of the help files works (tested), but if the selected language is not available it falls back to english. |
I was unclear, but I did mean fall back to English so that's fine. That's what the original code does and it's how I made my hack in The file finding code overall is not so clean (my fault!) as it's some combination of my faithful reproduction of how the original worked, and adding changes I needed to do to make it work over multiple versions and platforms in ScummVM. Will give is PR another look and try out tonight but it looks pretty good now, thanks! |
|
Looks good, thanks! |
This adds support for hebrew fan translation of Syberia 1 and 2.
Specifically, if the game is detected as hebrew, the text is converted to the correct BiDi ordering.
Thank you for your amazing work, which have made this possible.