Difference between revisions of "The Language Pack Concept"
Line 97: | Line 97: | ||
<span style="color: red;">I think we should stick with ae/oe/ue and no special characters … | <span style="color: red;">I think we should stick with ae/oe/ue and no special characters … | ||
We need to use special editor-config to edit the batch files. A „normal“ edit with notepad would „destroy“ the file – I think that’s a high risk for failures? | We need to use special editor-config to edit the batch files. A „normal“ edit with notepad would „destroy“ the file – I think that’s a high risk for failures? - needs to be discussed but maybe every language pack admin can decide himself?</span> | ||
''' | ''' |
Revision as of 02:14, 8 November 2021
Technical Specs
Core concepts overview
Language Packs are “add-ons”. They need eXoDOS full installed. Yet they are designed to be as separate as possible to avoid conflicts, overwrites and complicated merges that require parsing and validating existing data, at the cost of some potential data duplication.
- Each language is a separate pack. Users can install several as they do not overlap
- Each language pack has its own release schedule, asynchronous from eXoDOS or other language packs
- Each language pack includes its own XML that its installer will merge in eXoDOS’ “MS-DOS.xml” leveraging the existing “merge.bat” util
- Each language pack includes its own Playlist (xml) with all games included in the language pack and all games, which are already included in eXoDOS and contain beside English among other also this language
- eXoDOS start scripts (batch files) always check if there are different language versions available and let the user select their prefered language
- For games that do not exist in base-eXoDOS, a new game entry is appended to MS-DOS.xml
- Multilanguage games (that may or may not exist in eXoDOS already) where language is set during installation or setup or through a change of files get their own standalone preconfigured entry, which implies duplication of sources
- Multilanguage games (that exist in eXoDOS already) where language is set during startup or ingame are linked to the base-eXoDOS entry in the language playlist
Structure
As separate add-ins, language pack files are stored in their own folder structure that plugs to eXoDOS (examples are for the French language pack)
xml\french
- Contains the LB platform XML files (“french.xml” and “frenchfamily.xml”) that will be
merged into MS-DOS.xml in the same folder by the language pack setup.
eXo\eXoDOS\!french
- Contains all localized game zips and is the destination for installed games. Functional equivalent of “ \eXo\eXoDOS” for regular eXoDOS
eXo\eXoDOS\!dos\!french
- Contains individual game folders that include localized install batch, game launch batch,
dosbox.conf, exception batch (optional)
- Each game folders contain an “Extras” subfolder for localized manual and other documents
as well as a localized Alternate Launcher.bat
- Functional equivalent of “X:\eXoDOS\eXo\eXoDOS\!dos” for regular eXoDOS
Images\MS-DOS\<image type>\France
- Localized game images should be stored in a regional subfolder for easier packing.
LaunchBox already has pre-configured folders such as France and Germany. A new folder should be created if necessary.
After discussion with eXo, this requires a little more work as it is probable LB just loads images based on its “region” settings. Open question is: are multiple regions supported for a single game, and if yes, will it fetch images in all region folders? This is a problem for existing games mainly, as new games (=not existing in eXoDOS) will be added with the proper region. I tested the whole image thing in LB. The regions currently set in Launchbox are „North America“ and „United States“ in this order. The Language pack setup has to add the language pack region and set the order to „<language pack language>“, „United States“, „North America“. LB loads the Images in this order then from the folders
eXo\dosbox
- Contains a localized config.bat file (renamed to config_FR.bat for French), for global DOSBox
settings management
Is this really needed? It would be called in the eXo/util/!german/Launch.bat
eXo\util\!french
- Contains all localized util files:
- dosbox.txt (with the matching table for the games<->dosbox version
- multiplayer.txt (with the matching table "game has multiplayer options")
- openFolder.bat (the batch file to open the extras folder for the language pack (see "Launchbox integration")
- Launch.bat (the batch that launches the games)
eXo\LanguagePacks\french (YET TO BE DEFINED – Placeholder)
- Contains setup batch + other necessary files for language packs setup and management.
My suggestion would be to include localized setup batches in every language pack in their own folder, then instruct users to extract the language pack over their existing eXoDOS installation, then browse to “LanguagePacks\French” and run setup_FR.bat there, for example. This way in the case of several language packs installed, the setup files do not overwrite each other in a different language, and we do not have to worry about asking the user what languages he wants the setup in. The language of the setup is always in the language of the pack it belongs to. Yet if it finds several language XML’s, it installs all of them
Setup and update
The full setup mechanism is still to be precisely defined at this stage.
Existing base concepts:
- Extraction of the xml files to the xml folder
- Extraction of all localized game zips to the localized game folder
- Extraction of all game files and extras to the localized “!dos” folder
- Extraction of all pictures to the region-specific images folders
- Extraction of the localized config batch file
- Extraction of the localized util-folder files
XML Merging:
- Merge.bat parses all xml files in the xml folder and identifies installed language pack(s)
- Asks the user if he wants adult games or not to select the proper source XML from the
language pack(s) and the proper destination XML from the base eXoDOS install
- Merges the appropriate language pack(s) xml files into the chosen base xml.
- Adult games included: merges french.xml (+other installed language packs) into base
MS-DOS.xml, copy to Data\Platforms
- Adult games excluded: merges frenchfamily.xml (+other installed language packs)
into dosfamily.xml and copy to Data\Platforms as MS-DOS.xml
This implies every time a language pack is installed (be it for the first time or for an update), it creates a new clean MS-DOS.xml, overwriting potential manual changes. that’s the same with base-eXoDOS, it would overwrite the xml – I think manual changes shouldn‘t be considered
Bat files localization
Game install and launch bat files need to have their “echo” instructions localized for a better user experience. A template of files is created for each language. The download on demand mechanism is stripped out, as language packs will only be released as full packages (no “lite” releases). To support foreign languages accents and special characters, the codepage of batch files needs to be changed to Unicode (UTF-8). This is done by adding these lines to the beginning of batch files to call a codepage change to 65001 (ref: https://docs.microsoft.com/en-us/windows/win32/intl/code-page-identifiers)
I think we should stick with ae/oe/ue and no special characters … We need to use special editor-config to edit the batch files. A „normal“ edit with notepad would „destroy“ the file – I think that’s a high risk for failures? - needs to be discussed but maybe every language pack admin can decide himself?
@echo off REM call Codepage 65001 for UTF-8 accents support @chcp 65001 cls
The files that need translation are:
- Install.bat (in every “!dos\!french\”-game folder - the file is always the same and can just be copied to every folder)
- Gamename (year).bat (in every “!dos\!french\”-game folder - the file is always the same and can just be copied to every folder)
- exception.bat (optional in the game folder ("eXo\eXoDOS\!dos\!french\..."), mostly for scummvm games
- Alternate Launcher.bat (in every game folder “Extras” subfolder)
- Config.bat (only once in “eXo\Dosbox”, renamed to config_fr.bat)
- Launch.bat (only once in "eXo\util", moved to "eXo\util\!french")
Games packaging and localized names
Games are packaged in the same format as other eXoDOS games: GameName (year).zip When an official localized name exists for a game, this should be used instead of the English name.
LaunchBox integration
Three additional applications need to be merged into existing games, with the language as prefix to sort them out properly:
- Standard game
- Alternate Launcher (pixel perfect & shader options)
- Open Extras folder (for localized manuals and docs)
Example for Space Quest IV French:
“Open Folder.bat” is a simple batch: “explorer.exe .” that opens explorer from the folder the batches is run from. These new entries should also be localized themselves for consistency. How it looks in the contextual menu:
What about new games that do not exist yet in eXoDOS? We just merge a full game entry in the french.xml instead of an additional application? Unlikely scenario – what happens if two language packs both insert the same game that doesn’t exist in eXoDOS (ie, a game that would only exist in French and German but not English). Borderline, I know...
Language Playlists
To be defined... Timber? :D