The script is written in Python and managed by poetry. A standard setuptools may install it as a package, or you may use poetry to manage the virtualenv and installation process.
The mvloc
command can be invoked with following setups:
- Use pip to install the package. (virtualenv is recommended)
- Use poetry to install the package (
poetry install
) then run it bypoetry run mvloc
.
All mvloc
subcommands starting with batch-
generates report.txt
file that contains logs and outputs of all task
in a workflow.
The repo is designed to work with Weblate. Following Weblate addon settings are recommended:
- Component discovery
Regular expression to match translation files against: locale/(?P<component>.*)/(?P<language>[^/.]*)\.po File format: gettext PO file (monolingual) Define the monolingual base filename: locale/{{ component }}/en.po Define the base file for new translations: locale/{{ component }}/en.po
- Unzip the latest FTL: Multiverse into src-en/ directory
- Run
mvloc batch-generate --clean en
The command extracts localizable strings from src-en/
and updates en.po
files in locale/
. Weblate can
automatically grab the changes once the repository is updated.
Edit mvloc.config.jsonc
file, then and follow the "Updating the English strings" workflow.
- Unzip the latest FTL: Multiverse into
src-en/
directory - Run
mvloc batch-apply <langname>
-- Example:mvloc batch-apply ko
The command transforms XMLs in src-en/
using translation files on locale/
,
then writes them out to output/<langname>
directory.
- Unzip the original FTL: Multiverse into
src-en/
directory - Create
src-<langname>/
directory and place the translated XMLs there -- Example:src-ko/
. - Run
mvloc batch-generate --diff --clean --empty-identical <langname>
The bootstrapping process tries to reverse the applying process: extracting the strings out of already translated XML files. This is useful when migrating from an ongoing translation project.
In case where the string extraction criteria is incomplete to cover your XMLs, the unhandled changes are shown in
the report.txt (shown as "Diff report" tasks). In that case, adjust mvloc.config.jsonc
appropriately, follow the
"Updating the English strings" workflow to update en.po files, and repeat this workflow again.
- This is useful when importing a new translated XML file over an already existing locale in the project.
- Put XML files into
src-<langname>/
. Make sure to remove any other files or they will be overwritten as well!- Remove
--clean
option when invokingmvloc
. Other files will be untouched.
FTL: Faster Than Light is a trademark of Subset Games. Unless otherwise stated, the authors and the contributors of this repository is not affiliated with nor endorsed by Subset Games.