Skip to content

Localization

Fran Kelava edited this page Oct 5, 2026 · 20 revisions

Localization API

Localization folder

The designated location for localization file storage is your mod's lang folder.

In that folder:

  • Create one folder per module, named after the module's full type name.
  • Place localization data files within, one for each supported locale.

For example:

  • lang/Fahrenheit.Mods.Template.TemplateModule/en_US.json
  • lang/Fahrenheit.Mods.Template.TemplateModule/zh_Hant.json
  • lang/Fahrenheit.Mods.Template.OtherModule/en_US.json

Important

The folder must be named precisely after the module's full type name. For example:

namespace Fahrenheit.Mods.Template;

public class TemplateModule : FhModule {
// The full type name is Fahrenheit.Mods.Template.TemplateModule

Tip

By creating a folder for another mod's module, you can modify or even add localization to other mods, as long as you follow them in the load order.

Localization file format

A Fahrenheit localization file is a JSON file containing a single dictionary with string keys and values.

An example is given here:

{
    "received_backup_message.doom": "Your friend's death dooms you.",
    "received_backup_message.grave_hp": "You feel inclined to follow in your friend's footsteps.",
    "received_backup_message.bad_breath": "Your friend's death leaves a bad taste in your mouth.",
    "received_backup_message.random": "Your friend's death twists your fate.",
    "received_backup_message.generic": "You are touched by your friend's death."
}

Important

A localization data file must be named exactly {LANG_ID}.json, where {LANG_ID} is a ISO 639 language ID.

For example:

  • en_US.json
  • zh_Hant.json
  • ko_KR.json
  • de_DE.json

For the list of recognized language IDs, see src/core/i18n_cctor.cs.

Clone this wiki locally