KEMBAR78
TETRAEDGE: Support Hebrew fan translation by BLooperZ · Pull Request #4914 · scummvm/scummvm · GitHub
Skip to content

Conversation

@BLooperZ
Copy link
Contributor

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.

@BLooperZ
Copy link
Contributor Author

BLooperZ commented Apr 16, 2023

On a related note, I think the behaviour that the game language is determined (also) by the help files is unexpected.
What do you think about the following modification? (for another PR/commit)

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

Common::IT_ITA,
Common::ES_ESP,
Common::RU_RUS,
Common::HE_ISR,
Copy link
Contributor

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.

Copy link
Contributor Author

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)

Copy link
Contributor Author

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)

@mduggan
Copy link
Contributor

mduggan commented Apr 17, 2023

On a related note, I think the behaviour that the game language is determined (also) by the help files is unexpected. What do you think about the following modification? (for another PR/commit)

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 :)

@BLooperZ BLooperZ force-pushed the syberia_rtl branch 2 times, most recently from 9735eb9 to d1e16ef Compare April 17, 2023 05:06
@BLooperZ
Copy link
Contributor Author

BLooperZ commented Apr 17, 2023

Thank you, the suggested implementation of the help files works (tested), but if the selected language is not available it falls back to english.
this is the way inventory objects behave as well.
do you mean you would like it to fall back to the first available language instead? (70cc1a7) should the implementation for inventory object change as well?

@mduggan
Copy link
Contributor

mduggan commented Apr 17, 2023

Thank you, the suggested implementation of the help files works (tested), but if the selected language is not available it falls back to english. this is the way inventory objects behave as well. do you mean you would like it to fall back to the first available language instead? (70cc1a7) should the implementation for inventory object change as well?

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 TeCore::findFile work too.

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!

@mduggan
Copy link
Contributor

mduggan commented Apr 17, 2023

Looks good, thanks!

@mduggan mduggan merged commit 91fb229 into scummvm:master Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants