Skip to content

New Features

queue edited this page Jul 19, 2025 · 3 revisions

Intro

This wouldn't be Localization Plus without adding a couple extra features for users and developers. I have a decent backlog of features I want to add in future versions, but for now let me show you what features v2.0 brings!

Features for casual users

Prefix Inflection and Order

Do you speak a language where the form of used adjectives changes according to the thing they're describing? I've added support for these cases when it comes to item prefixes! Some languages also order these differently, so I've added support for that too.

(Both of these can be freely turned on or off inside the mod's configuration too!)

Below you can see an example in es-ES.

  1. Smart Prefix Inflection and Smart Prefix Position toggled on
  2. Only Smart Prefix Position toggled on
  3. Only Smart Prefix Inflection toggled on
  4. None toggled on (Vanilla)
asdasdadsdassdadasdasdasdas

Features for developers

Custom Prefix Position

Ever wanted to make a really cool item name that even changes the position of the prefix inside the name? You may have had to settle for ugly string.Split(' ') and string.Join(' ', parts) operations inside ModifyTooltips, but with Localization Plus you don't need to do that anymore! Simply use this format:

DisplayName: My Super {Prefix} Sword

And Localization Plus will handle the rest, including trimming the spaces around it if needed.

Adding Localizable Cultures

You can also add your own localizable cultures, just like Localization Plus adds support for 18 new languages by itself. I've explained the process in full in this other wiki article: Registering a New Culture

Adding Comments to Localization Categories and Entries

Using Localization Plus, you can add comments in localization files. This means no more typing repeated comments manually. Use the LangUtils.AddComment() method, or the Mod.AddComment() extension method to use this feature.

(General) Working with Modded and Vanilla Language Files

If you use Localization Plus as a project reference, you will be able to use many methods from the LangUtils utilities class. This class contains a decent amount of, as the name implies, localization utilities. However, the main focus of the methods here is allowing you to easily work with localization files directly.

Some of the things you can do include:

  • Extracting localization files from a Mod instance using the Mod.GetLocalizationFiles() extension method.
  • Getting the record type tML uses for manipulating these files with any overload of the TmodFile.FileEntry.ToLocalizationFile() extension method.
  • Writing manipulated localization files back to disk using the LocalizationFile.WriteToDisk() extension method.
  • Extracting vanilla localization files at various levels of parsing (I recommend using LangUtils.GetVanillaLanguageFilesForCultureFlattened() since the result is cached for speed).
  • Extracting vanilla localization values from multiple cultures using LangUtils.GetVanillaLocalizationValues().

Checking if Other Mods Localize for a Specific Culture

If you want to know if a Mod contains localizations for, say, es-ES, you can do so easily:

if (mod.HasLocalizationsFor("es-ES"))
{
    // This mod has es-ES localization files!
}

This method also works for custom cultures.

Clone this wiki locally