Skip to content
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

Split up main file into components #5

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

mtimoustafa
Copy link
Contributor

This change splits up the main RimTranslate.py file into different components. This makes it easier to read and debug the code, and DRYs it up as well.

It creates the following hierarchy:

|  RimTranslate.py => entrypoint. Sets configs, calls input / output builders
| -- config/
    | -- config.py => stores version and po file metadata
| -- src/
    | -- builders/
        | -- output_dir_builder.py => handles creating output files from PO files
        | -- source_dir_builder.py => handles creating PO files from input and compendium files
    | -- helpers/
        | -- compendium_helpers.py => helps create and merge the compendium
        | -- pot_helpers.py => abstracts out all the logic for generating PO files
    | -- logger.py => handles logging
    | -- parser.py => handles command arguments

Additionally, it's implied that PO files would be created in po/, and output files in output/. We can leave this open for the user to choose, or make it the default later on.

@mtimoustafa
Copy link
Contributor Author

@winterheart sorry this is such a big change in one go 🙏🏽 The functionality of the program is not altered at all here, so it should behave the same as it did before.

There are a couple of small bugfixes as well, which unfortunately I can't remember. I tested to the best of my abilities various combinations of input and output files.

The reason I'm making all these changes is in preparation for using RimTranslate in https://github.com/Ludeon/RimWorld-ar. As I'm new to Python, making the program more readable and modular will help in case any issues arise in the future.

Of course, no pressure on merging this change if you don't feel like it fits your main repo. Happy to keep this as a separate fork if that's your preference.

@winterheart
Copy link
Owner

Hi.
Sorry for delay. I'm not using this tool anymore. Overall PR is looking good, but I cannot test it due lack of time.
I can grant you developer rights to repository if you want.

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