Skip to content

Structuring your plugin

OsOmE1 edited this page Feb 3, 2021 · 3 revisions

Structuring your plugin

Every class you want to translate should have a separate file or class with the appropriately named attribute.
All your translator classes should be in a folder called translators.

Then your plugin should look something like this.

This example shows what your plugin should include together with additional personal code.

public void PostProcessTypeModel(TypeModel model, PluginPostProcessTypeModelEventInfo data)
{
    Translator translator = new Translator(this, model);
    translator.StartTranslating();

    //optional
    using var exportFile = new FileStream(@"C:\yourouputfile.txt", FileMode.Create);
    StreamWriter output = new StreamWriter(exportFile);
    foreach ((string obf, string clean) in translator.Translations)
    {
        output.WriteLine($"{obf}/{clean}");
    }
    output.Close();
}
Clone this wiki locally