Translation Extensions & Issues Pt 1 #3348
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR collects all the minor patches I've done recently on the Player´s translation feature.
Basically I've split my working branch into 3, depending on how deep the changes would go.
Pt.2 would contain some changes to liblcf, to be able to store the selected language setting inside savefiles
Pt.3 is highly experimental & does all the unsafe, live patching of the interpreter state, to be able to switch languages mid-game
And if Pt.3 works out, maybe I'll proceed to experiment with some sort of AI-based auto-translation feature. Let's see.
Opening the language selection menu via custom command (Issue #2945):
Previously, the language selection has been hardcoded to be part of the title scene. This was an issue for games that use the "NewGame" flag & implemented their own title screen in-engine.
This PR implements a new scene type for the langue menu and also adds a way for this custom scene to be accessed via either of the currently provided "custom menu" options:
Also, I added support for accessing EasyRPGs "Settings" menu in this manner. This was previously commented out, but can now also be accessed via both of these ways, by using value "206" (Save Menu Cmd) or "6" (DirectMenuPatch)
Turning of the "Language" menu on title screen.
See feature request here: https://community.easyrpg.org/t/turning-off-the-menu-option-created-by-translation/1277
Two new config options have been added:
"LanguageInTitle" can be used to remove the "Language" options from the title screen entirely, similarly to the previously existing 'SettingsInTitle' config option.
As an alternative, a new way of accessing the Language select scene has been added via the "StartupLangSelect" option. If set, the menu is shown right before the actual title screen of the game is boot up.
Options are: "Never", "FirstStartup", "Always".
"FirstStartup" will try to look for existing save files & only show the language screen, if none are found.
Generate only a warning when no Language folder is found (Issue #3213)
As described in the issue, the player would generate an error & thus force the Player to exit, if it was started with the "--language" option for a game where no "Language" folder exists. This would also be an issue for loading up a savegame where the "translation" field is set.
Translating a game's title (Issue #3097)
A new field in "meta.ini" can be used to translate the game title into different languages. As in the vanilla RPG_RT.ini, the name for this option is "GameTitle".
Dynamic language switching in-game
In addition to the custom ways of accessing the language menu in-engine, I also added a new option to EasyRPG´s F1 Settings screen. This can't be deactivated at the moment, maybe another config-flag should be added for this? 🤔
This doesn't change the way translation is handled in-game (yet), so for the language-switch to be fully active, one has to leave the current map, so that the Player can properly refresh any currently active events.
For a futue PR I'd like to overhaul the way the language-switch works when in-game, so that even currently active interpreter stacks can be fully switched to another translation. I'll probably add a new command too for this, so prepare for some weird test game experiences where the game just randomly switches between languages in unexpected ways. xD