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

Use Interplanetary Polyglot instead of custom patch #26

Merged
merged 1 commit into from
Jul 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions CzechTranslation/CzechTranslation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,10 @@ public class CzechTranslation : ModBehaviour

public static string translationFile = "translations/czech.xml";

private void Awake()
{
Instance = this;
}

private void Start()
{
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());

WriteLine($"My mod {nameof(CzechTranslation)} is loaded!");
}

public static void WriteLine(string msg, MessageType type = MessageType.Info)
{
Instance.ModHelper.Console.WriteLine($"{type}: {msg}", type);
var api = ModHelper.Interaction.TryGetModApi<ILocalizationAPI>("xen.LocalizationUtility");
api.RegisterLanguage(this, "Czech", translationFile);
}

public static void WriteError(string msg) => WriteLine(msg, MessageType.Error);
}
}
12 changes: 12 additions & 0 deletions CzechTranslation/ILocalizationAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using OWML.ModHelper;
using System;

namespace CzechTranslation
{
public interface ILocalizationAPI
{
void RegisterLanguage(ModBehaviour mod, string name, string translationPath);
void AddLanguageFont(ModBehaviour mod, string name, string assetBundlePath, string fontPath);
void AddLanguageFixer(string name, Func<string, string> fixer);
}
}
78 changes: 0 additions & 78 deletions CzechTranslation/TextTranslationPatches.cs

This file was deleted.

7 changes: 5 additions & 2 deletions CzechTranslation/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"author": "shippy",
"name": "Czech Localization",
"uniqueName": "shippy.czech",
"version": "0.3.0",
"owmlVersion": "2.5.2"
"version": "0.4.0",
"owmlVersion": "2.5.2",
"dependencies": [
"xen.LocalizationUtility"
]
}