Outer Wilds Translation Mod Utility
This project is meant to have common code required for translation mods.
Based on Outer Wilds Korean Translation and Outer Wilds Traditional Chinese Translation.
Getting started
- Create a base mod using the regular mod template..
- Rename all files to match the mod name (for example let's say we are making the DothrakiTranslation mod):
- Instead of
ModTemplate/ModTemplate.cs
, rename files toDothrakiTranslation/DothrakiTranslation.cs
. (This also applies toModTemplate.csproj.user
.) - Replace every instance of
ModTemplate
withDothrakiTranslation
in the script texts (should be just theModTemplate.cs
). - Fix up
filename
inmanifest.json
accordingly.
- Instead of
- Add a dictionary entry to the end of the
manifest.json
dict that specifies the dependency for Outer Wilds Mod Manager:
Note that this will not automatically install the dependency, however the Outer Wilds Mod Manager will prompt users to install and enable the dependency when they enable your translation mod."dependencies": [ "xen.LocalizationUtility" ]
- Add a file called
ILocalizationAPI.cs
(a C# interface) into your mod directory, with the following content - replaceDothrakiTranslation
with the name of your translation, of course:using OWML.ModHelper; using System; namespace DothrakiTranslation { 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); } }
- In your mod code (
DothrakiTranslation.cs
), access the utility mod like so:
This assumes that the XML file with original text and your translations is in thenamespace DothrakiTranslation { public class DothrakiTranslation : ModBehaviour { public static DothrakiTranslation Instance; private void Start() { var api = ModHelper.Interaction.TryGetModApi<ILocalizationAPI>("xen.LocalizationUtility"); api.RegisterLanguage(this, "Dothraki", "assets/Translation.xml"); } } }
assets/Translation.xml
file. - Optionally, add a font or a fixer function with
api.AddLanguageFont
orapi.AddLanguageFixer
underneath theapi.RegisterLanguage
line. Adding a font is optional. A "fixer" function will take in a string and output a string where the characters have been correctly reformatted. This is necessary for certain languages, e.g. right-to-left languages like Arabic or Farsi.
Other info
This repo contains the base game English translation file (Translation.xml) which can be used as a template for any translation mod. Just translate the
When adding a font, you must first package it into a Unity asset bundle. Use Unity 2019.4.27f1 for this (Unity Hub has options for downloading legacy versions of Unity) as this is the version Outer Wilds was released in.
Interplanetary Polyglot
A utility for creating translation mods for Outer Wilds with minimal code